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: Handles devices internal content change events |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CMSMCONTENTCHANGEOBSERVER_H |
|
21 #define __CMSMCONTENTCHANGEOBSERVER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <mdesession.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MCmSmFileProcessingObserver; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 /** |
|
31 * Handles devices internal content change events |
|
32 * Store list processing will be started when notification is received |
|
33 * |
|
34 * @lib cmstoremanager.lib |
|
35 * |
|
36 * @since S60 v5.1 |
|
37 */ |
|
38 class CCmSmContentChangeObserver : public CBase, |
|
39 public MMdEObjectObserver |
|
40 { |
|
41 |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 * Creates new CCmSmContentChangeObserver class |
|
47 * |
|
48 * @since S60 5.1 |
|
49 * @param aSession, mds session |
|
50 * @param aObserver, observer class |
|
51 * @return pointer to CCmSmContentChangeObserver class |
|
52 */ |
|
53 static CCmSmContentChangeObserver* NewL( CMdESession& aSession, |
|
54 MCmSmFileProcessingObserver& aObserver ); |
|
55 |
|
56 /** |
|
57 * Two-phased constructor. |
|
58 * Creates new CCmSmContentChangeObserver class |
|
59 * |
|
60 * @since S60 5.1 |
|
61 * @param aSession, mds session |
|
62 * @param aObserver, observer class |
|
63 * @return pointer to CCmSmContentChangeObserver class |
|
64 */ |
|
65 static CCmSmContentChangeObserver* NewLC( CMdESession& aSession, |
|
66 MCmSmFileProcessingObserver& aObserver ); |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 */ |
|
71 virtual ~CCmSmContentChangeObserver(); |
|
72 |
|
73 /** |
|
74 * Starts content change observers |
|
75 * |
|
76 * @since S60 5.1 |
|
77 * @param None |
|
78 */ |
|
79 void StartObserversL(); |
|
80 |
|
81 /** |
|
82 * ETrue if observers are started |
|
83 * |
|
84 * @since S60 5.1 |
|
85 * @param None |
|
86 * @return ETrue if observers started |
|
87 */ |
|
88 TBool IsStarted(); |
|
89 |
|
90 protected: |
|
91 |
|
92 // From base class MMdEObjectObserver |
|
93 |
|
94 /** |
|
95 * From MMdEObjectObserver |
|
96 * See base class definition |
|
97 */ |
|
98 void HandleObjectNotification(CMdESession& aSession, |
|
99 TObserverNotificationType aType, |
|
100 const RArray<TItemId>& aObjectIdArray); |
|
101 |
|
102 private: |
|
103 |
|
104 /** |
|
105 * Performs the first phase of two phase construction. |
|
106 * |
|
107 * since S60 5.1 |
|
108 * @param aSession, mde session |
|
109 * @param aObserver, process observer |
|
110 */ |
|
111 CCmSmContentChangeObserver( CMdESession& aSession, |
|
112 MCmSmFileProcessingObserver& aObserver ); |
|
113 |
|
114 /** |
|
115 * Performs the second phase construction. |
|
116 */ |
|
117 void ConstructL(); |
|
118 |
|
119 private: // data |
|
120 |
|
121 /** |
|
122 * MdS session |
|
123 */ |
|
124 CMdESession& iMdSSession; // not owned |
|
125 |
|
126 /** |
|
127 * Observer to give notification about changed content |
|
128 */ |
|
129 MCmSmFileProcessingObserver& iObserver; // not owned |
|
130 |
|
131 /** |
|
132 * ETrue if observers started |
|
133 */ |
|
134 TBool iStarted; |
|
135 |
|
136 }; |
|
137 |
|
138 #endif // __CMSMCONTENTCHANGEOBSERVER_H |
|
139 |
|
140 |
|