|
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: Header for Extension factory for VIMPSTUI |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CVIMPSTUIEXTENSIONFACTORY_H__ |
|
20 #define __CVIMPSTUIEXTENSIONFACTORY_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <CxSPFactory.h> |
|
25 |
|
26 class MxSPViewMapper; |
|
27 class MxSPContactManager; |
|
28 class CxSPBaseView; |
|
29 class CPbk2UIExtensionView; |
|
30 class CCoeEnv; |
|
31 class CxSPViewInfo; |
|
32 class MVIMPSTEngineServiceTableFetcher; |
|
33 class CVIMPSTUIViewManager; |
|
34 class MVIMPSTEngineFactory; |
|
35 class CVIMPSTUIMenuExtension; |
|
36 |
|
37 // CLASS DECLARATION |
|
38 /** |
|
39 * Implementation of the MxSPFactory. |
|
40 * Creates instances of the extension classes. |
|
41 */ |
|
42 // codescanner warnings can be ignored as CxSPFactory derived from CBase |
|
43 |
|
44 class CVIMPSTUiExtensionFactory : public CxSPFactory // CSI: 51 # |
|
45 { |
|
46 public: // Construction and destruction |
|
47 /** |
|
48 * Static factory function that performs the 2-phased construction. |
|
49 * @return Newly created CVIMPSTUiExtensionFactory. |
|
50 */ |
|
51 static CVIMPSTUiExtensionFactory* NewL(); |
|
52 |
|
53 /** |
|
54 * Standard C++ destructor. |
|
55 */ |
|
56 ~CVIMPSTUiExtensionFactory(); |
|
57 |
|
58 private: // from MxSPFactory |
|
59 |
|
60 /** |
|
61 * @see MxSPFactory |
|
62 */ |
|
63 CxSPBaseView* CreateViewL( TUid aViewId, CPbk2UIExtensionView& aView ); |
|
64 |
|
65 /** |
|
66 * @see MxSPFactory |
|
67 */ |
|
68 void RegisterViewMapper( MxSPViewMapper& aMapper ); |
|
69 |
|
70 /** |
|
71 * @see MxSPFactory |
|
72 */ |
|
73 TInt ViewInfoResource() const; |
|
74 |
|
75 /** |
|
76 * @see MxSPFactory |
|
77 */ |
|
78 TUint32 Id() const; |
|
79 |
|
80 /** |
|
81 * @see MxSPFactory |
|
82 */ |
|
83 const TDesC& Name() const; |
|
84 |
|
85 /** |
|
86 * @see MxSPFactory |
|
87 */ |
|
88 void RegisterContactManager( MxSPContactManager& aManager ); |
|
89 |
|
90 /** |
|
91 * @see MxSPFactory |
|
92 */ |
|
93 void SetVPbkContactManager( CVPbkContactManager& aVPbkContactManager ); |
|
94 |
|
95 /** |
|
96 * @see MxSPFactory |
|
97 */ |
|
98 void UpdateStorePropertiesL( CPbk2StorePropertyArray& aPropertyArray ); |
|
99 private: |
|
100 /** |
|
101 * Gets view count of this extension. |
|
102 * This is alternative B for providing view information. |
|
103 * Alternative A is to use ViewInfoResource method. If |
|
104 * this alternative B is used, ViewInfoResource method |
|
105 * must return KErrNotFound |
|
106 * |
|
107 * @return view count |
|
108 */ |
|
109 TInt ViewInfoCount() const ; |
|
110 |
|
111 /** |
|
112 * Gets view info at specified index. |
|
113 * This is alternative B for providing view information. |
|
114 * Alternative A is to use ViewInfoResource method. If |
|
115 * this alternative B is used, ViewInfoResource method |
|
116 * must return KErrNotFound |
|
117 * |
|
118 * @param aIndex index |
|
119 * @return view info at specified index |
|
120 */ |
|
121 const MxSPViewInfo* ViewInfo( TInt aIndex ) const ; |
|
122 |
|
123 private: |
|
124 /** |
|
125 * Finds the total number of services and creates different views for |
|
126 * different services |
|
127 * @param None |
|
128 * @return None |
|
129 */ |
|
130 void CreateServicesL(); |
|
131 /** |
|
132 * Tells if it is search view's id |
|
133 * @param aId |
|
134 */ |
|
135 |
|
136 TBool IsSearchId( TUint aId ); |
|
137 |
|
138 /** |
|
139 * Tells if it is block view's id |
|
140 * @param aId |
|
141 */ |
|
142 TBool IsBlockeId( TUint aId ); |
|
143 |
|
144 /** |
|
145 * Tells if it is tabbed view's id |
|
146 * @param aId, if its a tabbed view |
|
147 */ |
|
148 TBool IsTabbedId( TUint aId ); |
|
149 |
|
150 private: // Implementation |
|
151 /** |
|
152 * Standard C++ constructor. |
|
153 */ |
|
154 CVIMPSTUiExtensionFactory(); |
|
155 |
|
156 /** |
|
157 * Performs the 2nd phase of the construction. |
|
158 */ |
|
159 void ConstructL(); |
|
160 |
|
161 private: // Data |
|
162 // environment |
|
163 CCoeEnv& iCoeEnv; |
|
164 |
|
165 // offset index for resource file |
|
166 TInt iResourceOffset; |
|
167 |
|
168 // Owns, view id mapper |
|
169 MxSPViewMapper* iMapper; |
|
170 |
|
171 //Owns, contact manager |
|
172 MxSPContactManager* iContactManager; |
|
173 |
|
174 // Owns, engine for all services |
|
175 CVIMPSTUIViewManager* iEngine; |
|
176 |
|
177 //Doesnt Own. Need to call CVIMPSTEngineFactory::Release for Releasing this memory |
|
178 MVIMPSTEngineFactory* iEngineFactoryInstance; |
|
179 |
|
180 //own's. menuextension. |
|
181 CVIMPSTUIMenuExtension* iMenuExtension; |
|
182 |
|
183 }; |
|
184 |
|
185 #endif // _CVIMPSTUiExtensionFactory_H |
|
186 |
|
187 // End of File |