|
1 /* |
|
2 * Copyright (c) 2002-2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CCLFEVENTHANDLER_H |
|
20 #define CCLFEVENTHANDLER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "CCLFServerProxy.h" |
|
24 #include <CLFContentListing.h> |
|
25 #include <e32base.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MCLFEventHandlerObserver; |
|
29 |
|
30 typedef void ( CCLFServerProxy::*TMemberFnOp )( TRequestStatus& aStatus ); |
|
31 typedef TInt ( CCLFServerProxy::*TMemberFnCancel )(); |
|
32 typedef void ( MCLFEventHandlerObserver::*TMemberFnObserver )( TInt aError ); |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Item change event handler. |
|
38 * |
|
39 * @lib ContentListingFramework.lib |
|
40 * @since Series 60 3.0 |
|
41 */ |
|
42 NONSHARABLE_CLASS( CCLFEventHandler ) : public CActive |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 */ |
|
49 static CCLFEventHandler* NewL( CCLFServerProxy& aEventHandler, |
|
50 MCLFEventHandlerObserver& aObserver ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 virtual ~CCLFEventHandler(); |
|
56 |
|
57 public: // New functions |
|
58 |
|
59 /** |
|
60 * Start event observing. |
|
61 * @since Series 60 3.0 |
|
62 */ |
|
63 void ObserverUpdateStartEvent(); |
|
64 |
|
65 /** |
|
66 * Start event observing. |
|
67 * @since Series 60 3.0 |
|
68 */ |
|
69 void ObserverUpdateEndEvent(); |
|
70 |
|
71 /** |
|
72 * Get changed items. |
|
73 * @since Series 60 3.0 |
|
74 * @param aItemArray changed item ID array |
|
75 */ |
|
76 void GetChangedItemsL( RArray<TCLFItemId>& aItemArray ); |
|
77 |
|
78 protected: // Functions from base classes |
|
79 |
|
80 /** |
|
81 * From CActive |
|
82 */ |
|
83 void DoCancel(); |
|
84 |
|
85 /** |
|
86 * From CActive |
|
87 */ |
|
88 void RunL(); |
|
89 |
|
90 /** |
|
91 * From CActive |
|
92 */ |
|
93 TInt RunError( TInt aError ); |
|
94 |
|
95 private: |
|
96 |
|
97 void DoStart(); |
|
98 |
|
99 private: |
|
100 |
|
101 /** |
|
102 * C++ default constructor. |
|
103 */ |
|
104 CCLFEventHandler( CCLFServerProxy& aEventHandler, |
|
105 MCLFEventHandlerObserver& aObserver ); |
|
106 |
|
107 private: // Data |
|
108 // Ref. |
|
109 CCLFServerProxy& iEventHandler; |
|
110 |
|
111 // Ref. |
|
112 MCLFEventHandlerObserver& iObserver; |
|
113 |
|
114 TMemberFnOp iOperationFunction; |
|
115 |
|
116 TMemberFnCancel iCancelFunction; |
|
117 |
|
118 TMemberFnObserver iObserverFunction; |
|
119 |
|
120 }; |
|
121 |
|
122 #endif // CCLFEVENTHANDLER_H |
|
123 |
|
124 // End of File |