accesspointcontrol/apcontrollistplugin/inc/apcontrollistplugincontainer.h
changeset 27 489cf6208544
parent 23 7ec726f93df1
child 42 017c42709822
child 46 95d45f234cf3
equal deleted inserted replaced
23:7ec726f93df1 27:489cf6208544
     1 /*
       
     2 * Copyright (c) 2006 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:  
       
    15 *     Container class for APControl list plugin.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef APCONTROLLIST_PLUGIN_CONTAINER_H
       
    21 #define APCONTROLLIST_PLUGIN_CONTAINER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <coeccntx.h>
       
    25 #include <eikclb.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CApControlListbox;
       
    29 class CAknNavigationDecorator;
       
    30 class CAknNavigationControlContainer;
       
    31 class CAPControlListPlugin;
       
    32 class MEikListBoxObserver;
       
    33 class CApControlListboxModel;
       
    34 
       
    35 // UID of general settings app, in which help texts are included
       
    36 const   TUid    KHelpUidAPControlList = { 0x100058EC };
       
    37 
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 *  CAPControlListPluginContainer container class
       
    43 *  container class for APControl list plugin 
       
    44 */
       
    45 class CAPControlListPluginContainer : public CCoeControl
       
    46     {
       
    47     
       
    48     public: 
       
    49         
       
    50         /**
       
    51         * Symbian OS constructor.
       
    52         *
       
    53         * @param aRect Listbox's rect.
       
    54         * @param aListObserver pointer to the list observer
       
    55         */
       
    56         void ConstructL( const TRect& aRect, 
       
    57                          MEikListBoxObserver* aListObserver );
       
    58 
       
    59         /**
       
    60         * Destructor.
       
    61         */
       
    62         ~CAPControlListPluginContainer();
       
    63     
       
    64     public: // From CCoeControl
       
    65     
       
    66         /**
       
    67         * From CCoeControl, gives back the count of contained controls.
       
    68         */
       
    69         virtual TInt CountComponentControls() const;
       
    70 
       
    71         /**
       
    72         * From CCoeControl, gives back the given indexed 
       
    73         * from contained controls.
       
    74 		* @param aIndex index
       
    75         */        
       
    76         CCoeControl* ComponentControl( TInt aIndex ) const;
       
    77 
       
    78         /**
       
    79         * From CCoeControl, resizes the contained controls.
       
    80         */
       
    81         virtual void SizeChanged();
       
    82         
       
    83         /**
       
    84         * From CCoeControl, processes the given key event.
       
    85 	    * @param aKeyEvent The key event that occured.
       
    86 		* @param aType The type of key event that occured.
       
    87 	    * @return @c EKeyWasConsumed if the event was processed,
       
    88         */
       
    89         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, 
       
    90                                      TEventCode aType );
       
    91     
       
    92         /** 
       
    93         * From CCoeControl, gets the control's help context.
       
    94      	* @param aContext help context.
       
    95         */
       
    96         virtual void GetHelpContext( TCoeHelpContext& aContext ) const;
       
    97         
       
    98         /**
       
    99         * From CCoeControl, used for sclable ui and landscape support.
       
   100      	* @param aType A message UID value.
       
   101         */        
       
   102         void HandleResourceChange( TInt aType );
       
   103           
       
   104         /**
       
   105         * From CoeControl,SizeChanged.
       
   106         * @param aDrawNow Contains the value that was passed to it by 
       
   107         *        @c SetFocus(). 
       
   108         */        
       
   109         virtual void FocusChanged(TDrawNow aDrawNow);  
       
   110         
       
   111         /**
       
   112         * Adds to the ListBox
       
   113         * @param newItem new item.
       
   114         */        
       
   115         void AddToListBoxL(TPtrC& newItem);              
       
   116         
       
   117         /**
       
   118         * Sets Current Item Index in the ListBox
       
   119         * @param index Current item index.
       
   120         */        
       
   121 		void SetCurrentItemIndex(TInt index);
       
   122 		
       
   123         /**
       
   124         * Gets current item index
       
   125         * @return Current item index in the ListBox
       
   126         */        
       
   127 		TInt CurrentItemIndex();
       
   128 		
       
   129         /**
       
   130         * Removes current item from ListBox
       
   131         */        
       
   132 		void RemoveFromListBoxL();
       
   133 		
       
   134         /**
       
   135         * Gets the number of items in the list
       
   136         * @return the number of items in the list
       
   137         */
       
   138         TInt NumberOfItems() const;
       
   139 		
       
   140         /**
       
   141         * Writes text with ID to the NaviPane
       
   142         */
       
   143         void WriteToNaviPaneL( TInt aResourceId );
       
   144         
       
   145     private:
       
   146 
       
   147         /**
       
   148         * Sets the title pane to the appropriate text.
       
   149         * @param aResourceId Resource id of the showed text .
       
   150         */
       
   151         void TitlePaneTextsL( TInt aResourceId );
       
   152 
       
   153     public:
       
   154         
       
   155         //@var Listbox  - owned
       
   156         CApControlListbox* 				iListBox;
       
   157         //@var Model for the listbox  - owned
       
   158         CApControlListboxModel*     	iModel;
       
   159 
       
   160     private:
       
   161     
       
   162         //@var For NaviPane. - owned
       
   163         CAknNavigationDecorator* 		iNaviDecorator;
       
   164 
       
   165         //@var For NaviPane. - owned
       
   166         CAknNavigationControlContainer* iNaviPane;
       
   167         
       
   168     };
       
   169 
       
   170 #endif //APCONTROLLIST_PLUGIN_CONTAINER_H