|
1 /* |
|
2 * Copyright (c) 2005-2006 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: The ECOM interface implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MUSAIWPROVIDER_H |
|
20 #define MUSAIWPROVIDER_H |
|
21 |
|
22 |
|
23 #include "musunittesting.h" |
|
24 #include "musmanagercommon.h" |
|
25 #include <AiwServiceIfMenu.h> |
|
26 #include <ecom/implementationproxy.h> |
|
27 |
|
28 // forward declarations |
|
29 |
|
30 class CEikonEnv; |
|
31 class CMusManager; |
|
32 class MAiwNotifyCallback; |
|
33 class RResourceFile; |
|
34 class CMusIndicatorApi; |
|
35 |
|
36 |
|
37 |
|
38 // function declarations |
|
39 |
|
40 IMPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ); |
|
41 |
|
42 /** |
|
43 * CMusAiwProvider |
|
44 */ |
|
45 class CMusAiwProvider : public CAiwServiceIfMenu |
|
46 { |
|
47 MUS_UNITTEST( UT_CMusAiwProvider ) |
|
48 public: // constructors and destructor |
|
49 |
|
50 static CMusAiwProvider* NewL(); |
|
51 |
|
52 virtual ~CMusAiwProvider(); |
|
53 |
|
54 private: // constructors |
|
55 |
|
56 CMusAiwProvider(); |
|
57 |
|
58 void ConstructL(); |
|
59 |
|
60 public: // from CAiwServiceIfBase |
|
61 |
|
62 /** |
|
63 * Called by the AIW framework to initialise the provider with |
|
64 * necessary information. |
|
65 * |
|
66 * @param aFrameworkCallback Framework-provided callback for the |
|
67 * provider to send events to the |
|
68 * framework. |
|
69 * @param aInterest List of criteria items which invoked |
|
70 * the provider. |
|
71 * @exception Symbian OS error code |
|
72 */ |
|
73 void InitialiseL( MAiwNotifyCallback& aFrameworkCallback, |
|
74 const RCriteriaArray& aInterest ); |
|
75 |
|
76 /** |
|
77 * Executes generic service commands included in criteria. |
|
78 * |
|
79 * @param aCmdId The command to be executed. |
|
80 * @param aInParamList Input parameters. Can be an empty list. |
|
81 * @param aOutParamList Output parameters. Can be an empty list. |
|
82 * @param aCmdOptions Options for the command. See |
|
83 * KAiwCmdOpt* constants. |
|
84 * @param aCallback Callback for asynchronous command |
|
85 * handling, parameter checking, etc. |
|
86 * @see enum TServiceCmdOptions in GENERICPARAM.HRH. |
|
87 * @exception KErrArgument if callback is missing when required. |
|
88 * @exception KErrNotSupported if no provider support service. |
|
89 */ |
|
90 void HandleServiceCmdL( const TInt& aCmdId, |
|
91 const CAiwGenericParamList& aInParamList, |
|
92 CAiwGenericParamList& aOutParamList, |
|
93 TUint aCmdOptions = 0, |
|
94 const MAiwNotifyCallback* aCallback = NULL ); |
|
95 |
|
96 public: // from CAiwServiceIfMenu |
|
97 |
|
98 /** |
|
99 * Initializes menu pane by adding provider-specific menu |
|
100 * items. The AIW Framework gives the parameters to be used |
|
101 * in addition. |
|
102 * |
|
103 * @param aMenuPane Menu pane handle. |
|
104 * @param aIndex Position of item where to add menu items. |
|
105 * @param aCascadeId ID of cascade menu item. |
|
106 * @param aInParamList The input parameter list for provider's |
|
107 * parameters checking. |
|
108 */ |
|
109 void InitializeMenuPaneL( CAiwMenuPane& aMenuPane, |
|
110 TInt aIndex, |
|
111 TInt aCascadeId, |
|
112 const CAiwGenericParamList& aInParamList ); |
|
113 |
|
114 /** |
|
115 * Handles a menu command invoked by the Handler. |
|
116 * |
|
117 * @param aMenuCmdId Command ID for the menu command, |
|
118 * defined by the provider when adding |
|
119 * the menu commands. |
|
120 * @param aInParamList Input parameters. Could be empty list. |
|
121 * @param aOutParamList Output parameters. Could be empty list. |
|
122 * @param aCmdOptions Options for the command. See |
|
123 * KAiwCmdOpt* constants. |
|
124 * @param aCallback Callback if asynchronous command |
|
125 * handling is wanted by consumer. The |
|
126 * provider might not support this. If not, |
|
127 * the function leaves with KErrNotSupported. |
|
128 */ |
|
129 void HandleMenuCmdL( TInt aMenuCmdId, |
|
130 const CAiwGenericParamList& aInParamList, |
|
131 CAiwGenericParamList& aOutParamList, |
|
132 TUint aCmdOptions = 0, |
|
133 const MAiwNotifyCallback* aCallback = NULL ); |
|
134 |
|
135 |
|
136 private: // helper functions |
|
137 |
|
138 TBool ApplicationRunningL(); |
|
139 |
|
140 void NoVariationStartUpL( TFileName& aFileName, |
|
141 CAiwMenuPane& aMenuPane, |
|
142 TInt aIndex ); |
|
143 |
|
144 void OperatorVariantStartUpL( TFileName& aFileName, |
|
145 CAiwMenuPane& aMenuPane, |
|
146 TInt aIndex ); |
|
147 |
|
148 void FastModeStartUpL( |
|
149 TFileName& aFileName, CAiwMenuPane& aMenuPane, TInt aIndex ); |
|
150 |
|
151 void ShowErrorNoteL( TInt aError ); |
|
152 |
|
153 HBufC* ErrorNoteTextLC( TInt aError ); |
|
154 |
|
155 HBufC8* ErrorNoteText8L( TInt aError, RResourceFile& aResourceFile ); |
|
156 |
|
157 void DoInitialiseL(); |
|
158 |
|
159 TBool AvailabilityOk( |
|
160 MultimediaSharing::TMusAvailabilityStatus aAvailability ) const; |
|
161 |
|
162 TBool HiddenFromFastSwapL(); |
|
163 |
|
164 TBool IsFastStartupModeL(); |
|
165 |
|
166 void StartApplicationL( |
|
167 CMusManager& aManager, MultimediaSharing::TMusUseCase aUseCase ); |
|
168 |
|
169 private: // data |
|
170 |
|
171 /** The AIW resource file name. */ |
|
172 HBufC* iResourceFileName; |
|
173 |
|
174 /** Current availability status. */ |
|
175 MultimediaSharing::TMusAvailabilityStatus iAvailability; |
|
176 |
|
177 /** To Differentiate Error and Warning Notes */ |
|
178 TBool iIsWarning ; |
|
179 |
|
180 CMusIndicatorApi* iIndicator; |
|
181 }; |
|
182 |
|
183 |
|
184 #endif // MUSAIWPROVIDER_H |