epoc32/include/mw/aknpopupfield.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
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
*     Represents a combo box type control, used to implement the Series 60 
williamr@2
    16
*     pop-up field.
williamr@2
    17
*     
williamr@2
    18
*
williamr@2
    19
*/
williamr@2
    20
williamr@2
    21
williamr@2
    22
#ifndef AKNPOPUPFIELD_H
williamr@2
    23
#define AKNPOPUPFIELD_H
williamr@2
    24
williamr@2
    25
#include <eikcmobs.h>
williamr@2
    26
#include <eiklbx.h>
williamr@2
    27
#include <eikbctrl.h>
williamr@2
    28
#include <eikcmbut.h>
williamr@2
    29
#include <bamdesca.h>
williamr@2
    30
williamr@2
    31
#include <AknDesCArrayDecorator.h>
williamr@2
    32
#include <AknListBoxLayoutDecorator.h>
williamr@2
    33
#include <aknnotedialog.h>
williamr@2
    34
williamr@2
    35
class TResourceReader;
williamr@2
    36
class CEikLabel;
williamr@2
    37
class CEikCommandButton;
williamr@2
    38
class CAknFormGraphicStyleListBox;
williamr@2
    39
class MAknQueryValue;
williamr@2
    40
williamr@2
    41
class CAknPopupField;
williamr@2
    42
class CAknPopupFieldExtension;
williamr@2
    43
williamr@2
    44
/** 
williamr@2
    45
 * this interface should be implemented by classes that need to know
williamr@2
    46
 * about events occurring in the popup field control
williamr@2
    47
 */
williamr@2
    48
class MAknPopupFieldObserver
williamr@2
    49
	{
williamr@2
    50
public:
williamr@2
    51
	enum TAknPopupFieldEvent
williamr@2
    52
		{
williamr@2
    53
		EAknPopupFieldEventModeChange,
williamr@2
    54
		EAknPopupFieldEventValueChange
williamr@2
    55
		};
williamr@2
    56
public:
williamr@2
    57
    /**
williamr@2
    58
     * Handles events from the popup field control, such as changes between
williamr@2
    59
     * selection list mode and label mode.
williamr@2
    60
     *
williamr@2
    61
     * @param aPopupField pointer to the popup field control that generated
williamr@2
    62
     *        the event.
williamr@2
    63
     * @param aEventType the type of event.
williamr@2
    64
     * @param aHint for possible future use.
williamr@2
    65
     */
williamr@2
    66
    virtual void HandlePopupFieldEventL(CAknPopupField* aPopupField,
williamr@2
    67
                                        TAknPopupFieldEvent aEventType,
williamr@2
    68
                                        TInt aHint)=0;
williamr@2
    69
	};
williamr@2
    70
williamr@2
    71
/**
williamr@2
    72
 * Represents a combo box type control, used to implement the Series 60 
williamr@2
    73
 * pop-up field.
williamr@2
    74
 */
williamr@2
    75
class CAknPopupField :
williamr@2
    76
	public CEikBorderedControl, 
williamr@2
    77
	public MCoeControlObserver, 
williamr@2
    78
	public MEikCommandObserver, 
williamr@2
    79
	public MEikListBoxObserver
williamr@2
    80
	{
williamr@2
    81
protected:
williamr@2
    82
	/**
williamr@2
    83
	 * Specialises bitmap button to make the layout correct for popup field
williamr@2
    84
	 */
williamr@2
    85
	class CAknPopupFieldBitmapButton : public CEikBitmapButton
williamr@2
    86
		{
williamr@2
    87
	public:
williamr@2
    88
		/**
williamr@2
    89
		 * Constructor
williamr@2
    90
		 */
williamr@2
    91
		CAknPopupFieldBitmapButton();
williamr@2
    92
		};
williamr@2
    93
public:
williamr@2
    94
    /**
williamr@2
    95
     * Selection mode of the popup field.
williamr@2
    96
     */
williamr@2
    97
    enum EAknPopupFieldSelectionMode
williamr@2
    98
        {
williamr@2
    99
        /** 
williamr@2
   100
         * Label mode. In Label mode popup field is minimized and popup field
williamr@2
   101
         * looks identical to a list item. When it receives the selection key 
williamr@2
   102
         * press it is changed to @c EAknPopupFieldSelectionListMode and the 
williamr@2
   103
         * pre-defined list is displayed. 
williamr@2
   104
         */
williamr@2
   105
        EAknPopupFieldLabelMode,
williamr@2
   106
		
williamr@2
   107
        /** 
williamr@2
   108
         * Selection list mode. In this selection mode pre-defined popup 
williamr@2
   109
         * selection list is displayed.
williamr@2
   110
         */    
williamr@2
   111
		EAknPopupFieldSelectionListMode
williamr@2
   112
		};
williamr@2
   113
williamr@2
   114
    /**
williamr@2
   115
     * Form mode for the popup field.
williamr@2
   116
     */
williamr@2
   117
	enum EAknFormMode
williamr@2
   118
        {
williamr@2
   119
        /** View mode. */
williamr@2
   120
        EAknFormModeView,
williamr@2
   121
williamr@2
   122
        /** Editable mode. */    
williamr@2
   123
        EAknFormModeEdit,
williamr@2
   124
williamr@2
   125
        /** View mode with graphic. */
williamr@2
   126
        EAknFormModeViewWideWithGraphic,
williamr@2
   127
williamr@2
   128
        /** View mode without graphic. */
williamr@2
   129
        EAknFormModeViewWideWithoutGraphic,
williamr@2
   130
williamr@2
   131
        /** Edit mode with graphic. */
williamr@2
   132
        EAknFormModeEditWideWithGraphic,
williamr@2
   133
williamr@2
   134
        /** Edit mode without graphic. */
williamr@2
   135
		EAknFormModeEditWideWithoutGraphic
williamr@2
   136
		};
williamr@2
   137
public: 
williamr@2
   138
	EAknPopupFieldSelectionMode SelectionMode() const { return iSelectionMode; }
williamr@2
   139
	EAknFormMode FormMode() const { return iFormMode; }
williamr@2
   140
    /**
williamr@2
   141
     * C++ default constructor.
williamr@2
   142
     */
williamr@2
   143
	IMPORT_C CAknPopupField();
williamr@2
   144
williamr@2
   145
	/**
williamr@2
   146
	 * Destructor
williamr@2
   147
	 */
williamr@2
   148
	IMPORT_C ~CAknPopupField();
williamr@2
   149
williamr@2
   150
    /** 
williamr@2
   151
     * Handles 2nd phase construction.
williamr@2
   152
     */
williamr@2
   153
	IMPORT_C void ConstructL();
williamr@2
   154
williamr@2
   155
    /**
williamr@2
   156
     * Sets a flag that enables user defined entry. Note that flag can also be 
williamr@2
   157
     * set from resources, but this method allows behaviour to be changed at 
williamr@2
   158
     * runtime.
williamr@2
   159
     *
williamr@2
   160
     * @param aAllows if @c ETrue sets a flag.
williamr@2
   161
     */
williamr@2
   162
	IMPORT_C void SetAllowsUserDefinedEntry(TBool aAllows);
williamr@2
   163
williamr@2
   164
    /**
williamr@2
   165
     * Causes a list of pre-defined values to appear. 
williamr@2
   166
     * Use this method to activate the pop-up field from a menu option command.
williamr@2
   167
     * Note that the desired control must be focused on before it can be 
williamr@2
   168
     * activated.
williamr@2
   169
     */
williamr@2
   170
	IMPORT_C void ActivateSelectionListL();
williamr@2
   171
williamr@2
   172
    /**
williamr@2
   173
     * Used by the client to set the query value. It is used to represent the 
williamr@2
   174
     * user defined query value in this popup field control.
williamr@2
   175
     *
williamr@2
   176
     * @param aValue Pointer to query value, ownership is not passed.
williamr@2
   177
     */
williamr@2
   178
	IMPORT_C void SetQueryValueL(MAknQueryValue* aValue);
williamr@2
   179
williamr@2
   180
    /**
williamr@2
   181
     * Sets the font of the contained label.
williamr@2
   182
     *
williamr@2
   183
     * @param aFont Font definition used to set the font of the contained 
williamr@2
   184
     *        label.
williamr@2
   185
     */
williamr@2
   186
	IMPORT_C void SetFont(const CFont* aFont);
williamr@2
   187
williamr@2
   188
    /**
williamr@2
   189
     * Sets a flag that determines whether the indicators are shown.
williamr@2
   190
     * In practice the indicators have the appearance of radio buttons.
williamr@2
   191
     *
williamr@2
   192
     * @param aShowIndicators If @c ETrue, indicators are displayed.
williamr@2
   193
     */
williamr@2
   194
	IMPORT_C void SetShowIndicatorsL(TBool aShowIndicators);
williamr@2
   195
williamr@2
   196
    /**
williamr@2
   197
     * Number of lines used.
williamr@2
   198
     *
williamr@2
   199
     * @return Number of entries on the selection list. If selection list 
williamr@2
   200
     *         is not active, 1 is returned.
williamr@2
   201
     *	       NOTE that the number is limited by @c KAknMaxEditorLines.
williamr@2
   202
     */
williamr@2
   203
	IMPORT_C TInt NumLines() const;
williamr@2
   204
williamr@2
   205
    /**
williamr@2
   206
     * Sets an observer of this class to receive events from popup field.
williamr@2
   207
     * 
williamr@2
   208
     * @param aObserver Pointer to the class that implements the observer 
williamr@2
   209
     *        interface.
williamr@2
   210
     */
williamr@2
   211
	IMPORT_C void SetPopupFieldObserver(MAknPopupFieldObserver* aObserver);
williamr@2
   212
williamr@2
   213
    /**
williamr@2
   214
     * Sets the note to be displayed when the selection list has no items 
williamr@2
   215
     * available.
williamr@2
   216
     * 
williamr@2
   217
     * @param aResourceId Resource id for the note.
williamr@2
   218
     * @param aTimeout = CAknNoteDialog::EShortTimeout Timeout for the note. 
williamr@2
   219
     * @param aTone = CAknNoteDialog::ENoTone Tone for the note.
williamr@2
   220
     */
williamr@2
   221
	IMPORT_C void SetEmptyListNoteL(TInt aResourceId,
williamr@2
   222
									CAknNoteDialog::TTimeout aTimeout = CAknNoteDialog::EShortTimeout,
williamr@2
   223
									CAknNoteDialog::TTone aTone = CAknNoteDialog::ENoTone);
williamr@2
   224
williamr@2
   225
    /**
williamr@2
   226
     * Sets the empty list note text. This note is displayed when the 
williamr@2
   227
     * selection list has no items available.
williamr@2
   228
     * 
williamr@2
   229
     * @param aEmptyText The empty list note text.
williamr@2
   230
     */
williamr@2
   231
    IMPORT_C void SetEmptyTextL(const TDesC& aEmptyText);
williamr@2
   232
williamr@2
   233
    /**
williamr@2
   234
     * Sets the text to be added to the bottom of the array to enter user 
williamr@2
   235
     * defined data.
williamr@2
   236
     * 
williamr@2
   237
     * @param aOtherText Text to the bottom of the selection array.
williamr@2
   238
     */
williamr@2
   239
	IMPORT_C void SetOtherTextL(const TDesC& aOtherText);
williamr@2
   240
williamr@2
   241
    /**
williamr@2
   242
     * Sets the text for view state when none of the elements in the
williamr@2
   243
     * list are available. 
williamr@2
   244
     *
williamr@2
   245
     * @param aInvalidText The invalid text.
williamr@2
   246
     */
williamr@2
   247
	IMPORT_C void SetInvalidTextL(const TDesC &aInvalidText);
williamr@2
   248
williamr@4
   249
    /**
williamr@4
   250
     * Closes the selection list 
williamr@4
   251
     *
williamr@4
   252
     *  @since v5.2 
williamr@4
   253
     */
williamr@4
   254
    IMPORT_C void CloseSelectionListL();
williamr@2
   255
williamr@2
   256
public: // from CCoeControl
williamr@2
   257
williamr@2
   258
    /** 
williamr@2
   259
     * From @c CCoeControl.
williamr@2
   260
     *
williamr@2
   261
     * Handles key events.
williamr@2
   262
     *
williamr@2
   263
     * @param aKeyEvent The key event. 
williamr@2
   264
     * @param aType The type of key event.
williamr@2
   265
     * @return Indicates whether or not the key event was used by this control.
williamr@2
   266
     */
williamr@2
   267
	IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
williamr@2
   268
williamr@2
   269
    /** 
williamr@2
   270
     * From @c CCoeControl.
williamr@2
   271
     * 
williamr@2
   272
     * Constructs the control from a resource file.
williamr@2
   273
     *
williamr@2
   274
     * @param aReader The resource reader pointing to the popup field resource.
williamr@2
   275
     */
williamr@2
   276
	IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
williamr@2
   277
williamr@2
   278
    /** 
williamr@2
   279
     * From @c CCoeControl.
williamr@2
   280
     *
williamr@2
   281
     * Determines the minimum size of the control.
williamr@2
   282
     * 
williamr@2
   283
     * @return The minimum size required by the control.
williamr@2
   284
     */
williamr@2
   285
	IMPORT_C TSize MinimumSize();
williamr@2
   286
williamr@2
   287
    /**
williamr@2
   288
     * From @c CCoeControl.
williamr@2
   289
     *
williamr@2
   290
     * Handles a change to the control's resources.
williamr@2
   291
     *
williamr@2
   292
     * @param aType The type of the resource change. 
williamr@2
   293
	 */
williamr@2
   294
	IMPORT_C void HandleResourceChange(TInt aType);
williamr@2
   295
williamr@2
   296
    /**
williamr@2
   297
     * From @c CCoeControl.
williamr@2
   298
     *
williamr@2
   299
     * Handles pointer events of popup field list.
williamr@2
   300
     *
williamr@2
   301
     * @param aPointerEvent The pointer event to be handled.
williamr@2
   302
     */
williamr@2
   303
    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
williamr@2
   304
public:
williamr@2
   305
	/**
williamr@2
   306
    /**
williamr@2
   307
     * Sets the maximium number of lines that can be displayed.
williamr@2
   308
     *
williamr@2
   309
     * @param aMaxNoLines The maximum number of lines.
williamr@2
   310
     */
williamr@2
   311
	IMPORT_C void SetMaxNumberOfLinesPermitted(TInt aMaxNoLines);
williamr@2
   312
public:
williamr@2
   313
williamr@2
   314
    /**
williamr@2
   315
     * Sets a form field rectangle so that a popup field can correctly position
williamr@2
   316
     * the label.
williamr@2
   317
     *
williamr@2
   318
     * @param aFormFieldRect The form field rectangle.
williamr@2
   319
     */
williamr@2
   320
	IMPORT_C void SetFormFieldRect(TRect aFormFieldRect);
williamr@2
   321
williamr@2
   322
protected: // from MCoeControlObserver
williamr@2
   323
	
williamr@2
   324
    /** 
williamr@2
   325
     * From @c MCoeControlObserver.
williamr@2
   326
     *
williamr@2
   327
     * Handles an event from an observed control.
williamr@2
   328
     *
williamr@2
   329
     * @param aControl The control that sent the event.
williamr@2
   330
     * @param aEvent The event type. 
williamr@2
   331
     */
williamr@2
   332
	IMPORT_C void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEvent);
williamr@2
   333
protected: // from MEikCommandObserver
williamr@2
   334
	
williamr@2
   335
    /**
williamr@2
   336
     * From @c MEikCommandObserver.
williamr@2
   337
     *
williamr@2
   338
     * Processes events from the softkeys. Responds to @c EAknSoftkeyOk and 
williamr@2
   339
     * @c EAknSoftkeyCancel to accept or cancel the pop-up.
williamr@2
   340
     * 
williamr@2
   341
     * @param aCommandId Event Id from the soft-key.
williamr@2
   342
     */
williamr@2
   343
	IMPORT_C void ProcessCommandL(TInt aCommandId);	
williamr@2
   344
protected: // From MEikListBoxObserver
williamr@2
   345
williamr@2
   346
    /**
williamr@2
   347
     * From @c MEikListBoxObserver.
williamr@2
   348
     *
williamr@2
   349
     * Processes key events from the listbox. Responds to 
williamr@2
   350
     * @c EEventEnterKeyPressed to accept the pop-up.
williamr@2
   351
     * 
williamr@2
   352
     * @param aListBox Listbox being observed.
williamr@2
   353
     * @param aEventType Event observed.
williamr@2
   354
     */
williamr@2
   355
    IMPORT_C void HandleListBoxEventL(CEikListBox* aListBox, 
williamr@2
   356
                                      TListBoxEvent aEventType);
williamr@2
   357
protected: // from CCoeControl
williamr@2
   358
williamr@2
   359
    /** 
williamr@2
   360
     * From @c CCoeControl.
williamr@2
   361
     *
williamr@2
   362
     * Gets the number of controls contained in a compound control.
williamr@2
   363
     *
williamr@2
   364
     * @return The number of component controls contained by this control.
williamr@2
   365
     */
williamr@2
   366
	IMPORT_C TInt CountComponentControls() const;
williamr@2
   367
williamr@2
   368
    /** 
williamr@2
   369
     * From @c CCoeControl.
williamr@2
   370
     *
williamr@2
   371
     * Gets an indexed component of a compound control.
williamr@2
   372
     * 
williamr@2
   373
     * @param aIndex Control index.
williamr@2
   374
     * @return The component control with an index of @c aIndex. 
williamr@2
   375
     */
williamr@2
   376
	IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
williamr@2
   377
williamr@2
   378
    /** 
williamr@2
   379
     * From @c CCoeControl.
williamr@2
   380
     *
williamr@2
   381
     * Responds to changes to the size and position of the contents of this 
williamr@2
   382
     * control.
williamr@2
   383
     */
williamr@2
   384
	IMPORT_C void SizeChanged();
williamr@2
   385
williamr@2
   386
    /**
williamr@2
   387
     * From @c CCoeControl.
williamr@2
   388
     *
williamr@2
   389
     * Responds to a change in focus.
williamr@2
   390
     *
williamr@2
   391
     * @param aDrawNow Contains the value that was passed to it by 
williamr@2
   392
     *        @c SetFocus(). 
williamr@2
   393
     */
williamr@2
   394
    IMPORT_C void FocusChanged( TDrawNow aDrawNow );
williamr@2
   395
williamr@2
   396
    /**
williamr@2
   397
     * From @c CEikBorderedControl.
williamr@2
   398
     *
williamr@2
   399
     * Called by the framework to draw the control.
williamr@2
   400
     *
williamr@2
   401
     * @param aRect Rectangle in which the Cone framework believes drawing is 
williamr@2
   402
     *        needed.
williamr@2
   403
     */
williamr@2
   404
	IMPORT_C void Draw(const TRect& aRect) const;
williamr@2
   405
williamr@2
   406
private: // from CCoeControl
williamr@2
   407
	IMPORT_C void Reserved_1();
williamr@2
   408
	IMPORT_C void Reserved_2();
williamr@2
   409
williamr@2
   410
private:
williamr@2
   411
    /**
williamr@2
   412
    * From CAknControl
williamr@2
   413
    */
williamr@2
   414
    IMPORT_C void* ExtensionInterface( TUid aInterface );
williamr@2
   415
williamr@2
   416
protected: // personal
williamr@2
   417
williamr@2
   418
    /**
williamr@2
   419
     * Construction tasks common to both a normal construction and a construction 
williamr@2
   420
     * from a resource. Used from @c ConstructL() and 
williamr@2
   421
     * @c ConstructFromResourceL().
williamr@2
   422
     */
williamr@2
   423
	void CommonConstructL();
williamr@2
   424
protected: // from MObjectProvider
williamr@2
   425
williamr@2
   426
    /**
williamr@2
   427
     * From @c CCoeControl.
williamr@2
   428
     *
williamr@2
   429
     * Retrieves an object of the same type as that encapsulated in @c aId.
williamr@2
   430
     *
williamr@2
   431
     * @param aId An encapsulated object type ID.
williamr@2
   432
     * @return Encapsulates the pointer to the object provided. 
williamr@2
   433
     *         Note that the encapsulated pointer may be NULL.
williamr@2
   434
     */
williamr@2
   435
	IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
williamr@2
   436
private: // personal
williamr@2
   437
williamr@2
   438
    /** 
williamr@2
   439
     * Create the label that will show the currently selected value.
williamr@2
   440
     *
williamr@2
   441
     */
williamr@2
   442
	void ConstructLabelL();
williamr@2
   443
williamr@2
   444
	/** 
williamr@2
   445
	 * Create the command button that will be used to show the other choices indicator.
williamr@2
   446
	 *
williamr@2
   447
	 */
williamr@2
   448
	void ConstructCommandButtonL();
williamr@2
   449
williamr@2
   450
	/** 
williamr@2
   451
	 * Create the selection list box that will fill the expanded popup field
williamr@2
   452
	 *
williamr@2
   453
	 */
williamr@2
   454
	void ConstructSelectionListL();
williamr@2
   455
williamr@2
   456
	/** 
williamr@2
   457
	 * setup the scroll bar within the selection list box
williamr@2
   458
	 *
williamr@2
   459
	 */
williamr@2
   460
	void SetUpScrollBarL();
williamr@2
   461
williamr@2
   462
	/** 
williamr@2
   463
	 * set the scroll bar selection
williamr@2
   464
	 *
williamr@2
   465
	 */
williamr@2
   466
	void SetScrollBarSelectionL();
williamr@2
   467
williamr@2
   468
	/** 
williamr@2
   469
	 * Set up the bitmap array for the "not pushed" and "pushed in" states
williamr@2
   470
	 *
williamr@2
   471
	 */
williamr@2
   472
	void InitialiseRadioButtonBitmapsL();
williamr@2
   473
williamr@2
   474
	/**
williamr@2
   475
	 * Handles the case where the selection list is closed. If necessary, 
williamr@2
   476
	 * update the value of the text label that is displayed.
williamr@2
   477
	 * 
williamr@2
   478
	 * @return TBool ETrue always
williamr@2
   479
	 */
williamr@2
   480
	TBool HandleInteractionConfirmedL();
williamr@2
   481
williamr@2
   482
	/**
williamr@2
   483
	 * Create the popup list. Warn the user if there are no entries in the list.
williamr@2
   484
	 *
williamr@2
   485
	 */
williamr@2
   486
	void CreatePopoutL();
williamr@2
   487
williamr@2
   488
	/**
williamr@2
   489
	 * Destroy the popup list and remove it from the stack
williamr@2
   490
	 *
williamr@2
   491
	 */
williamr@2
   492
	void DestroyPopout();
williamr@2
   493
williamr@2
   494
	/**
williamr@2
   495
	 * Checks to see if the popupfield is empty
williamr@2
   496
	 *
williamr@2
   497
	 */
williamr@2
   498
	TBool IsEmpty() const;
williamr@2
   499
	/**
williamr@2
   500
	 * Checks to see if the popupfield is invalid
williamr@2
   501
	 *
williamr@2
   502
	 */
williamr@2
   503
	TBool IsInvalid() const;
williamr@2
   504
	/**
williamr@2
   505
	 * Handles a horizontal key event
williamr@2
   506
	 *
williamr@2
   507
	 * @return TKeyResponse returns either EKeyWasConsumed
williamr@2
   508
	 *                       or EKeyWasNotConsumed
williamr@2
   509
	 */
williamr@2
   510
	TKeyResponse HandleHorizontalKeyEventL(TUint aKeyEventCode);
williamr@2
   511
private: // Avkon
williamr@2
   512
williamr@2
   513
    /**
williamr@2
   514
     * Creates the CBA for use when the selection list is active
williamr@2
   515
     */
williamr@2
   516
	void CreateCbaL();
williamr@2
   517
williamr@2
   518
	/**
williamr@2
   519
	 * Configures the decoration according to the currently set flags.
williamr@2
   520
	 * Should be called whenever the flags are changed. 
williamr@2
   521
	 *
williamr@2
   522
	 */
williamr@2
   523
	void ConfigureDecorator();
williamr@2
   524
williamr@2
   525
	/**
williamr@2
   526
	 * Configures the layout decoration according to the radio button flag
williamr@2
   527
	 * Should be called whenever the flags are changed. 
williamr@2
   528
	 *
williamr@2
   529
	 */
williamr@2
   530
	void ConstructLayoutDecoratorL();
williamr@2
   531
williamr@2
   532
	/**
williamr@2
   533
	 * display a note when the selection list has no items available
williamr@2
   534
	 *
williamr@2
   535
	 */
williamr@2
   536
	void ShowEmptyListNoteL();
williamr@2
   537
williamr@2
   538
	/**
williamr@2
   539
	 * Re-defined method of the base class. Gets called when the 
williamr@2
   540
	 * user tries to select a value. If required, an editor is created to 
williamr@2
   541
	 * allow the user to input the user defined value. Otherwise, the
williamr@2
   542
	 * normal selection behaviour of popup list is activated.
williamr@2
   543
	 *
williamr@2
   544
	 * @param aAccept	If ETrue, popup list was accepted; 
williamr@2
   545
	 *								if EFalse, popup list was cancelled
williamr@2
   546
	 *
williamr@2
   547
	 */
williamr@2
   548
	void AttemptExitL(TBool aAccept);
williamr@2
   549
williamr@2
   550
	/**
williamr@2
   551
	 * Changes the mode of the popupfield to one of
williamr@2
   552
	 * the EAknPopupFieldSelectionMode's
williamr@2
   553
	 */
williamr@2
   554
	void ChangeMode(EAknPopupFieldSelectionMode aNewMode);
williamr@2
   555
williamr@2
   556
private: // async 
williamr@2
   557
	static TInt AttemptExitCallbackL(TAny* aThis);
williamr@2
   558
	void DoAttemptExitL();
williamr@2
   559
	void DoSizeChangedL();
williamr@2
   560
protected:
williamr@2
   561
	// the following members are owned
williamr@2
   562
    /**
williamr@2
   563
     * Label of the popup field.
williamr@2
   564
     * Own.
williamr@2
   565
     */
williamr@2
   566
	CEikLabel* iLabel;
williamr@2
   567
williamr@2
   568
    /**
williamr@2
   569
     * Bitmap button for the popup field.
williamr@2
   570
     * Own.
williamr@2
   571
     */
williamr@2
   572
	CAknPopupFieldBitmapButton* iButton;
williamr@2
   573
williamr@2
   574
    /**
williamr@2
   575
     * List box for the popup field usage.
williamr@2
   576
     * Own.
williamr@2
   577
     */
williamr@2
   578
	CAknFormGraphicStyleListBox* iSelectionList;
williamr@2
   579
williamr@2
   580
    /**
williamr@2
   581
     * Contains a popup field selection array and a leading text that will be 
williamr@2
   582
     * inserted before the text from the descriptor array entry.
williamr@2
   583
     * Own.
williamr@2
   584
     */
williamr@2
   585
	CAknListBoxLayoutDecorator* iLayoutDecorator;
williamr@2
   586
williamr@2
   587
    /**
williamr@2
   588
     * Button group container for the popup field.
williamr@2
   589
     * Own.
williamr@2
   590
     */
williamr@2
   591
	CEikButtonGroupContainer* iCba;
williamr@2
   592
williamr@2
   593
    /**
williamr@2
   594
     * Active object for calling @c AttemptExitCallbackL asynchronously.
williamr@2
   595
     * Own.
williamr@2
   596
     */
williamr@2
   597
	CAsyncCallBack* iAttemptExitAsync;
williamr@2
   598
williamr@2
   599
	// the following fields are reflected in the POPUP_FIELD resource structure
williamr@2
   600
    /**
williamr@2
   601
     * Flags for the popup field.
williamr@2
   602
     */
williamr@2
   603
    TInt iFlags;
williamr@2
   604
williamr@2
   605
    /**
williamr@2
   606
     * Maximum line width.
williamr@2
   607
     */
williamr@2
   608
    TInt iWidth;
williamr@2
   609
williamr@2
   610
    /**
williamr@2
   611
     * Text to the bottom of the selection array.
williamr@2
   612
     * Own.
williamr@2
   613
     */
williamr@2
   614
    HBufC* iOtherText;
williamr@2
   615
williamr@2
   616
    /**
williamr@2
   617
     * The empty list note text.
williamr@2
   618
     * Own.
williamr@2
   619
     */
williamr@2
   620
    HBufC* iEmptyText;
williamr@2
   621
williamr@2
   622
    /**
williamr@2
   623
     * The invalid text. Used in the view state when none of the elements in the
williamr@2
   624
     * list are available. 
williamr@2
   625
     * Own.
williamr@2
   626
     */
williamr@2
   627
    HBufC* iInvalidText;
williamr@2
   628
williamr@2
   629
    /**
williamr@2
   630
     * Resource id for the empty note.
williamr@2
   631
     */
williamr@2
   632
	TInt iEmptyNoteResourceId;
williamr@2
   633
	
williamr@2
   634
	// the following members are not owned
williamr@2
   635
    /**
williamr@2
   636
     * Query value for the popup field.
williamr@2
   637
     * Not own.
williamr@2
   638
     */
williamr@2
   639
	MAknQueryValue* iValue;
williamr@2
   640
williamr@2
   641
    /**
williamr@2
   642
     * Observer for receiving events from the popup field.
williamr@2
   643
     * Not own.
williamr@2
   644
     */
williamr@2
   645
	MAknPopupFieldObserver* iObserver;
williamr@2
   646
williamr@2
   647
	// the following values are member variables
williamr@2
   648
    /**
williamr@2
   649
     * Enumeration representing form mode values.
williamr@2
   650
     */
williamr@2
   651
    EAknFormMode iFormMode;
williamr@2
   652
williamr@2
   653
    /**
williamr@2
   654
     * Timeout for the empty tone.
williamr@2
   655
     */
williamr@2
   656
    CAknNoteDialog::TTimeout iEmptyNoteTimeout;
williamr@2
   657
williamr@2
   658
    /**
williamr@2
   659
     * Tone for the empty note.
williamr@2
   660
     */
williamr@2
   661
    CAknNoteDialog::TTone iEmptyNoteTone;
williamr@2
   662
williamr@2
   663
    /**
williamr@2
   664
     * Selection array for the popup field.
williamr@2
   665
     */
williamr@2
   666
    TAknDesCArrayDecorator iDecorator;
williamr@2
   667
williamr@2
   668
    /**
williamr@2
   669
     * Enumeration representing selection mode values.
williamr@2
   670
     */
williamr@2
   671
    EAknPopupFieldSelectionMode iSelectionMode; 
williamr@2
   672
williamr@2
   673
    /**
williamr@2
   674
     * Maximum number of items in selection array.
williamr@2
   675
     */
williamr@2
   676
	TInt iMaxNoLines;
williamr@2
   677
	// NOTE: use Extension() to extend this class.
williamr@2
   678
private:
williamr@2
   679
	CAknPopupFieldExtension* iExtension;
williamr@2
   680
    TInt iSpare[3];
williamr@2
   681
	};
williamr@2
   682
williamr@2
   683
#endif // AKNPOPUPFIELD_H