|
1 /* |
|
2 * Copyright (c) 2002-2004,2008 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: CenRepListener listens to given Central Repository setting id and notifies its |
|
15 * observer if there is any change. Observer is given as a parameter on |
|
16 * initialising the listener. Observer must implement MhspsCenRepObserver-interface. |
|
17 * CenRepListener is asynchronous object that deploys a client-side handle |
|
18 * on Central Repository Server. CenRepListener is intended to be used by any object |
|
19 * that wants listen Central Repository changes. |
|
20 * |
|
21 * |
|
22 */ |
|
23 |
|
24 #ifndef HSPSFAMILYLISTENER_H_ |
|
25 #define HSPSFAMILYLISTENER_H_ |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <w32std.h> |
|
29 |
|
30 #include "hspsthememanagement.h" |
|
31 |
|
32 |
|
33 /** |
|
34 * @ingroup group_hspsserver |
|
35 * HandleFamilyChangeL. |
|
36 * Handles notifications related to resolution/orientation changes. |
|
37 * Clients are requested to reload UIs with a resolution specific widget set. |
|
38 * Executable on emulator environment only! |
|
39 * @lib hspsThemeServer.exe |
|
40 * @since S60 5.0 |
|
41 * @param aNewFamily An id for retrieving the new application configuration |
|
42 * @return True if the event was handled properly |
|
43 */ |
|
44 class MhspsFamilyObserver |
|
45 { |
|
46 public: |
|
47 virtual TBool HandleFamilyChangeL( const ThspsFamily aNewFamily ) = 0; |
|
48 }; |
|
49 |
|
50 /** |
|
51 * @ingroup group_hspsserver |
|
52 * ChspsFamilyListener is used to listen to the changes in UI's resolution and orientation. |
|
53 * Used on emulator environment only. |
|
54 * |
|
55 * @lib hspsThemeServer.exe |
|
56 * @since S60 5.0 |
|
57 */ |
|
58 class ChspsFamilyListener : public CActive |
|
59 { |
|
60 public: // Constructors and destructor |
|
61 |
|
62 /** |
|
63 * NewL |
|
64 * Two-phased constructor. |
|
65 */ |
|
66 static ChspsFamilyListener* NewL( |
|
67 MhspsFamilyObserver& aObserver ); |
|
68 |
|
69 /** |
|
70 * ~ChspsFamilyListener |
|
71 * Destructor. |
|
72 */ |
|
73 virtual ~ChspsFamilyListener(); |
|
74 |
|
75 /** |
|
76 * Retrieves family type from a string |
|
77 * @since S60 5.0 |
|
78 */ |
|
79 static ThspsFamily GetFamilyType( |
|
80 const TDesC8& aFamilyString ); |
|
81 |
|
82 /** |
|
83 * Retrieves family type from the current resolution. |
|
84 * @since S60 5.0 |
|
85 * @return Family id |
|
86 */ |
|
87 ThspsFamily GetFamilyType(); |
|
88 |
|
89 protected: // Functions from base classes |
|
90 |
|
91 /** |
|
92 * From CActive Called when asynchronous request has completed |
|
93 * RunL |
|
94 * @since S60 5.0 |
|
95 */ |
|
96 void RunL(); |
|
97 |
|
98 /** |
|
99 * DoCancel |
|
100 * From CActive Called when asynchronous request was cancelled |
|
101 * @since S60 5.0 |
|
102 */ |
|
103 void DoCancel(); |
|
104 |
|
105 /** |
|
106 * RunError |
|
107 * Handles a leave occurring in the request completion event handler RunL(). |
|
108 * @since S60 5.0 |
|
109 */ |
|
110 TInt RunError(TInt aError); |
|
111 |
|
112 private: |
|
113 |
|
114 /** |
|
115 * ConstructL |
|
116 * By default Symbian 2nd phase constructor is private. |
|
117 */ |
|
118 void ConstructL(); |
|
119 |
|
120 /** |
|
121 * ChspsCenRepListener |
|
122 * C++ default constructor. |
|
123 */ |
|
124 ChspsFamilyListener( |
|
125 MhspsFamilyObserver& aObserver ); |
|
126 |
|
127 /** |
|
128 * Start listener. |
|
129 */ |
|
130 void Queue(); |
|
131 |
|
132 /** |
|
133 * Retrieves used display code. |
|
134 */ |
|
135 void GetFamilyString( |
|
136 TDes8& aFamily ); |
|
137 |
|
138 private: // Data |
|
139 |
|
140 // Observer which is called when RunL occurs |
|
141 MhspsFamilyObserver& iObserver; |
|
142 |
|
143 // Window server session. |
|
144 RWsSession iWsSession; |
|
145 |
|
146 // Client-side handle to a server-side window group. |
|
147 RWindowGroup iWindowGroup; |
|
148 |
|
149 CWsScreenDevice* iScreenDevice; |
|
150 |
|
151 TUint32 iActiveFamily; |
|
152 |
|
153 TBool iFeatureManagerLoaded; |
|
154 |
|
155 }; |
|
156 |
|
157 #endif /* HSPSFAMILYLISTENER_H_ */ |
|
158 |
|
159 // End of File |