|
1 /* |
|
2 * Copyright (c) 2002-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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef INC_AIFWTESTCONTROLLER_H |
|
20 #define INC_AIFWTESTCONTROLLER_H |
|
21 |
|
22 // ========== INCLUDE FILES =================================================== |
|
23 |
|
24 #include <f32file.h> |
|
25 #include "aicontentobserver.h" |
|
26 #include "aipropertyextension.h" |
|
27 #include "AiUiController.h" |
|
28 #include <e32base.h> |
|
29 #include <e32std.h> |
|
30 #include <coemain.h> |
|
31 |
|
32 // ========== CONSTANTS ======================================================= |
|
33 |
|
34 // ========== MACROS ========================================================== |
|
35 |
|
36 // ========== DATA TYPES ====================================================== |
|
37 |
|
38 // ========== FUNCTION PROTOTYPES ============================================= |
|
39 |
|
40 // ========== FORWARD DECLARATIONS ============================================ |
|
41 |
|
42 class MAiContentItemIterator; |
|
43 class TAiPublisherInfo; |
|
44 |
|
45 // ========== CLASS DECLARATION =============================================== |
|
46 |
|
47 /** |
|
48 * ?one_line_short_description. |
|
49 * ?other_description_lines |
|
50 * |
|
51 * @lib ?library |
|
52 * @since Series 60 3.1 |
|
53 */ |
|
54 namespace AiTestUiController |
|
55 { |
|
56 class CAiFwTestControllerPlugin : public CAiUiController, |
|
57 public MAiContentObserver, |
|
58 public MAiMainUiController |
|
59 /*public MAiSecondaryUiController*/ |
|
60 { |
|
61 public: // Constructors and destructor |
|
62 |
|
63 static CAiFwTestControllerPlugin* NewL(); |
|
64 |
|
65 IMPORT_C static CAiFwTestControllerPlugin* Instance(); |
|
66 |
|
67 ~CAiFwTestControllerPlugin(); |
|
68 |
|
69 private: // Constructors |
|
70 |
|
71 CAiFwTestControllerPlugin(); |
|
72 |
|
73 void ConstructL(); |
|
74 |
|
75 public: // Functions from MAiContentObserver |
|
76 |
|
77 TInt StartTransaction( TInt aTxId ); |
|
78 |
|
79 TInt Commit( TInt aTxId ); |
|
80 |
|
81 TInt CancelTransaction( TInt aTxId ); |
|
82 |
|
83 TBool CanPublish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); |
|
84 |
|
85 TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); |
|
86 |
|
87 TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, const TDesC16& aBuf, TInt aIndex ); |
|
88 |
|
89 TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); |
|
90 |
|
91 TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); |
|
92 |
|
93 TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); |
|
94 |
|
95 TAny* Extension( TUid aUid ); |
|
96 |
|
97 TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const; |
|
98 |
|
99 public: // Functions from base class CAiUiController |
|
100 |
|
101 virtual void LoadUIDefinitionL(); |
|
102 |
|
103 virtual void GetSettingsL(const TAiPublisherInfo& aPubInfo, RAiSettingsItemArray& aSettings); |
|
104 |
|
105 virtual void GetPluginsL( RAiPublisherInfoArray& aPlugins ); |
|
106 |
|
107 virtual void ActivateUI(); |
|
108 |
|
109 virtual void SetEventHandler(MAiFwEventHandler& aEventHandler); |
|
110 |
|
111 virtual MAiContentObserver& GetContentObserver(); |
|
112 |
|
113 virtual MAiMainUiController* MainInterface() |
|
114 { |
|
115 return this; |
|
116 }; |
|
117 |
|
118 virtual MAiSecondaryUiController* SecondaryInterface() |
|
119 { |
|
120 return NULL; |
|
121 }; |
|
122 |
|
123 virtual void HandleLoadedPlugins( const RAiPublisherInfoArray& aPlugins ); |
|
124 |
|
125 virtual void RunApplicationL(); |
|
126 |
|
127 virtual CCoeEnv& CoeEnv() |
|
128 { |
|
129 return *CCoeEnv::Static(); |
|
130 }; |
|
131 |
|
132 virtual void Exit() |
|
133 { |
|
134 }; |
|
135 |
|
136 virtual TBool IsMenuOpen() |
|
137 { |
|
138 return ETrue; |
|
139 }; |
|
140 |
|
141 virtual void SetUiFrameworkObserver( MAiUiFrameworkObserver& aObserver ) |
|
142 { |
|
143 iFwObserver = &aObserver; |
|
144 }; |
|
145 |
|
146 virtual void RemovePluginFromUI( MAiPropertyExtension& aPlugin ) |
|
147 { |
|
148 } |
|
149 |
|
150 public: // Test functions |
|
151 |
|
152 IMPORT_C TBool UiActivated(); |
|
153 |
|
154 IMPORT_C TBool RunApplicationCalled(); |
|
155 |
|
156 IMPORT_C TBool DefinitionLoaded(); |
|
157 |
|
158 IMPORT_C void SendReadyEventL(); |
|
159 |
|
160 IMPORT_C void SendTestEventL(); |
|
161 |
|
162 IMPORT_C void SetResourceChangedL( TInt aRes ); |
|
163 |
|
164 IMPORT_C void SetForegroundL( TBool aFore ); |
|
165 |
|
166 IMPORT_C void SetAppEnvReadyL(); |
|
167 |
|
168 protected: // New functions |
|
169 |
|
170 void SetText(const TDesC8& aId, TPtrC8& aBuf); |
|
171 const TDesC* GetText(const TDesC8& aId); |
|
172 |
|
173 private: // Data |
|
174 |
|
175 TBool iUiActivated; |
|
176 TBool iRunApplicationCalled; |
|
177 TBool iDefinitionLoaded; |
|
178 |
|
179 MAiContentItemIterator* iContent; |
|
180 MAiContentItemIterator* iResources; |
|
181 MAiContentItemIterator* iEvents; |
|
182 MAiFwEventHandler* iFwEventHandler; |
|
183 |
|
184 MAiUiFrameworkObserver* iFwObserver; |
|
185 // Reserved pointer for future extension |
|
186 //TAny* iReserved; |
|
187 }; |
|
188 |
|
189 } // namespace AiTestUiController |
|
190 |
|
191 #endif |
|
192 |
|
193 // End of File. |