|
1 /* |
|
2 * Copyright (c) 2005 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: AIW provider for pbkinfoview. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef AIWPBKINFOVIEWPROVIDER_H |
|
20 #define AIWPBKINFOVIEWPROVIDER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <AiwServiceIfMenu.h> |
|
24 |
|
25 // CONSTANTS |
|
26 const TInt KBufSize = 128; |
|
27 const TInt KSyncApplicationId = 0; |
|
28 |
|
29 const TInt KAiwCmdSindInfoView = 0x10281C83; |
|
30 |
|
31 |
|
32 // CLASS DECLARATION |
|
33 class CPbkInfoViewApi; |
|
34 class MVPbkContactStoreListObserver; |
|
35 |
|
36 /** |
|
37 * CAiwPbkInfoViewProvider |
|
38 * |
|
39 * CAiwPbkInfoViewProvider implements CAiwServiceIfMenu interface to |
|
40 * allow synchronize functionality to be called via AIW. |
|
41 * |
|
42 * @lib syncservice.lib |
|
43 * @since Series 60 3.0 |
|
44 */ |
|
45 class CAiwPbkInfoViewProvider : public CAiwServiceIfMenu, |
|
46 public MVPbkContactStoreListObserver |
|
47 { |
|
48 public: |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 */ |
|
52 static CAiwPbkInfoViewProvider* NewL(); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 ~CAiwPbkInfoViewProvider(); |
|
58 |
|
59 public: |
|
60 /** |
|
61 * From the CAiwServiceIfMenu. |
|
62 * Not implemented. |
|
63 */ |
|
64 void InitialiseL(MAiwNotifyCallback& aFrameworkCallback, |
|
65 const RCriteriaArray& aInterest); |
|
66 |
|
67 /** |
|
68 * From the base class. |
|
69 * Not implemented. |
|
70 */ |
|
71 void HandleServiceCmdL(const TInt& aCmdId, |
|
72 const CAiwGenericParamList& aInParamList, |
|
73 CAiwGenericParamList& aOutParamList, |
|
74 TUint aCmdOptions = 0, |
|
75 const MAiwNotifyCallback* aCallback = NULL); |
|
76 |
|
77 /** |
|
78 * Initialises menu pane by adding provider specific menu items. |
|
79 * The AIW Framework gives the parameters to be used in addition. |
|
80 * @param aMenuPane Menu pane handle |
|
81 * @param aIndex position of item where to add menu items. |
|
82 * @param aCascadeId ID of cascade menu item. |
|
83 * @param aInParamList input parameter list for provider's parameters checking |
|
84 */ |
|
85 void InitializeMenuPaneL(CAiwMenuPane& aMenuPane, |
|
86 TInt aIndex, |
|
87 TInt aCascadeId, |
|
88 const CAiwGenericParamList& aInParamList); |
|
89 |
|
90 /** |
|
91 * Handles a menu command invoked by the Handler. |
|
92 * @param aMenuCmdId Command ID for the menu command, |
|
93 * defined by the provider when adding the menu commands. |
|
94 * @param aInParamList Input parameters, could be empty list |
|
95 * @param aOutParamList Output parameters, could be empty list |
|
96 * @param aCmdOptions Options for the command, see KAiwCmdOpt* constants. |
|
97 * @param aCallback callback if asynchronous command handling is wanted by consumer. |
|
98 * The provider may or may not support this, leaves with KErrNotSupported if not. |
|
99 */ |
|
100 void HandleMenuCmdL(TInt aMenuCmdId, |
|
101 const CAiwGenericParamList& aInParamList, |
|
102 CAiwGenericParamList& aOutParamList, |
|
103 TUint aCmdOptions = 0, |
|
104 const MAiwNotifyCallback* aCallback = NULL); |
|
105 |
|
106 private: |
|
107 /* |
|
108 * From MVPbkContactStoreListObserver |
|
109 */ |
|
110 void StoreReady( MVPbkContactStore& aContactStore ); |
|
111 void StoreUnavailable( MVPbkContactStore& aContactStore, |
|
112 TInt aReason ); |
|
113 void HandleStoreEventL( MVPbkContactStore& aContactStore, |
|
114 TVPbkContactStoreEvent aStoreEvent ); |
|
115 void OpenComplete(); |
|
116 |
|
117 private: |
|
118 /** |
|
119 * C++ default constructor. |
|
120 */ |
|
121 CAiwPbkInfoViewProvider(); |
|
122 |
|
123 /** |
|
124 * By default Symbian OS constructor is private. |
|
125 */ |
|
126 void ConstructL(); |
|
127 |
|
128 private: |
|
129 /** |
|
130 * Gets service command id from AIW parameter list. |
|
131 * @param aInParamList AIW parameter list. |
|
132 * @return TInt Service command id. |
|
133 */ |
|
134 TInt GetServiceCommandId( const CAiwGenericParamList& aInParamList ); |
|
135 |
|
136 /** |
|
137 * Gets the contact id from AIW parameter list. |
|
138 * @param aInParamList AIW parameter list. |
|
139 * @return TInt id. |
|
140 */ |
|
141 TInt GetContactIdL( const CAiwGenericParamList& aInParamList ); |
|
142 /** |
|
143 * Gets this plugin resource file name. |
|
144 * @param aText Resource file name. |
|
145 * @return None. |
|
146 */ |
|
147 void GetResFileName( TDes& aText ); |
|
148 |
|
149 /** |
|
150 * Copies strings. |
|
151 * @param aTarget Copied text will be put to this variable. |
|
152 * @param aSource Includes the text to be copied. |
|
153 * @return None. |
|
154 */ |
|
155 void StrCopy( TDes& aTarget, const TDesC& aSource ); |
|
156 |
|
157 private: |
|
158 CPbkInfoViewApi* iInfoViewApi; |
|
159 // Scheduler wait object |
|
160 CActiveSchedulerWait* iWait; |
|
161 // Error code received from observer call-back methods. |
|
162 TInt iErr; |
|
163 }; |
|
164 |
|
165 #endif // AIWPBKINFOVIEWPROVIDER_H |
|
166 |
|
167 // End of file |