|
1 /* |
|
2 * Copyright (c) 2008-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: Header file for CIRBaseView |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CIRBASEVIEW_H |
|
20 #define C_CIRBASEVIEW_H |
|
21 |
|
22 #include <aknview.h> |
|
23 |
|
24 #include "irsystemeventobserver.h" |
|
25 |
|
26 |
|
27 const TInt KIRIconSubCellIndex = 3; |
|
28 const TInt KAlphanumericStart = 48; //Scan code of '0' key on keypad. |
|
29 const TInt KAlphanumericEnd = 59; //Scan code of 'w' key on keypad. |
|
30 const TInt KAphaUpperCaseStart = 65; |
|
31 const TInt KAphaUpperCaseEnd = 91; |
|
32 const TInt KAphaLowerCaseStart = 97; |
|
33 const TInt KAphaLowerCaseEnd = 122; |
|
34 const TInt KAknExListFindBoxTextLength = 10; |
|
35 |
|
36 const TInt KFont = 200; |
|
37 const TSize KBitmapSize = TSize(59, 59); |
|
38 |
|
39 class CIRIsdsWrapper; |
|
40 class CIRNowPlayingWrapper; |
|
41 class CIRUi; |
|
42 class CIRAddManuallyStationForm; |
|
43 class CIRDialogLauncher; |
|
44 /** |
|
45 * Base View |
|
46 * |
|
47 * Base View, which is used to hold common functionality across different views. |
|
48 * At the moment contains only some event handling and some view activation related functionality. |
|
49 */ |
|
50 class CIRBaseView :public CAknView, |
|
51 public MIRSystemEventObserver |
|
52 { |
|
53 public: |
|
54 |
|
55 /** |
|
56 * Available observers to be used in derived classes. |
|
57 */ |
|
58 enum TIRObservers |
|
59 { |
|
60 EIRNone = 0x00000000, |
|
61 EIRSystemEventObserver = 0x00000002 |
|
62 }; |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 */ |
|
67 ~CIRBaseView(); |
|
68 |
|
69 /** |
|
70 * Set the title of the current view. This is a utility method for more easy |
|
71 * title setting. SetTitleL has two overloaded methods: one for resource |
|
72 * based strings and one for descriptor based strings. |
|
73 * |
|
74 * @param aResourceid A resource id pointing to a text |
|
75 */ |
|
76 void SetTitleL( TInt aResourceId ); |
|
77 /** |
|
78 * @param aTitleText Descriptor which holds the title text |
|
79 */ |
|
80 void SetTitleL( const TDesC& aTitleText ); |
|
81 |
|
82 /** |
|
83 * Takes care of pushing and poping views for view backtracking |
|
84 */ |
|
85 void HandleViewStackL(TUid aCustomMessageId); |
|
86 |
|
87 // from base class CAknView |
|
88 void HandleCommandL( TInt aCommand ); |
|
89 void HandleForegroundEventL( TBool aForeground ); |
|
90 // from base class MEikMenuObserver |
|
91 |
|
92 |
|
93 /** |
|
94 * GetCurrentFocus |
|
95 * Returns Data for the current focus in the Listbox |
|
96 */ |
|
97 TInt GetCurrentFocus(); |
|
98 |
|
99 /** |
|
100 * GetCurrentTopItemInstance |
|
101 * Returns Data for the top item index in the Listbox |
|
102 */ |
|
103 |
|
104 TInt GetCurrentTopItem(); |
|
105 |
|
106 /** |
|
107 * SetCurrentFocus |
|
108 * Sets Data for the current focus in the Listbox |
|
109 */ |
|
110 void SetCurrentFocus(TInt aCurrentFocus); |
|
111 |
|
112 /** |
|
113 * SetCurrentTopItemInstance |
|
114 * Sets Data for the top item index in the Listbox |
|
115 */ |
|
116 void SetCurrentTopItem(TInt aTopItemIndex); |
|
117 |
|
118 //From the base class MIRSystemEventObserver |
|
119 void HandleSystemEventL(TIRSystemEventType aEventType); |
|
120 |
|
121 |
|
122 protected: |
|
123 |
|
124 /** |
|
125 * By default Symbian 2nd phase constructor is private. |
|
126 * |
|
127 * @param aResourceId A resource id for BaseContructL |
|
128 */ |
|
129 void ConstructL( TInt aResourceId ); |
|
130 |
|
131 /** |
|
132 * C++ default constructor. |
|
133 */ |
|
134 CIRBaseView(); |
|
135 |
|
136 /** |
|
137 * Enable event observing. |
|
138 * |
|
139 * @param aObservers List of observers to be enabled |
|
140 */ |
|
141 void EnableObserverL( TInt aObservers ); |
|
142 |
|
143 /** |
|
144 * Disable event observing. |
|
145 * |
|
146 * @param aObservers List of observers to be disabled |
|
147 */ |
|
148 void DisableObserver( TInt aObservers ); |
|
149 |
|
150 |
|
151 // from base class CAknView |
|
152 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
153 TUid aCustomMessageId, |
|
154 const TDesC8& aCustomMessage ); |
|
155 void DoDeactivate(); |
|
156 |
|
157 private: |
|
158 |
|
159 /** |
|
160 * Saves information about which observers are currently enabled/disabled. |
|
161 */ |
|
162 TInt iObserverEnabled; |
|
163 |
|
164 public: //data |
|
165 |
|
166 CIRUi* iUi; |
|
167 |
|
168 /** |
|
169 * iIsdsWrapper |
|
170 * instance of the IsdsWrapper class |
|
171 * To be used by all the views |
|
172 */ |
|
173 CIRIsdsWrapper *iIsdsWrapper; |
|
174 /** |
|
175 * iNowPlayingWrapper |
|
176 * instance of the CIRNowPlayingWrapper class |
|
177 * To be used by all the views |
|
178 */ |
|
179 CIRNowPlayingWrapper *iNowPlayingWrapper; |
|
180 |
|
181 /** |
|
182 * iCurrentFocus |
|
183 * Data for the current focus in the Listbox |
|
184 */ |
|
185 TInt iCurrentFocus; |
|
186 |
|
187 /** |
|
188 * iTopItemIndex |
|
189 * Data for the top item index in the Listbox |
|
190 */ |
|
191 TInt iTopItemIndex; |
|
192 }; |
|
193 |
|
194 #endif /* C_CIRBASEVIEW_H */ |