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: Handles interface towards XUIKON, sets and gets theme information. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_PSLNFWAPPTHEMEHANDLER_H |
|
20 #define C_PSLNFWAPPTHEMEHANDLER_H |
|
21 |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <XnThemeManagement.h> |
|
25 |
|
26 class CXnODT; |
|
27 class MPslnFWAppThemeObserver; |
|
28 class CPslnXNClientLoader; |
|
29 |
|
30 /** |
|
31 * Handles interface towards XUIKON, sets and gets theme information. |
|
32 * |
|
33 * @lib PslnFramework.lib |
|
34 * @since S60 v3.1 |
|
35 */ |
|
36 NONSHARABLE_CLASS( CPslnFWAppThemeHandler ) : |
|
37 public CBase, |
|
38 public MXnThemeManagementServiceObserver |
|
39 { |
|
40 |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 * @param aObserver observer for theme changes. |
|
46 * @param aApplicationSkinList plugin owned array, to be filled with |
|
47 * application specific themes. |
|
48 * @return new instance of CPslnFWAppThemeHandler. |
|
49 */ |
|
50 EXPORT_C static CPslnFWAppThemeHandler* NewL( |
|
51 MPslnFWAppThemeObserver& aObserver, |
|
52 CArrayPtrFlat<CXnODT>& aApplicationSkinList ); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 EXPORT_C virtual ~CPslnFWAppThemeHandler(); |
|
58 |
|
59 /** |
|
60 * Gets application specific themes. Framework starts automatically listen |
|
61 * for changes in application themes. These are given to the client using |
|
62 * MPslnFWAppThemeObserver interface. |
|
63 * |
|
64 * @param aUid UID of application whose themes are needed. |
|
65 * @return Xuikon specific error code for setting active skin. |
|
66 */ |
|
67 IMPORT_C TXnServiceCompletedMessage GetApplicationSkinsL( TUid aUid ); |
|
68 |
|
69 /** |
|
70 * Activates application specific theme. |
|
71 * @param aThemeODT ODT of theme to be active (includes theme UID). |
|
72 * @return Xuikon specific error code for setting active skin. |
|
73 */ |
|
74 IMPORT_C TXnServiceCompletedMessage SetApplicationSkinL( CXnODT& aThemeODT ); |
|
75 |
|
76 /** |
|
77 * Client informs that is not interested in anymore getting notifications |
|
78 * through MPslnFWAppThemeObserver. |
|
79 */ |
|
80 IMPORT_C void CancelGetApplicationSkins(); |
|
81 |
|
82 /** |
|
83 * Activates application specific theme and exits calling application. |
|
84 * |
|
85 * @since S60 V3.2 |
|
86 * |
|
87 * @param aThemeODT ODT of theme to be active (includes theme UID). |
|
88 * @return Xuikon specific error code for setting active skin. |
|
89 */ |
|
90 IMPORT_C TXnServiceCompletedMessage SetApplicationSkinAndExitL( |
|
91 CXnODT& aThemeODT ); |
|
92 |
|
93 private: |
|
94 |
|
95 /** |
|
96 * From MXnThemeManagementServiceObserver. |
|
97 * Handles theme management events. |
|
98 * @param aMessage contains a service completion message returned from |
|
99 * the XnInstallationHandler and XnMaintenanceHandler to their |
|
100 * observer. |
|
101 */ |
|
102 void HandleXnClientMessage( TXnServiceCompletedMessage aMessage ); |
|
103 |
|
104 /** |
|
105 * C++ default constructor. |
|
106 */ |
|
107 CPslnFWAppThemeHandler( |
|
108 MPslnFWAppThemeObserver& aObserver, |
|
109 CArrayPtrFlat<CXnODT>& aApplicationSkinList ); |
|
110 |
|
111 /** |
|
112 * By default Symbian 2nd phase constructor is private. |
|
113 */ |
|
114 void ConstructL(); |
|
115 |
|
116 /** |
|
117 * Creates and pushes new ODT to stack. |
|
118 * Created ODT is based on Application Uid. |
|
119 */ |
|
120 CXnODT* CreateODTFromAppUidLC( TUid aUid ); |
|
121 |
|
122 /** |
|
123 * Creates XUIKON client when needed. |
|
124 */ |
|
125 void CreateXnClientL(); |
|
126 |
|
127 private: // data |
|
128 |
|
129 /** |
|
130 * Observer for framework's application theme changes. |
|
131 */ |
|
132 MPslnFWAppThemeObserver& iObserver; |
|
133 |
|
134 /** |
|
135 * List of themes. Each theme is described within an ODT. |
|
136 * Now own. |
|
137 */ |
|
138 CArrayPtrFlat<CXnODT>* iAppThemeList; |
|
139 |
|
140 /** |
|
141 * ETrue if there is outstanding application skin retrieval ongoing. |
|
142 */ |
|
143 TBool iFetchOngoing; |
|
144 |
|
145 /* |
|
146 * Has the XUIKON client DLL already been loaded. |
|
147 */ |
|
148 TBool iXnClientDllLoaded; |
|
149 |
|
150 /* |
|
151 * A handle to a dynamically loadable DLL. |
|
152 */ |
|
153 RLibrary iXnClientDll; |
|
154 |
|
155 /* |
|
156 * Loads XUIKON Client library and acts as wrapper around the DLL. |
|
157 * Own. |
|
158 */ |
|
159 CPslnXNClientLoader* iXnClientLoader; |
|
160 |
|
161 }; |
|
162 |
|
163 #endif // C_PSLNFWAPPTHEMEHANDLER_H |
|
164 |
|
165 // End of File |
|