|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Active class implementation to wait multiple refresh. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CVIMPSTSTORAGEACTIVEHANDLER_H |
|
21 #define CVIMPSTSTORAGEACTIVEHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "tvimpstenums.h" |
|
26 // FORWARD DECLARATIONS |
|
27 class MVIMPSTStorageActiveObserver; |
|
28 class MVIMPSTStorageContactList; |
|
29 class MVIMPSTStorageContact; |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * The CVIMPSTStorageRefreshTimer class handles the waiting functionality for the |
|
34 * storage manager to wait before calling observer in case of multiple |
|
35 * contacts adding. |
|
36 * |
|
37 * @lib vimpststorage.dll |
|
38 * @since 5.0 |
|
39 */ |
|
40 NONSHARABLE_CLASS ( CVIMPSTStorageActiveHandler ) : public CTimer |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 * @param aObserver The observer to which the notify about the |
|
47 * timer events is |
|
48 * given. |
|
49 */ |
|
50 static CVIMPSTStorageActiveHandler * NewL( MVIMPSTStorageActiveObserver* aObserver ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 ~CVIMPSTStorageActiveHandler(); |
|
56 |
|
57 protected: // Functions from CActive |
|
58 |
|
59 /** |
|
60 * @see CActive |
|
61 */ |
|
62 void RunL(); |
|
63 |
|
64 /** |
|
65 * @see CActive |
|
66 */ |
|
67 TInt RunError( TInt aError ); |
|
68 |
|
69 /** |
|
70 * @see CActive |
|
71 */ |
|
72 void DoCancel(); |
|
73 |
|
74 public: // new methods |
|
75 |
|
76 /** |
|
77 * Starts timer. If timer is already running, stops timer and |
|
78 * restarts it. |
|
79 */ |
|
80 void IssueRequest(TVIMPSTEnums::TVIMPSTStorgaeEventType aType, |
|
81 MVIMPSTStorageContactList *aList, |
|
82 MVIMPSTStorageContact* aContact, |
|
83 TInt aContactIndex ); |
|
84 |
|
85 private: |
|
86 |
|
87 /** |
|
88 * C++ default constructor. |
|
89 */ |
|
90 CVIMPSTStorageActiveHandler( MVIMPSTStorageActiveObserver* aObserver ); |
|
91 |
|
92 /** |
|
93 * By default Symbian 2nd phase constructor is private. |
|
94 */ |
|
95 void ConstructL(); |
|
96 |
|
97 private: // Data |
|
98 |
|
99 // A pointer to the observer |
|
100 MVIMPSTStorageActiveObserver* iObserver; /// Not owned |
|
101 // Event type |
|
102 TVIMPSTEnums::TVIMPSTStorgaeEventType iEventType; |
|
103 // Not owns a contact List |
|
104 MVIMPSTStorageContactList* iList; |
|
105 // Not owns contact |
|
106 MVIMPSTStorageContact* iContact; |
|
107 // index of contact |
|
108 TInt iContactIndex; |
|
109 }; |
|
110 |
|
111 #endif // CVIMPSTSTORAGEACTIVEHANDLER_H |
|
112 |
|
113 // End of File |