summaryrefslogtreecommitdiffstats
path: root/plugins/contacts/symbian/contactsmodel/tsrc/asynaccess/inc/cntmodeltestersettonetocontacts.h
blob: d878fd2036b0c52e0e3d7de8a46766410df075e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:

*

* Description: 

*
*/

#ifndef __CCntModelTesterSetToneToContacts_H__
#define __CCntModelTesterSetToneToContacts_H__

// INCLUDES
#include <e32base.h>
//#include "mpbkbackgroundprocess.h"
#include <cntdef.h>

// FORWARD DECLARATIONS
class CContactIdArray;
class CContactDatabase;
class CContactItem;

// CLASS DECLARATION

/**
 * Assign ringing tone to group members process.
 */
class CCntModelTesterSetToneToContacts  :
        public CBase        
    {
    public: // Interface
        /**
         * Creates a new instance of this class.
         *
         * @param aEngine   reference to a contact engine
         * @param aContacts contacts to delete
		 * @param aRingingToneName ringing tone file name
         */
        static CCntModelTesterSetToneToContacts* NewL
            ( const CContactIdArray& aContacts,
              const TDesC& aRingingToneName);

        /**
         * Destructor.
         */
        ~CCntModelTesterSetToneToContacts ();

    public: 
        void StepL();
        TInt TotalNumberOfSteps();
        TBool IsProcessDone() const;
        void ProcessFinished();
        TInt HandleStepError(TInt aError);
        void ProcessCanceled();
        TInt GetCount();
		TInt iSetCount;
    private:  // Implementation
        CCntModelTesterSetToneToContacts ();
        void ConstructL(const CContactIdArray& aContacts, const TDesC& aRingingToneName);
        TBool MoreContactsToSet() const;
        void Cancel();
        void SetRingingToneL(CContactItem &aContact);

    private:  // Data
    
        CContactDatabase* iDb;
        /// Own: initial number of contacts to assign a tone
        TInt iTotalContactsToSet;
        /// Own: ids of contacts to set ringing tone to
        CContactIdArray* iContacts;
        /// Own: count of contacts succesfully set

        /// Own: ringing tone file name
        HBufC* iRingingToneFile;
        
    };

_LIT(KDbFileName,"c:t_asynaccess.cdb");
#endif // __CCntModelTesterSetToneToContacts _H__

// End of File