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