aknchoicelist.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name        : aknchoicelist.h
00004 *  Part of     : UI Framework core / AvKon
00005 *  Description : CAknChoiceList - Choice list for S60 
00006 *  Version     : %version: 10 % 
00007 *
00008 *  Copyright © 2005 Nokia.  All rights reserved.
00009 *  This material, including documentation and any related computer
00010 *  programs, is protected by copyright controlled by Nokia.  All
00011 *  rights are reserved.  Copying, including reproducing, storing,
00012 *  adapting or translating, any or all of this material requires the
00013 *  prior written consent of Nokia.  This material also contains
00014 *  confidential information which may not be disclosed to others
00015 *  without the prior written consent of Nokia.
00016 * ============================================================================
00017 */
00018 
00019 
00020 #ifndef AKNCHOICELIST_H
00021 #define AKNCHOICELIST_H
00022 
00023 // includes 
00024 #include <akncontrol.h>
00025 #include <coecobs.h>
00026 
00027 // forward declarations  
00028 class CAknButton;
00029 class CEikLabel;
00030 class CAknChoiceListPopup;
00031 class CAknChoiceListPopupList;
00032 class CAknsFrameBackgroundControlContext;
00033 class CAknInfoPopupNoteController;
00034 
00035 // Class declaration
00036 
00045 class CAknChoiceList : public CAknControl, public MCoeControlObserver
00046     {   
00047 public:
00048 
00049     /* Flags for choice list types and positioning */   
00050     enum TAknChoiceListFlags
00051         {
00052         /* Using default choice list with popup list */
00053         EAknChoiceListWithCurrentSelection = 0x01,
00054         /* Using user defined button to open choice list */
00055         EAknChoiceListWithoutCurrentSelection = 0x02,
00056         /* Popup positioning flags */
00057         EAknChoiceListPositionLeft = 0x04,   
00058         EAknChoiceListPositionRight = 0x08,   
00059         EAknChoiceListPositionBottom = 0x10  
00060         };    
00061      
00062      /* Tooltip positioning */
00063      enum TTooltipPosition
00064         {
00065         EPositionTop = 1, /* Tooltip alignment vertically to top */
00066         EPositionBottom, /* Tooltip alignment vertically to bottom */
00067         EPositionLeft, /* Tooltip alignment horizontally to left */
00068         EPositionRight /* Tooltip alignment horizontally to right */
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 // From CCoeControl
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 // From MCoeControlObserver
00250     
00258     IMPORT_C void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );
00259 
00260 public: 
00261     // new functions
00270     IMPORT_C TInt InsertItemL( const TInt aIndex, const TDesC& aText );
00271     
00272 protected: 
00273 
00274 // from CCoeControl         
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: // data
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 // end of file

Copyright © Nokia Corporation 2001-2007
Back to top