|
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // cimfinder.h |
|
15 // |
|
16 |
|
17 /** |
|
18 * @file |
|
19 * @internalComponent |
|
20 * @released |
|
21 */ |
|
22 |
|
23 #if !defined (__CIMFINDER_H__) |
|
24 #define __CIMFINDER_H__ |
|
25 |
|
26 class CImFinder : public CMsgActive |
|
27 /** |
|
28 @internalComponent |
|
29 @released |
|
30 */ |
|
31 { |
|
32 public: |
|
33 IMPORT_C void FindFirstL(TMsvId aRootEntry, TRequestStatus &aStatus); |
|
34 IMPORT_C ~CImFinder(); |
|
35 IMPORT_C virtual void FindNextL(TRequestStatus &aStatus); |
|
36 void FindFirstL(const CMsvEntrySelection& aInitialSelection, TRequestStatus &aStatus); |
|
37 |
|
38 class CImEntryStack : public CBase |
|
39 { |
|
40 public: |
|
41 static CImEntryStack* NewL(); |
|
42 ~CImEntryStack(); |
|
43 inline void PushL(TMsvId aId); |
|
44 inline TMsvId PopL(); |
|
45 inline TBool Empty() const; |
|
46 inline void Reset(); |
|
47 |
|
48 private: |
|
49 void ConstructL(); |
|
50 |
|
51 CMsvEntrySelection* iFolders; |
|
52 }; |
|
53 |
|
54 protected: |
|
55 void ConstructL(); |
|
56 CImFinder(CMsvEntry& aEntry); |
|
57 |
|
58 private: |
|
59 void DoRunL(); |
|
60 |
|
61 virtual void AddChildEntriesL() = 0; |
|
62 virtual TBool IsRequiredEntryType(TUid aEntryType) const = 0; |
|
63 |
|
64 protected: |
|
65 CImEntryStack* iEntryStack; |
|
66 CMsvEntry& iCurrentEntry; |
|
67 |
|
68 private: |
|
69 enum TImmfState |
|
70 { |
|
71 EImmfEntryFound, |
|
72 EImmfFindingEntry, |
|
73 EImmfNothingFound |
|
74 }; |
|
75 |
|
76 TImmfState iState; |
|
77 }; |
|
78 |
|
79 |
|
80 class CImMessageFinder : public CImFinder |
|
81 /** |
|
82 @internalComponent |
|
83 @released |
|
84 */ |
|
85 { |
|
86 public: |
|
87 IMPORT_C static CImMessageFinder* NewL(CMsvEntry& aEntry); |
|
88 IMPORT_C static CImMessageFinder* NewLC(CMsvEntry& aEntry); |
|
89 |
|
90 protected: |
|
91 virtual void AddChildEntriesL(); |
|
92 virtual TBool IsRequiredEntryType(TUid aEntryType) const; |
|
93 |
|
94 CImMessageFinder(CMsvEntry& aEntry); |
|
95 }; |
|
96 |
|
97 |
|
98 class CImEntryFinder : public CImFinder |
|
99 /** |
|
100 @internalComponent |
|
101 @released |
|
102 */ |
|
103 { |
|
104 public: |
|
105 IMPORT_C static CImEntryFinder* NewL(CMsvEntry& aEntry); |
|
106 IMPORT_C static CImEntryFinder* NewLC(CMsvEntry& aEntry); |
|
107 |
|
108 protected: |
|
109 virtual void AddChildEntriesL(); |
|
110 virtual TBool IsRequiredEntryType(TUid aEntryType) const; |
|
111 |
|
112 CImEntryFinder(CMsvEntry& aEntry); |
|
113 }; |
|
114 |
|
115 |
|
116 class CImMessageCounter : public CImFinder |
|
117 /** |
|
118 @internalComponent |
|
119 @released |
|
120 */ |
|
121 { |
|
122 public: |
|
123 IMPORT_C static CImMessageCounter* NewL(CMsvEntry& aEntry); |
|
124 IMPORT_C static CImMessageCounter* NewLC(CMsvEntry& aEntry); |
|
125 IMPORT_C TInt Count(); |
|
126 |
|
127 protected: |
|
128 virtual void AddChildEntriesL(); |
|
129 virtual TBool IsRequiredEntryType(TUid aEntryType) const; |
|
130 |
|
131 CImMessageCounter(CMsvEntry& aEntry); |
|
132 |
|
133 private: |
|
134 TInt iCount; |
|
135 }; |
|
136 |
|
137 #endif //__CIMFINDER_H__ |