2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
20 #ifndef AKNPOPUPHEADINGPANE_H
21 #define AKNPOPUPHEADINGPANE_H
24 #include <AknControl.h>
34 // FORWARD DECLARATIONS
35 class CAknTextControl;
37 class CAknBitmapAnimation;
38 class CAknPopupHeadingAttributes;
39 class CAknPopupHeadingPaneExtension;
40 class MAknHeadingPaneTouchObserver;
45 * Header control for queries.
46 * Defines properties of the header of the pop-up menu.
48 * @since Series 60 0.9
50 class CAknPopupHeadingPane : public CAknControl
54 * Enumeration for different layouts
56 enum THeadingPaneLayout
58 /** Query mode layout for heading pane */
60 /** List mode layout for heading pane */
62 /** Heading pane for colour selection list. @since 3.0 */
63 EColourSelectionGridHeadingPane,
64 /** Heading pane for message query. @since 3.0 */
65 EMessageQueryHeadingPane
73 IMPORT_C CAknPopupHeadingPane();
78 IMPORT_C ~CAknPopupHeadingPane();
81 * From @c CCoeControl.
82 * Responds to size changes to sets the size and position of the
83 * contents of the heading pane.
85 IMPORT_C void SizeChanged();
88 * From @c CCoeControl.
89 * Get the minimum required size of heading pane.
90 * @return The minimum required size of heading pane.
92 IMPORT_C TSize MinimumSize();
95 * Completes the construction of the @c CAknPopupHeadingPane object.
96 * Layout is set to @c EQueryHeadingPane by default.
97 * @param aText Header text.
99 IMPORT_C void ConstructL(TPtrC aText);
102 * From @c CCoeControl.
103 * Constructs heading pane from a resource file.
104 * Current resource reader position must point to @c AVKON_HEADING
106 * @param aReader The resource reader with which to access the header
109 IMPORT_C void ConstructFromResourceL(TResourceReader &aReader);
112 * Get pointer to the prompt control.
113 * @return A pointer to the prompt control.
115 IMPORT_C CEikLabel *Prompt() const;
119 * @return A prompt text.
121 IMPORT_C TPtr PromptText() const;
125 * @param aText A header text.
127 IMPORT_C void SetTextL(TPtrC aText);
131 * Set header image. Gets the ownership of the image.
132 * @param aImage A header image.
134 IMPORT_C void SetHeaderImageOwnedL(CEikImage *aImage);
138 * @param aImage A header image.
140 IMPORT_C void SetHeaderImageL(CEikImage *aImage);
143 * Set header animation by reading @c BMPANIM_DATA resource.
144 * @param aResourceId A resource identifier for the header animation.
146 IMPORT_C void SetHeaderAnimationL(TInt aResourceId);
149 * Set layout of the heading pane.
150 * @param aLayout A layout of the heading pane.
152 IMPORT_C void SetLayout( THeadingPaneLayout aLayout );
155 * Start the animation.
157 IMPORT_C void StartAnimationL();
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.
165 IMPORT_C TInt CancelAnimation();
169 * From @c CCoeControl.
170 * Activates popup heading. Calls @c CCoeControl::ActivateL().
172 virtual void ActivateL();
173 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
176 * Handles a change to the control's resources of type aType
177 * which are shared across the environment, e.g. colors or fonts.
181 IMPORT_C void HandleResourceChange(TInt aType);
187 IMPORT_C void* ExtensionInterface( TUid aInterface );
190 TInt CountComponentControls() const;
191 CCoeControl* ComponentControl(TInt anIndex) const;
192 IMPORT_C virtual void Draw(const TRect& aRect) const;
195 void LayoutQueryHeadingPane();
196 void LayoutListHeadingPane();
197 void LayoutColourSelectionGridHeadingPane();
198 void LayoutMessageQueryHeadingPane();
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;
210 private: // new methods
211 void SetAnimationBackGroundFrameL();
213 public: // new methods
214 void SetPageL(TInt aCurrent, TInt aMax=0);
217 * Set heading frame ids. These can be used to override default ids.
218 * @param aFrameId / aFrameCenterId Ids of heading's frame..
220 IMPORT_C void SetSkinFrameId(const TAknsItemID &aFrameId);
221 IMPORT_C void SetSkinFrameCenterId(const TAknsItemID &aFrameCenterId);
224 * Set the heading pane touch observer. The observer must derive from MAknHeadingPaneTouchObserver
225 * and implement method HandleHeadingPanePointerEventL().
227 void SetTouchObserver( MAknHeadingPaneTouchObserver* aTouchObserver );
231 HBufC* PageTextL() const;