|
45
|
1 |
/*
|
|
|
2 |
* Copyright (c) 2002 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:
|
|
|
15 |
* Heading pane
|
|
|
16 |
*
|
|
|
17 |
*/
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
#ifndef AKNPOPUPHEADINGPANE_H
|
|
|
21 |
#define AKNPOPUPHEADINGPANE_H
|
|
|
22 |
|
|
|
23 |
// INCLUDES
|
|
|
24 |
#include <AknControl.h>
|
|
|
25 |
|
|
|
26 |
#include <eikbtgpc.h>
|
|
|
27 |
#include <AknUtils.h>
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
#include <aknappui.h>
|
|
|
31 |
#include <aknPopup.h>
|
|
|
32 |
#include <gulicon.h>
|
|
|
33 |
|
|
|
34 |
// FORWARD DECLARATIONS
|
|
|
35 |
class CAknTextControl;
|
|
|
36 |
class CEikImage;
|
|
|
37 |
class CAknBitmapAnimation;
|
|
|
38 |
class CAknPopupHeadingAttributes;
|
|
|
39 |
class CAknPopupHeadingPaneExtension;
|
|
|
40 |
class MAknHeadingPaneTouchObserver;
|
|
|
41 |
|
|
|
42 |
// CLASS DECLARATION
|
|
|
43 |
|
|
|
44 |
/**
|
|
|
45 |
* Header control for queries.
|
|
|
46 |
* Defines properties of the header of the pop-up menu.
|
|
|
47 |
*
|
|
|
48 |
* @since Series 60 0.9
|
|
|
49 |
*/
|
|
|
50 |
class CAknPopupHeadingPane : public CAknControl
|
|
|
51 |
{
|
|
|
52 |
public:
|
|
|
53 |
/**
|
|
|
54 |
* Enumeration for different layouts
|
|
|
55 |
*/
|
|
|
56 |
enum THeadingPaneLayout
|
|
|
57 |
{
|
|
|
58 |
/** Query mode layout for heading pane */
|
|
|
59 |
EQueryHeadingPane,
|
|
|
60 |
/** List mode layout for heading pane */
|
|
|
61 |
EListHeadingPane,
|
|
|
62 |
/** Heading pane for colour selection list. @since 3.0 */
|
|
|
63 |
EColourSelectionGridHeadingPane,
|
|
|
64 |
/** Heading pane for message query. @since 3.0 */
|
|
|
65 |
EMessageQueryHeadingPane
|
|
|
66 |
};
|
|
|
67 |
|
|
|
68 |
|
|
|
69 |
public:
|
|
|
70 |
/**
|
|
|
71 |
* Constructor.
|
|
|
72 |
*/
|
|
|
73 |
IMPORT_C CAknPopupHeadingPane();
|
|
|
74 |
|
|
|
75 |
/**
|
|
|
76 |
* Destructor.
|
|
|
77 |
*/
|
|
|
78 |
IMPORT_C ~CAknPopupHeadingPane();
|
|
|
79 |
|
|
|
80 |
/**
|
|
|
81 |
* From @c CCoeControl.
|
|
|
82 |
* Responds to size changes to sets the size and position of the
|
|
|
83 |
* contents of the heading pane.
|
|
|
84 |
*/
|
|
|
85 |
IMPORT_C void SizeChanged();
|
|
|
86 |
|
|
|
87 |
/**
|
|
|
88 |
* From @c CCoeControl.
|
|
|
89 |
* Get the minimum required size of heading pane.
|
|
|
90 |
* @return The minimum required size of heading pane.
|
|
|
91 |
*/
|
|
|
92 |
IMPORT_C TSize MinimumSize();
|
|
|
93 |
|
|
|
94 |
/**
|
|
|
95 |
* Completes the construction of the @c CAknPopupHeadingPane object.
|
|
|
96 |
* Layout is set to @c EQueryHeadingPane by default.
|
|
|
97 |
* @param aText Header text.
|
|
|
98 |
*/
|
|
|
99 |
IMPORT_C void ConstructL(TPtrC aText);
|
|
|
100 |
|
|
|
101 |
/**
|
|
|
102 |
* From @c CCoeControl.
|
|
|
103 |
* Constructs heading pane from a resource file.
|
|
|
104 |
* Current resource reader position must point to @c AVKON_HEADING
|
|
|
105 |
* resource.
|
|
|
106 |
* @param aReader The resource reader with which to access the header
|
|
|
107 |
* resource values.
|
|
|
108 |
*/
|
|
|
109 |
IMPORT_C void ConstructFromResourceL(TResourceReader &aReader);
|
|
|
110 |
|
|
|
111 |
/**
|
|
|
112 |
* Get pointer to the prompt control.
|
|
|
113 |
* @return A pointer to the prompt control.
|
|
|
114 |
*/
|
|
|
115 |
IMPORT_C CEikLabel *Prompt() const;
|
|
|
116 |
|
|
|
117 |
/**
|
|
|
118 |
* Get prompt text.
|
|
|
119 |
* @return A prompt text.
|
|
|
120 |
*/
|
|
|
121 |
IMPORT_C TPtr PromptText() const;
|
|
|
122 |
|
|
|
123 |
/**
|
|
|
124 |
* Set header text.
|
|
|
125 |
* @param aText A header text.
|
|
|
126 |
*/
|
|
|
127 |
IMPORT_C void SetTextL(TPtrC aText);
|
|
|
128 |
|
|
|
129 |
|
|
|
130 |
/**
|
|
|
131 |
* Set header image. Gets the ownership of the image.
|
|
|
132 |
* @param aImage A header image.
|
|
|
133 |
*/
|
|
|
134 |
IMPORT_C void SetHeaderImageOwnedL(CEikImage *aImage);
|
|
|
135 |
|
|
|
136 |
/**
|
|
|
137 |
* Set header image.
|
|
|
138 |
* @param aImage A header image.
|
|
|
139 |
*/
|
|
|
140 |
IMPORT_C void SetHeaderImageL(CEikImage *aImage);
|
|
|
141 |
|
|
|
142 |
/**
|
|
|
143 |
* Set header animation by reading @c BMPANIM_DATA resource.
|
|
|
144 |
* @param aResourceId A resource identifier for the header animation.
|
|
|
145 |
*/
|
|
|
146 |
IMPORT_C void SetHeaderAnimationL(TInt aResourceId);
|
|
|
147 |
|
|
|
148 |
/**
|
|
|
149 |
* Set layout of the heading pane.
|
|
|
150 |
* @param aLayout A layout of the heading pane.
|
|
|
151 |
*/
|
|
|
152 |
IMPORT_C void SetLayout( THeadingPaneLayout aLayout );
|
|
|
153 |
|
|
|
154 |
/**
|
|
|
155 |
* Start the animation.
|
|
|
156 |
*/
|
|
|
157 |
IMPORT_C void StartAnimationL();
|
|
|
158 |
|
|
|
159 |
/**
|
|
|
160 |
* Cancel the animation.
|
|
|
161 |
* Calls @c RBitmapAnim::CommandReply(EBitmapAnimCommandStopAnimation).
|
|
|
162 |
* @return A value defined by the animation writer. The value may,
|
|
|
163 |
* in some cases, be defined to be an error code.
|
|
|
164 |
*/
|
|
|
165 |
IMPORT_C TInt CancelAnimation();
|
|
|
166 |
|
|
|
167 |
public:
|
|
|
168 |
/**
|
|
|
169 |
* From @c CCoeControl.
|
|
|
170 |
* Activates popup heading. Calls @c CCoeControl::ActivateL().
|
|
|
171 |
*/
|
|
|
172 |
virtual void ActivateL();
|
|
|
173 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
|
|
174 |
|
|
|
175 |
/**
|
|
|
176 |
* Handles a change to the control's resources of type aType
|
|
|
177 |
* which are shared across the environment, e.g. colors or fonts.
|
|
|
178 |
*
|
|
|
179 |
* @since 3.1
|
|
|
180 |
*/
|
|
|
181 |
IMPORT_C void HandleResourceChange(TInt aType);
|
|
|
182 |
|
|
|
183 |
private:
|
|
|
184 |
/**
|
|
|
185 |
* From CAknControl
|
|
|
186 |
*/
|
|
|
187 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
|
|
188 |
|
|
|
189 |
private:
|
|
|
190 |
TInt CountComponentControls() const;
|
|
|
191 |
CCoeControl* ComponentControl(TInt anIndex) const;
|
|
|
192 |
IMPORT_C virtual void Draw(const TRect& aRect) const;
|
|
|
193 |
|
|
|
194 |
void DoSetPromptL();
|
|
|
195 |
void LayoutQueryHeadingPane();
|
|
|
196 |
void LayoutListHeadingPane();
|
|
|
197 |
void LayoutColourSelectionGridHeadingPane();
|
|
|
198 |
void LayoutMessageQueryHeadingPane();
|
|
|
199 |
|
|
|
200 |
private:
|
|
|
201 |
//TAknLayoutRect iLayoutLine; // Not used
|
|
|
202 |
CAknPopupHeadingPaneExtension* iExtension; // was TAknLayoutRect iLayoutLine
|
|
|
203 |
TAknLayoutRect iLayoutHeading;
|
|
|
204 |
CAknTextControl* iPrompt;
|
|
|
205 |
CEikImage* iHeaderImage;
|
|
|
206 |
CAknBitmapAnimation* iAnimation;
|
|
|
207 |
TInt iHeadingLayoutRef;
|
|
|
208 |
CAknPopupHeadingAttributes* iAttributes; // was THeadingPaneLayout iLayout;
|
|
|
209 |
|
|
|
210 |
private: // new methods
|
|
|
211 |
void SetAnimationBackGroundFrameL();
|
|
|
212 |
|
|
|
213 |
public: // new methods
|
|
|
214 |
void SetPageL(TInt aCurrent, TInt aMax=0);
|
|
|
215 |
|
|
|
216 |
/**
|
|
|
217 |
* Set heading frame ids. These can be used to override default ids.
|
|
|
218 |
* @param aFrameId / aFrameCenterId Ids of heading's frame..
|
|
|
219 |
*/
|
|
|
220 |
IMPORT_C void SetSkinFrameId(const TAknsItemID &aFrameId);
|
|
|
221 |
IMPORT_C void SetSkinFrameCenterId(const TAknsItemID &aFrameCenterId);
|
|
|
222 |
|
|
|
223 |
/**
|
|
|
224 |
* Set the heading pane touch observer. The observer must derive from MAknHeadingPaneTouchObserver
|
|
|
225 |
* and implement method HandleHeadingPanePointerEventL().
|
|
|
226 |
*/
|
|
|
227 |
void SetTouchObserver( MAknHeadingPaneTouchObserver* aTouchObserver );
|
|
|
228 |
|
|
|
229 |
|
|
|
230 |
private:
|
|
|
231 |
HBufC* PageTextL() const;
|
|
|
232 |
};
|
|
|
233 |
|
|
|
234 |
#endif
|
|
|
235 |
|