|
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 plugin for data sync |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef AIWSYNCPROVIDER_H |
|
20 #define AIWSYNCPROVIDER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <AiwServiceIfMenu.h> |
|
24 #include "AspSyncUtilApi.h" |
|
25 |
|
26 |
|
27 // CONSTANTS |
|
28 const TInt KBufSize = 128; |
|
29 const TInt KSyncApplicationId = 0; |
|
30 |
|
31 |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 |
|
36 /** |
|
37 * CAspSyncProvider |
|
38 * |
|
39 * CAspSyncProvider 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 CAspSyncProvider : public CAiwServiceIfMenu |
|
46 { |
|
47 public: |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 */ |
|
51 static CAspSyncProvider* NewL(); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CAspSyncProvider(); |
|
57 |
|
58 public: |
|
59 /** |
|
60 * From the base class. |
|
61 * Not implemented. |
|
62 */ |
|
63 virtual void InitialiseL(MAiwNotifyCallback& aFrameworkCallback, |
|
64 const RCriteriaArray& aInterest); |
|
65 |
|
66 /** |
|
67 * From the base class. |
|
68 * Not implemented. |
|
69 */ |
|
70 virtual void HandleServiceCmdL(const TInt& aCmdId, |
|
71 const CAiwGenericParamList& aInParamList, |
|
72 CAiwGenericParamList& aOutParamList, |
|
73 TUint aCmdOptions = 0, |
|
74 const MAiwNotifyCallback* aCallback = NULL); |
|
75 |
|
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 virtual void InitializeMenuPaneL(CAiwMenuPane& aMenuPane, |
|
86 TInt aIndex, |
|
87 TInt aCascadeId, |
|
88 const CAiwGenericParamList& aInParamList); |
|
89 |
|
90 /** |
|
91 * Handle 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, it not. |
|
99 */ |
|
100 virtual 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 * C++ default constructor. |
|
109 */ |
|
110 CAspSyncProvider(); |
|
111 |
|
112 /** |
|
113 * By default Symbian OS constructor is private. |
|
114 */ |
|
115 void ConstructL(); |
|
116 |
|
117 |
|
118 private: |
|
119 /** |
|
120 * Gets service command id from AIW parameter list. |
|
121 * @param aInParamList AIW parameter list. |
|
122 * @return Service command id. |
|
123 */ |
|
124 TInt GetServiceCommandId(const CAiwGenericParamList& aInParamList); |
|
125 |
|
126 /** |
|
127 * Gets calling application id from AIW parameter list. |
|
128 * @param aInParamList AIW parameter list. |
|
129 * @return Application id. |
|
130 */ |
|
131 TInt GetApplicationId(const CAiwGenericParamList& aInParamList); |
|
132 |
|
133 /** |
|
134 * Gets sync file name from AIW parameter list. |
|
135 * @param aInParamList AIW parameter list. |
|
136 * @param aText File name. |
|
137 * @return None. |
|
138 */ |
|
139 void GetFileName(const CAiwGenericParamList& aInParamList, TDes& aText); |
|
140 |
|
141 private: |
|
142 /** |
|
143 * Displays information note. |
|
144 * @param aText Information note text. |
|
145 * @return None. |
|
146 */ |
|
147 void ShowInformationNoteL(const TDesC& aText); |
|
148 |
|
149 /** |
|
150 * Gets this plugin resource file name. |
|
151 * @param aText Resource file name. |
|
152 * @return None. |
|
153 */ |
|
154 void GetResFileName(TDes& aText); |
|
155 |
|
156 /** |
|
157 * Copies strings. |
|
158 * @param aTarget. |
|
159 * @param aSource. |
|
160 * @return None. |
|
161 */ |
|
162 void StrCopy(TDes& aTarget, const TDesC& aSource); |
|
163 |
|
164 private: |
|
165 |
|
166 // CSyncUtilApi handles synchronize operations. |
|
167 CSyncUtilApi* iSyncUtilApi; |
|
168 }; |
|
169 |
|
170 #endif // AIWSYNCPROVIDER_H |
|
171 |
|
172 // End of file |
|
173 |