00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AKNCHOICELIST_H
00021 #define AKNCHOICELIST_H
00022
00023
00024 #include <akncontrol.h>
00025 #include <coecobs.h>
00026
00027
00028 class CAknButton;
00029 class CEikLabel;
00030 class CAknChoiceListPopup;
00031 class CAknChoiceListPopupList;
00032 class CAknsFrameBackgroundControlContext;
00033 class CAknInfoPopupNoteController;
00034
00035
00036
00045 class CAknChoiceList : public CAknControl, public MCoeControlObserver
00046 {
00047 public:
00048
00049
00050 enum TAknChoiceListFlags
00051 {
00052
00053 EAknChoiceListWithCurrentSelection = 0x01,
00054
00055 EAknChoiceListWithoutCurrentSelection = 0x02,
00056
00057 EAknChoiceListPositionLeft = 0x04,
00058 EAknChoiceListPositionRight = 0x08,
00059 EAknChoiceListPositionBottom = 0x10
00060 };
00061
00062
00063 enum TTooltipPosition
00064 {
00065 EPositionTop = 1,
00066 EPositionBottom,
00067 EPositionLeft,
00068 EPositionRight
00069 };
00070 public:
00071
00083 IMPORT_C static CAknChoiceList* NewL( CCoeControl* aParent, CDesCArray* aItemArray, TInt aFlags = EAknChoiceListWithCurrentSelection, CAknButton* aButton = NULL );
00084
00096 IMPORT_C static CAknChoiceList* NewLC( CCoeControl* aParent, CDesCArray* aItemArray, TInt aFlags = EAknChoiceListWithCurrentSelection, CAknButton* aButton = NULL );
00097
00101 ~CAknChoiceList();
00102
00109 IMPORT_C TInt ShowChoiceListL();
00110
00115 IMPORT_C void SetSelectedIndex( const TInt aIndex );
00116
00121 IMPORT_C TInt SelectedIndex() const;
00122
00129 IMPORT_C void SetItems( CDesCArray* aArray );
00130
00136 IMPORT_C void SetItemsL( TInt aResourceId );
00137
00144 IMPORT_C TInt AddItemL( const TDesC* aDesC );
00145
00150 IMPORT_C void RemoveItem( const TInt aIndex );
00151
00157 IMPORT_C void SetFlags( const TInt aFlags );
00158
00163 IMPORT_C TInt Flags() const;
00164
00169 IMPORT_C void SetButtonL( CAknButton* aButton );
00170
00174 IMPORT_C void HideChoiceList();
00175
00180 IMPORT_C void SetTooltipTextL( const TDesC& aText );
00181
00189 IMPORT_C void SetTooltipTimeouts( const TInt aBeforeTimeout,
00190 const TInt aInViewTimeout );
00196 IMPORT_C void SetTooltipPosition( const TTooltipPosition aPosition );
00197
00198
00199
00205 IMPORT_C CCoeControl* ComponentControl( TInt aIndex ) const;
00206
00211 IMPORT_C TInt CountComponentControls() const;
00212
00217 IMPORT_C TSize MinimumSize();
00218
00223 IMPORT_C void HandleResourceChange( TInt aType );
00224
00231 IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
00232
00237 IMPORT_C void Draw( const TRect& aRect ) const;
00238
00239
00246 IMPORT_C virtual void PositionChanged();
00247
00248
00249
00250
00258 IMPORT_C void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );
00259
00260 public:
00261
00270 IMPORT_C TInt InsertItemL( const TInt aIndex, const TDesC& aText );
00271
00272 protected:
00273
00274
00275
00279 void SizeChanged();
00280
00285 void HandlePointerEventL( const TPointerEvent& aPointerEvent );
00286
00287 private:
00288
00292 CAknChoiceList();
00293
00301 void ConstructL( CCoeControl* aParent, CDesCArray* aItemArray, TInt aFlags, CAknButton* aButton );
00302
00307 void ConstructTypicalChoiceListL();
00308
00312 void SetPopupRect();
00313
00317 void UpdateLabelL();
00318
00322 void ShowTooltipL();
00323
00324
00325 private:
00326
00330 TInt iFlags;
00331
00335 TInt iSelectedIndex;
00336
00340 TBool iIsClosed;
00341
00348 CAknButton* iButton;
00349
00355 CEikLabel* iLabel;
00356
00361 CDesCArray* iArray;
00362
00368 CAknChoiceListPopup* iPopup;
00369
00374 CAknInfoPopupNoteController* iTooltip;
00375
00380 HBufC* iTooltipText;
00381
00386 TInt iTooltipWaitInterval;
00387
00392 TInt iTooltipInViewInterval;
00393
00398 TTooltipPosition iTooltipPosition;
00399
00400
00401 };
00402
00403 #endif // AKNCHOICELIST_H
00404
00405