|
1 /* |
|
2 * Copyright (c) 2005-2007 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: Phonebook 2 Group UI extension plug-in. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDES |
|
20 #include <e32base.h> |
|
21 #include <CPbk2UIExtensionPlugin.h> |
|
22 #include <Pbk2PluginCommandListerner.h> |
|
23 |
|
24 #include <Pbk2Commands.hrh> |
|
25 #include <MVPbkBaseContact.h> |
|
26 #include <MVPbkContactStoreObserver.h> |
|
27 |
|
28 #ifndef NAMESLISTUIEXTENTIONPLUGIN_H |
|
29 #define NAMESLISTUIEXTENTIONPLUGIN_H |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CPbkAppViewBase; |
|
33 class CPbk2AppGlobalsBase; |
|
34 class MPbk2ContactUiControl; |
|
35 class CPbk2PresentationContact; |
|
36 class MPbk2ContactEditorControl; |
|
37 class CAiwServiceHandler; |
|
38 class CPbk2NamesListExView; |
|
39 class CPbk2ApplicationServices; |
|
40 |
|
41 // CCA |
|
42 class MCCAConnection; |
|
43 class MCCAParameter; |
|
44 class CSpbContentProvider; |
|
45 // CLASS DECLARATION |
|
46 |
|
47 /** |
|
48 * Phonebook 2 Names List UI extension plug-in. |
|
49 * Creates instances of the extension classes. |
|
50 */ |
|
51 class CNamesListUIExtensionPlugin : public CPbk2UIExtensionPlugin, |
|
52 public MPbk2PluginCommandListerner, |
|
53 private MVPbkContactStoreObserver |
|
54 { |
|
55 public: // Construction and destruction |
|
56 |
|
57 /** |
|
58 * Creates a new instance of this class. |
|
59 * |
|
60 * @return A new instance of this class. |
|
61 */ |
|
62 static CNamesListUIExtensionPlugin* NewL(); |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 */ |
|
67 ~CNamesListUIExtensionPlugin(); |
|
68 |
|
69 private: //new function |
|
70 |
|
71 /* |
|
72 * Creates content provider IF not already created and social phonebook is defined |
|
73 */ |
|
74 inline CSpbContentProvider& ContentProviderL(); |
|
75 |
|
76 |
|
77 public: //MPbk2CommandListerner |
|
78 void HandlePbk2Command( TInt aCommand ); |
|
79 |
|
80 private: // From CPbk2UIExtensionPlugin |
|
81 MPbk2UIExtensionView* CreateExtensionViewL( TUid aViewId, |
|
82 CPbk2UIExtensionView& aView ); |
|
83 void DynInitMenuPaneL( TInt aResourceId, |
|
84 CEikMenuPane* aMenuPane, |
|
85 MPbk2ContactUiControl& aControl ); |
|
86 void UpdateStorePropertiesL( CPbk2StorePropertyArray& aPropertyArray ); |
|
87 |
|
88 MPbk2ContactEditorExtension* CreatePbk2ContactEditorExtensionL( |
|
89 CVPbkContactManager& aContactManager, |
|
90 CPbk2PresentationContact& aContact, |
|
91 MPbk2ContactEditorControl& aEditorControl ); |
|
92 |
|
93 MPbk2SettingsViewExtension* CreatePbk2SettingsViewExtensionL(); |
|
94 |
|
95 MPbk2Command* CreatePbk2CommandForIdL( |
|
96 TInt aCommandId, |
|
97 MPbk2ContactUiControl& aUiControl ) const; |
|
98 |
|
99 MPbk2AiwInterestItem* CreatePbk2AiwInterestForIdL( |
|
100 TInt aInterestId, |
|
101 CAiwServiceHandler& aServiceHandler ) const; |
|
102 |
|
103 TBool GetHelpContextL( TCoeHelpContext& aContext, |
|
104 const CPbk2AppViewBase& aView, |
|
105 MPbk2ContactUiControl& aUiControl ); |
|
106 |
|
107 void ApplyDynamicViewGraphChangesL( CPbk2ViewGraph& aViewGraph); |
|
108 |
|
109 void ApplyDynamicPluginInformationDataL( CPbk2UIExtensionInformation& aUiExtensionInformation ); |
|
110 |
|
111 TAny* UIExtensionPluginExtension( TUid aExtensionUid ); |
|
112 |
|
113 private: // MPbk2UIExtensionFactory |
|
114 |
|
115 MPbk2ContactEditorExtension* CreatePbk2ContactEditorExtensionL( |
|
116 CVPbkContactManager& aContactManager, |
|
117 MVPbkStoreContact& aContact, |
|
118 MPbk2ContactEditorControl& aEditorControl ); |
|
119 |
|
120 MPbk2ContactUiControlExtension* CreatePbk2UiControlExtensionL( |
|
121 CVPbkContactManager& aContactManager ); |
|
122 |
|
123 MPbk2SettingsViewExtension* CreatePbk2SettingsViewExtensionL( |
|
124 CVPbkContactManager& aContactManager ); |
|
125 |
|
126 MPbk2AppUiExtension* CreatePbk2AppUiExtensionL( |
|
127 CVPbkContactManager& aContactManager ); |
|
128 |
|
129 MPbk2Command* CreatePbk2CommandForIdL( |
|
130 TInt aCommandId, |
|
131 MPbk2ContactUiControl& aUiControl ); |
|
132 |
|
133 MPbk2AiwInterestItem* CreatePbk2AiwInterestForIdL( |
|
134 TInt aInterestId, |
|
135 CAiwServiceHandler& aServiceHandler ); |
|
136 |
|
137 private: // From MVPbkContactStoreObserver |
|
138 |
|
139 void StoreReady( |
|
140 MVPbkContactStore& aContactStore ); |
|
141 |
|
142 void StoreUnavailable( |
|
143 MVPbkContactStore& aContactStore, |
|
144 TInt aReason ); |
|
145 |
|
146 void HandleStoreEventL( |
|
147 MVPbkContactStore& aContactStore, |
|
148 TVPbkContactStoreEvent aStoreEvent ); |
|
149 |
|
150 private: // Implementation |
|
151 CNamesListUIExtensionPlugin(); |
|
152 void ConstructL(); |
|
153 void CmdOpenGroupL( MPbk2ContactUiControl& aUiControl ) const; |
|
154 void DimItem( CEikMenuPane* aMenuPane, TInt aCmd ); |
|
155 TBool IsTopContact( const MVPbkBaseContact* aContact ); |
|
156 MVPbkContactLink* MyCardLink() const; |
|
157 void InitLocalStoreObserverL(); |
|
158 void InitAdnStoreObserverL(); |
|
159 |
|
160 private: // Data |
|
161 MCCAConnection* iCCAConnection; // own |
|
162 CPbk2NamesListExView* iNamesListExViewRef; //ref |
|
163 //OWN: |
|
164 CSpbContentProvider* iContentProvider; |
|
165 // number of contacts in local store |
|
166 TInt iLocalStoreContactsCount; |
|
167 // Not own: |
|
168 MVPbkContactStore* iLocalStore; |
|
169 MVPbkContactStore* iAdnStore; |
|
170 // Own |
|
171 CPbk2ApplicationServices* iAppServices; |
|
172 }; |
|
173 |
|
174 #endif // NAMESLISTUIEXTENTIONPLUGIN_H |
|
175 |
|
176 // End of File |