landmarksui/uicontrols/inc/CLmkSelectorDialog.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    LandmarksUi Content File -    CLmkSelectorDialog class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef CLMKSELECTORDIALOG_H
       
    26 #define CLMKSELECTORDIALOG_H
       
    27 
       
    28 //  INCLUDES
       
    29 #include "MLmkListProviderObserver.h"
       
    30 #include <aknselectionlist.h>
       
    31 #include "MLmkListMemento.h"
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class MLmkNavigationObserver;
       
    35 class TCoeHelpContext;
       
    36 class CLmkListProviderBase;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 * CLmkSelectorDialog class
       
    42 */
       
    43 class CLmkSelectorDialog
       
    44     : public CAknSelectionListDialog,
       
    45       public MLmkListProviderObserver
       
    46     {
       
    47     public:  // Constructors and destructor
       
    48 
       
    49         /**
       
    50         * Two-phased constructor.
       
    51         * @param aOpenedItemIndex
       
    52         * @param aLbModel listbox model, ownership is not transferred
       
    53         * @param aMenuBarResourceId
       
    54         * @param aCmdObserver, ownership is not transferred
       
    55         * @param aMemento , maintains reference of memento.
       
    56         * @return newly instantiated object
       
    57         */
       
    58         static CLmkSelectorDialog* NewL( TInt& aOpenedItemIndex,
       
    59                                          MDesCArray* aLbModel,
       
    60                                          TInt aMenuBarResourceId,
       
    61                                          MEikCommandObserver* aCmdObserver,
       
    62                                          MLmkListMemento* aMemento = NULL, CLmkListProviderBase* aListProvider = NULL);
       
    63 
       
    64         /**
       
    65         * Destructor.
       
    66         */
       
    67         virtual ~CLmkSelectorDialog();
       
    68 
       
    69     public: // New functions
       
    70     	void MakeEmptyTextListBoxL(TInt aResourcePrimText ,TInt aResourceSecText, TBool aRequestFromFindBox = EFalse ) const;
       
    71     	/**
       
    72         * Enable/Disable the find box in list dialog.
       
    73         * @return ETrue to enable find box, EFalse otherwise
       
    74         */
       
    75 		void ShowFindBox( TBool aVisible );
       
    76         /**
       
    77         * Tells whether this dialog has a find box or not.
       
    78         * @return ETrue if has find box, EFalse otherwise
       
    79         */
       
    80         TBool HasFindBox() const;
       
    81 
       
    82         /**
       
    83         * Number of list items.
       
    84         * @return number of list items
       
    85         */
       
    86         TInt NumberOfItems() const;
       
    87 
       
    88         /**
       
    89         * Currently highlighted item's index.
       
    90         * @return highlighted item's index
       
    91         */
       
    92         TInt CurrentItemIndex() const;
       
    93 
       
    94         /**
       
    95         * Selection indexes. This class does not support multiselection,
       
    96         * subclasses may support.
       
    97         * @return selection indexes, ownership is not transferred
       
    98         */
       
    99         const CArrayFix<TInt>* SelectionIndexes() const;
       
   100 
       
   101         /**
       
   102         * Set help context.
       
   103         * @param aContext
       
   104         */
       
   105         void SetHelpContext( TCoeHelpContext aContext );
       
   106 
       
   107         /**
       
   108         * Set observer for navigation events.
       
   109         * @param
       
   110         */
       
   111         void SetNavigationObserver( MLmkNavigationObserver& aObserver );
       
   112 
       
   113                // For Landscape Support
       
   114 		void HandleResourceChange (TInt aType);
       
   115 
       
   116 		 /**
       
   117       	* Stores the empty dialog label
       
   118         * @param aLabelRes Label resource id
       
   119         */
       
   120 		void SetDlgEmptyResource(TInt aEmptyPrimLabel,TInt aEmptySecLabel);
       
   121 		/**
       
   122       	* Enables or Disables left softkey
       
   123         * @param aEnable ETrue for visible, EFalse for invisible
       
   124         */
       
   125 		void EnableLeftSoftKey(TBool aEnable);
       
   126 		 /**
       
   127         * Updates the MSK for the dialog
       
   128         */
       
   129 		virtual void UpdateMskL();
       
   130 		void PrepareLC(TInt aDlgResourceId);
       
   131 
       
   132 	private:
       
   133         /**
       
   134         * By default Symbian 2nd phase constructor is private.
       
   135         */
       
   136         void ConstructL(TInt aMenuBarResourceId);
       
   137 
       
   138 		void SetCbaResourceAndCommandId(TInt aaDlgResourceId);
       
   139 
       
   140     public: // From CAknSelectionListDialog
       
   141         CEikListBox* ListBox() const;
       
   142         CAknSearchField* FindBox() const;
       
   143 #ifdef RD_SCALABLE_UI_V2
       
   144     protected: // from MCoeControlObserver
       
   145         void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );
       
   146 #endif //RD_SCALABLE_UI_V2
       
   147 
       
   148     public: // From MLmkListProviderObserver
       
   149         void HandleListProviderEvent( TLmkListProviderEventType aEvent );
       
   150         void HandleListProviderError( TInt aError );
       
   151 
       
   152     protected: // From CCoeControl
       
   153         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   154         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   155                                      TEventCode aType );
       
   156 
       
   157     protected: // From CAknSelectionListDialog
       
   158         void PreLayoutDynInitL();
       
   159         void PostLayoutDynInitL();
       
   160 
       
   161     protected: // From CAknDialog
       
   162         TBool OkToExitL( TInt aButtonId );
       
   163 
       
   164     protected: // New functions
       
   165 
       
   166         /**
       
   167         * Internal method which notifies navigation observer if key event
       
   168         * is navigation event.
       
   169         * @param aEkeyEvent
       
   170         * @param aType
       
   171         * @return EKeyWasConsumed if navigation observer consumed the event
       
   172         */
       
   173         TKeyResponse KeyEventForNavigationL( const TKeyEvent& aKeyEvent,
       
   174                                              TEventCode aType );
       
   175 
       
   176     protected:
       
   177 
       
   178         /**
       
   179         * C++ default constructor.
       
   180         */
       
   181         CLmkSelectorDialog( TInt& aOpenedItemIndex,
       
   182                             MDesCArray* aLbModel,
       
   183                             MEikCommandObserver* aCmdObserver,
       
   184                             MLmkListMemento* aMemento = NULL, CLmkListProviderBase* aListProvider = NULL );
       
   185 
       
   186     protected:    // Data
       
   187         TCoeHelpContext iHelpContext;
       
   188         /// Ref: navigation observer
       
   189         MLmkNavigationObserver* iNavigationObserver;
       
   190         MLmkListMemento* iMemento;
       
   191         TBool iExited;
       
   192         TInt iDlgEmptyLabelPrimResource;
       
   193         TInt iDlgEmptyLabelSecResource;
       
   194      	TInt iMskCmdId;
       
   195      	TInt iCbaResourceId;
       
   196 #ifdef RD_SCALABLE_UI_V2
       
   197         CAknListBoxFilterItems* iFilter;
       
   198 #endif //RD_SCALABLE_UI_V2
       
   199 		CLmkListProviderBase* iListProvider;
       
   200     };
       
   201 
       
   202 #endif      // CLMKSELECTORDIALOG_H
       
   203 
       
   204 // End of File