|
1 /* |
|
2 * Copyright (c) 2008 - 2010 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: Phone UI Dialer View |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CPHONEDIALERVIEW_H |
|
19 #define __CPHONEDIALERVIEW_H |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include <coecntrl.h> |
|
24 #include <coeview.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CAknsLayeredBackgroundControlContext; |
|
28 class TPhoneCommandParam; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * View for dialer control |
|
34 */ |
|
35 class CPhoneDialerView : public CCoeControl, public MCoeView |
|
36 { |
|
37 public: // Constructors and destructor |
|
38 |
|
39 static CPhoneDialerView *NewL( TRect aRect ); |
|
40 |
|
41 virtual ~CPhoneDialerView(); |
|
42 |
|
43 public: // Functions from base classes |
|
44 |
|
45 /** |
|
46 * Returns a TVwsViewId uniquely identifying the view. |
|
47 * @return Represents a view in the server |
|
48 */ |
|
49 TVwsViewId ViewId() const; |
|
50 |
|
51 void ActivateL(); |
|
52 |
|
53 /** |
|
54 * From CCoeControl; notifier for resource changes |
|
55 * @param aType : Type of resource change |
|
56 */ |
|
57 void HandleResourceChange( TInt aType ); |
|
58 |
|
59 /** |
|
60 * From CCoeControl |
|
61 * @param aVisible : ETrue if view is to be shown |
|
62 * EFalse if view is to be hidden |
|
63 */ |
|
64 void MakeVisible( TBool aVisible ); |
|
65 |
|
66 public: // New functions |
|
67 |
|
68 /** |
|
69 * Sets the control as component. |
|
70 * @param aControl It is the new component. |
|
71 */ |
|
72 void SetControl( CCoeControl* aControl ); |
|
73 |
|
74 /** |
|
75 * Returns the control in the view. |
|
76 * @return aControl The control. |
|
77 */ |
|
78 CCoeControl* Control() const; |
|
79 |
|
80 public: // Functions from base classes |
|
81 |
|
82 /** |
|
83 * From CCoeControl |
|
84 */ |
|
85 void SetRect( const TRect &aRect ); |
|
86 |
|
87 protected: // Functions from base classes |
|
88 |
|
89 /** |
|
90 * From CCoeControl |
|
91 */ |
|
92 void HandlePointerEventL( |
|
93 const TPointerEvent& aPointerEvent ); |
|
94 |
|
95 /** |
|
96 * From CCoeControl |
|
97 */ |
|
98 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
99 |
|
100 /** |
|
101 * From CCoeControl |
|
102 */ |
|
103 TInt CountComponentControls() const; |
|
104 |
|
105 /** |
|
106 * From CCoeControl |
|
107 */ |
|
108 void Draw( const TRect& aRect ) const; |
|
109 |
|
110 /** |
|
111 * From CCoeControl, informs that the size is changed to update |
|
112 * the sizes of component controls appropriately. |
|
113 */ |
|
114 void SizeChanged(); |
|
115 |
|
116 /** |
|
117 * From CCoeControl, informs that the position has been changed. |
|
118 */ |
|
119 void PositionChanged(); |
|
120 |
|
121 /** |
|
122 * From CCoeControl, MopSupplyObject |
|
123 */ |
|
124 TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
125 |
|
126 /** |
|
127 * From CCoeControl |
|
128 */ |
|
129 void FocusChanged( TDrawNow aDrawNow ); |
|
130 |
|
131 private: // Functions from base classes |
|
132 |
|
133 /** |
|
134 * Takes any action required on activation of the view. |
|
135 * Reimplemented versions should read the message text |
|
136 * @param aCustomMessage message for any message type |
|
137 * identified by aCustomMessageId |
|
138 * @param aCustomMessageId message ID that the view understands |
|
139 * @param aPrevViewId The id of the previously active view |
|
140 * so that the view may switch back to its caller |
|
141 * at some later stage |
|
142 */ |
|
143 void ViewActivatedL( |
|
144 const TVwsViewId& aPrevViewId, |
|
145 TUid aCustomMessageId, |
|
146 const TDesC8& aCustomMessage ); |
|
147 |
|
148 /** |
|
149 * Takes any action required on deactivation of the view e.g. to |
|
150 * make the controls owned by the view non-visible |
|
151 * (thereby saving the window server uneccessary work). |
|
152 */ |
|
153 void ViewDeactivated(); |
|
154 |
|
155 private: |
|
156 |
|
157 CPhoneDialerView(); |
|
158 |
|
159 void ConstructL( TRect aRect ); |
|
160 |
|
161 private: |
|
162 |
|
163 /** |
|
164 * Updates size of the control. |
|
165 */ |
|
166 void UpdateControlRect(); |
|
167 |
|
168 private: |
|
169 |
|
170 // Region type. |
|
171 typedef RRegionBuf< KPhoneRegionAmount > RPhoneRegionBuf; |
|
172 |
|
173 // Control rectangle |
|
174 TRect iControlRect; |
|
175 |
|
176 // Owned: region |
|
177 RPhoneRegionBuf iRegion; |
|
178 |
|
179 // Pointer to active control. |
|
180 CCoeControl* iControl; |
|
181 |
|
182 // Owned: background context. |
|
183 CAknsLayeredBackgroundControlContext* iBgContext; |
|
184 |
|
185 // Top left coordinate. |
|
186 TPoint iTopLeftCoord; |
|
187 |
|
188 // Owned: Status area use status. |
|
189 TBool iStatusAreaUsed; |
|
190 |
|
191 //Id of the fullscreen AI plugin |
|
192 TInt iFsAiId; |
|
193 |
|
194 //MainPane |
|
195 TRect iMainPane; |
|
196 |
|
197 }; |
|
198 |
|
199 #endif // __CPHONEDIALERVIEW_H |
|
200 |