equal
deleted
inserted
replaced
20 |
20 |
21 #ifndef CXNWALLPAPERVIEW_H |
21 #ifndef CXNWALLPAPERVIEW_H |
22 #define CXNWALLPAPERVIEW_H |
22 #define CXNWALLPAPERVIEW_H |
23 |
23 |
24 // System includes |
24 // System includes |
|
25 #include <e32base.h> |
25 #include <aknview.h> |
26 #include <aknview.h> |
26 |
27 |
27 // User includes |
28 // User includes |
28 |
29 |
29 // Forward declarations |
30 // Forward declarations |
30 class CXnWallpaperContainer; |
31 class CXnWallpaperContainer; |
31 class CXnAppUiAdapter; |
32 class CXnAppUiAdapter; |
32 class CXnUiEngine; |
33 class CXnUiEngine; |
33 class TVwsViewId; |
|
34 class CPeriodic; |
|
35 class CXnSpBgCleaner; |
34 class CXnSpBgCleaner; |
36 class CAknWaitDialog; |
|
37 |
35 |
38 // Constants |
36 // Constants |
39 const TUid KWallpaperViewUid = { 0x200286DB }; |
37 const TUid KWallpaperViewUid = { 0x200286DB }; |
40 |
38 |
41 // CLASS DECLARATION |
39 // CLASS DECLARATION |
42 |
40 |
43 /** |
41 /** |
44 * Wallpaper view. |
42 * Wallpaper view. |
45 * Possible to define current Idle background image. |
43 * Possible to select background image. |
46 * |
44 * |
47 * @since S60 v5.0 |
45 * @since S60 v5.0 |
48 */ |
46 */ |
49 NONSHARABLE_CLASS( CXnWallpaperView ) : public CAknView |
47 NONSHARABLE_CLASS( CXnWallpaperView ) : public CAknView |
50 { |
48 { |
51 /** View states */ |
|
52 enum TViewState |
|
53 { |
|
54 EIdle, |
|
55 EImageSelection, |
|
56 EViewDeactivation |
|
57 }; |
|
58 public: |
49 public: |
|
50 // constructor and destructor |
59 |
51 |
60 /** |
52 /** |
61 * Two-phased constructor. |
53 * Two-phased constructor. |
62 * @return new instance of CXnWallpaperView. |
54 * @return new instance of CXnWallpaperView. |
63 */ |
55 */ |
66 /** |
58 /** |
67 * Destructor. |
59 * Destructor. |
68 */ |
60 */ |
69 ~CXnWallpaperView(); |
61 ~CXnWallpaperView(); |
70 |
62 |
|
63 public: |
|
64 // from CAknView |
|
65 |
71 /** |
66 /** |
72 * From CAknView. |
67 * @see CAknView |
73 * Returns view id. |
68 */ |
74 * @return An unsigned integer (view id). |
|
75 */ |
|
76 TUid Id() const; |
69 TUid Id() const; |
77 |
70 |
78 private: |
71 private: |
|
72 // from CAknView |
|
73 |
|
74 /** |
|
75 * @see CAknView |
|
76 */ |
|
77 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
78 TUid aCustomMessageId, const TDesC8& aCustomMessage ); |
|
79 |
|
80 /** |
|
81 * @see CAknView |
|
82 */ |
|
83 void DoDeactivate(); |
79 |
84 |
80 /* From CAknView. */ |
85 private: |
81 void DoActivateL( |
86 // private constructors |
82 const TVwsViewId& aPrevViewId, |
|
83 TUid aCustomMessageId, |
|
84 const TDesC8& aCustomMessage ); |
|
85 |
|
86 /* From CAknView. */ |
|
87 void DoDeactivate(); |
|
88 |
87 |
89 /** |
88 /** |
90 * C++ default constructor. |
89 * C++ default constructor. |
91 */ |
90 */ |
92 CXnWallpaperView( CXnUiEngine& aEngine ); |
91 CXnWallpaperView( CXnUiEngine& aEngine ); |
94 /** |
93 /** |
95 * By default Symbian 2nd phase constructor is private. |
94 * By default Symbian 2nd phase constructor is private. |
96 */ |
95 */ |
97 void ConstructL(); |
96 void ConstructL(); |
98 |
97 |
|
98 public: |
|
99 // new functions |
|
100 |
99 /** |
101 /** |
100 * Callback function to be used with CPeriodic. |
102 * Returns selected wallpaper filename as parameter |
|
103 * |
|
104 * @since S60 5.2 |
|
105 * @param aFileName Selected wallpaper filename |
101 */ |
106 */ |
102 static TInt TimerCallback( TAny *aPtr ); |
107 void SelectedWallpaper( TFileName& aFileName ) const; |
103 void DoHandleCallBackL(); |
|
104 |
|
105 /** |
|
106 * Show error dialog |
|
107 * |
|
108 * @param aResourceId Resource id to string to be displayed. |
|
109 */ |
|
110 static void ShowErrorDialogL( const TInt aResourceId ); |
|
111 |
108 |
112 private: // data |
109 private: |
|
110 // new functions |
|
111 |
|
112 static TInt HandleCallback( TAny* aAny ); |
|
113 |
|
114 void DoHandleCallbackL(); |
|
115 |
|
116 private: |
|
117 // data |
113 |
118 |
114 /** |
119 /** |
115 * Wallpaper container. |
120 * Wallpaper container. |
116 * Own. |
121 * Own. |
117 */ |
122 */ |
118 CXnWallpaperContainer* iContainer; |
123 CXnWallpaperContainer* iContainer; |
119 |
124 |
|
125 /** |
|
126 * Image files |
|
127 * Own. |
|
128 */ |
|
129 CDesCArrayFlat* iFiles; |
|
130 |
120 /** |
131 /** |
121 * UiEngine |
132 * UiEngine |
122 * Not owned. |
133 * Not owned. |
123 */ |
134 */ |
124 CXnUiEngine& iEngine; |
135 CXnUiEngine& iEngine; |
131 |
142 |
132 /** |
143 /** |
133 * Switch for multiple image selection. |
144 * Switch for multiple image selection. |
134 */ |
145 */ |
135 TBool iMultiple; |
146 TBool iMultiple; |
136 |
147 |
137 /** |
148 /** |
138 * Previous view id |
149 * Async callback. |
139 */ |
|
140 TVwsViewId iPreviousViewUid; |
|
141 |
|
142 /** |
|
143 * States of wallpaperview |
|
144 */ |
|
145 TViewState iViewState; |
|
146 |
|
147 /** |
|
148 * Periodic timer. |
|
149 * Own. |
150 * Own. |
150 */ |
151 */ |
151 CPeriodic* iTimer; |
152 CAsyncCallBack* iAsyncCb; |
152 |
153 |
153 /** |
154 /** |
154 * Resource file offset |
155 * Resource file offset |
155 */ |
156 */ |
156 TInt iResourceOffset; |
157 TInt iResourceOffset; |
157 |
158 |
158 /** |
159 /** |
159 * Statuspane background cleaner. |
160 * Statuspane background cleaner. |
160 * Own. |
161 * Own. |
161 */ |
162 */ |
162 CXnSpBgCleaner* iXnSpBgCleaner; |
163 CXnSpBgCleaner* iSpBgCleaner; |
163 |
164 |
164 /** |
165 /** |
165 * Wait dialog. |
166 * Selected image filename |
166 * Own. |
167 */ |
167 */ |
168 TFileName iFileName; |
168 CAknWaitDialog* iWaitDialog; |
|
169 }; |
169 }; |
170 |
170 |
171 #endif // CXNWALLPAPERVIEW_H |
171 #endif // CXNWALLPAPERVIEW_H |
172 |
172 |
173 // End of File |
173 // End of File |