locationtriggering/lbtmgmtui/inc/lbtmgmtplugincontainer.h
branchRCL_3
changeset 44 2b4ea9893b66
parent 42 02ba3f1733c6
child 45 6b6920c56e2f
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
     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:  Location Triggering Managemen Plugin View's container
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CLBTMGMTPLUGINCONTAINER_H_
       
    19 #define CLBTMGMTPLUGINCONTAINER_H_
       
    20 
       
    21 // System Includes 
       
    22 #include <e32base.h>
       
    23 #include <coecntrl.h>
       
    24 #include <eiklbo.h>
       
    25 
       
    26 // Forward Declarations
       
    27 class MDesCArray;
       
    28 class MLbtMgmtPluginCmdHdlr;
       
    29 class CAknSettingStyleListBox;
       
    30 class CLbtMgmtPluginView;
       
    31 
       
    32 // Class Definition
       
    33 
       
    34 /**
       
    35  * Container for the CLbtMgmtPluginView.
       
    36  */
       
    37 class CLbtMgmtPluginContainer : public CCoeControl,
       
    38                                     public MEikListBoxObserver
       
    39     {
       
    40     public:
       
    41         /**
       
    42          * Static Two phase contructor that instantiates the CLbtMgmtPluginContainer
       
    43          * 
       
    44          * @param aRect                         Client rectangle
       
    45          * @param aListBoxModel                 Model for the container's list box
       
    46          * @param aCmdHandler                   List box command handler
       
    47          * @return CLbtMgmtPluginContainer*  Reference to the object created
       
    48          */
       
    49         static CLbtMgmtPluginContainer* NewL( 
       
    50                                 const TRect&                    aRect,
       
    51                                       MDesCArray&               aListBoxModel,
       
    52                                       MLbtMgmtPluginCmdHdlr& aCmdHandler,
       
    53                                       CLbtMgmtPluginView* aView );
       
    54 
       
    55         /**
       
    56          * Static Two phase contructor that instantiates the CLbtMgmtPluginContainer
       
    57          * Leaves the object on the Cleanup stack
       
    58          * 
       
    59          * @param aRect                         Client rectangle
       
    60          * @param aListBoxModel                 Model for the container's list box
       
    61          * @param aCmdHandler                   List box command handler     
       
    62          * @return CLbtMgmtPluginContainer*  Reference to the object created
       
    63          */
       
    64         static CLbtMgmtPluginContainer* NewLC(
       
    65                                 const TRect&                    aRect,
       
    66                                       MDesCArray&               aListBoxModel,
       
    67                                       MLbtMgmtPluginCmdHdlr& aCmdHandler,
       
    68                                       CLbtMgmtPluginView* aView );
       
    69         /**
       
    70          * Destructor
       
    71          */
       
    72         ~CLbtMgmtPluginContainer();
       
    73          
       
    74         /**
       
    75          * Returns the currentlt focussed element.
       
    76          *
       
    77          * @return TInt Index of the item selected
       
    78          */
       
    79         TInt GetFocussedItem();
       
    80         
       
    81         /**
       
    82          * Inherited from CCoeControl
       
    83          */
       
    84         void HandleResourceChange(TInt aType);
       
    85 
       
    86         /**
       
    87          * From CoeControl
       
    88          */
       
    89         TInt CountComponentControls() const;
       
    90 
       
    91         /**
       
    92          * From CCoeControl
       
    93          */
       
    94         CCoeControl* ComponentControl(TInt aIndex) const;
       
    95 
       
    96         /**
       
    97          * Inherited from CCoeControl
       
    98          */
       
    99         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   100                                            TEventCode aType );
       
   101         
       
   102         /**
       
   103          * Inherited from CCoeControl
       
   104          */                         
       
   105         void HandlePointerEventL(const TPointerEvent &aPointerEvent);
       
   106  
       
   107         /**
       
   108          * Inherited from MEikListBoxObserver
       
   109          */
       
   110         void HandleListBoxEventL( CEikListBox*      aListBox, 
       
   111                                   TListBoxEvent     aEventType );        
       
   112                 
       
   113         /**
       
   114          * Returns the help context
       
   115          *
       
   116          * @param aContext  The help context that has to be determined
       
   117          */
       
   118         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   119                 
       
   120         /**
       
   121          * Updates listbox model          
       
   122          */
       
   123        void Update();
       
   124        /*
       
   125         * Shows context specific menu items
       
   126         */
       
   127        void ShowContextMenuL();
       
   128              
       
   129     protected:
       
   130         /**
       
   131          * Handles Focus Change to list 
       
   132          */
       
   133         void FocusChanged(TDrawNow aDrawNow);
       
   134          
       
   135         /**
       
   136          * From CoeControl,SizeChanged.
       
   137          */
       
   138         void SizeChanged();
       
   139 
       
   140     private:
       
   141         /**
       
   142          * Overloaded Constructor
       
   143          */
       
   144         CLbtMgmtPluginContainer( MDesCArray&               aListBoxModel,
       
   145                                     MLbtMgmtPluginCmdHdlr& aCmdHandler,
       
   146                                     CLbtMgmtPluginView* aView );
       
   147 
       
   148         /**
       
   149          * Second phase of the two phase Construction process
       
   150          */
       
   151         void ConstructL( const TRect& aRect );
       
   152            
       
   153         /** 
       
   154          * Creates the List box and the Listbox model. Associates the 
       
   155          * list box model wit the list box
       
   156          *         
       
   157          */
       
   158         void CreateListboxL();
       
   159                       
       
   160         /**
       
   161          * Sets the Title text
       
   162          * @param aResourceText Resource to create title
       
   163          */
       
   164         void MakeTitleL( TInt aResourceText );
       
   165               
       
   166          /**
       
   167           * Returns the Appui's status pane
       
   168           * @return CEikStatusPane* Statuspane pointer
       
   169           */
       
   170          CEikStatusPane* StatusPane();
       
   171      
       
   172     private:
       
   173         /**
       
   174          * Reference to the List box model
       
   175          */
       
   176         MDesCArray&                 iListBoxModel;
       
   177           
       
   178         /**
       
   179          * Reference to the List box command handler
       
   180          */
       
   181         MLbtMgmtPluginCmdHdlr&   iCmdHandler;
       
   182         
       
   183         /**
       
   184          * Settings list box for Trigger Management settings
       
   185          * Owns
       
   186          */
       
   187         CAknSettingStyleListBox*        iListBox;    
       
   188         
       
   189         /**
       
   190          * Help context
       
   191          */
       
   192         TCoeContextName                 iContextName;
       
   193         /*
       
   194          * reference to the lbtmgmtplugin view
       
   195          */
       
   196         CLbtMgmtPluginView* iView;
       
   197         
       
   198   };
       
   199 
       
   200 #endif // CLBTMGMTPLUGINCONTAINER_H_
       
   201