vpnui/vpnmanagementui/inc/vpnmanagementuipolicycontainer.h
branchRCL_3
changeset 24 e06095241a65
equal deleted inserted replaced
23:473321461bba 24:e06095241a65
       
     1 /*
       
     2 * Copyright (c) 2003 - 2009 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:   Declaration of the CVpnManagementUiPolicyContainer class.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __VPNMANAGEMENTUIPOLICYCONTAINER_H__
       
    19 #define __VPNMANAGEMENTUIPOLICYCONTAINER_H__
       
    20 
       
    21 // INCLUDES
       
    22 #include "vpnmanagementuipolicyview.h"
       
    23 
       
    24    
       
    25 // FORWARD DECLARATIONS
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30 *  CVpnManagementUiPolicyContainer  container control class.
       
    31 *
       
    32 *  @lib vpnmanagementui.lib
       
    33 */
       
    34 class CVpnManagementUiPolicyContainer : 
       
    35     public CCoeControl, 
       
    36     public MCoeControlObserver, 
       
    37     public MEikListBoxObserver
       
    38     {
       
    39 
       
    40     /**
       
    41     * Policy Container needs to get access to CVpnManagementUiPolicyView's DoActivateL
       
    42     */
       
    43     friend void CVpnManagementUiPolicyView::DoActivateL(
       
    44         const TVwsViewId&, TUid, const TDesC8&);
       
    45 
       
    46     public: // functions
       
    47         
       
    48         /**
       
    49         * Overrided Default constructor
       
    50         */
       
    51         CVpnManagementUiPolicyContainer(
       
    52             CVpnManagementUiPolicyView& aParent, CVpnUiLoader& aLoader);
       
    53 
       
    54         /**
       
    55         * Destructor.
       
    56         */
       
    57         ~CVpnManagementUiPolicyContainer();
       
    58 
       
    59         /**
       
    60         * Overrided ActivateL function from base class CCoeControl
       
    61         */
       
    62         virtual void ActivateL();
       
    63 
       
    64         /**
       
    65         * Change focus
       
    66         */
       
    67         void FocusChanged(TDrawNow aDrawNow);
       
    68         
       
    69         /**
       
    70 		* From CCoeControl
       
    71 		*/
       
    72 		void HandleResourceChange( TInt aType );
       
    73  
       
    74         /**
       
    75         * Draws listbox, fetches graphic icons for markable list
       
    76         */
       
    77         void DrawListBoxL(TInt aCurrentPosition, TInt aTopItem);
       
    78 
       
    79         /**
       
    80         * Updates listbox after deletion, sets No VPN policies text 
       
    81         * if deleted policy was a last one.
       
    82         */
       
    83         void UpdateListBoxL(TInt& aCurrentPosition);
       
    84 
       
    85         /**
       
    86         * Handles listbox events
       
    87         */
       
    88         void HandleListBoxEventL(
       
    89             CEikListBox* aListBox, TListBoxEvent aEventType);
       
    90 
       
    91 
       
    92 
       
    93     public: // data
       
    94 
       
    95         /**
       
    96         * To handle listbox
       
    97         * Cannot be private because CVpnManagementUiPolicyView uses it
       
    98         */
       
    99         CEikColumnListBox* iListBox;
       
   100 
       
   101         /**
       
   102         * To get hold of PolicyView
       
   103         */
       
   104         CVpnManagementUiPolicyView& iParent;
       
   105 
       
   106         /**
       
   107         * To get hold of CVpnUiLoader
       
   108         */
       
   109         CVpnUiLoader& iLoader;
       
   110 
       
   111         /**
       
   112         * To store the list item count
       
   113         */
       
   114         TInt iListItemCount;
       
   115 
       
   116         /**
       
   117         * If ETrue, Show Waitnote.
       
   118         */
       
   119 
       
   120 
       
   121     private: // functions
       
   122 
       
   123         /**
       
   124         * Default constructor
       
   125         */
       
   126         CVpnManagementUiPolicyContainer();
       
   127 
       
   128         /**
       
   129         * Symbian OS default constructor.
       
   130         * @param aRect Frame rectangle for container.
       
   131         */
       
   132         void ConstructL(
       
   133             const TRect& aRect, TInt& aCurrentPosition, TInt& aTopItem);
       
   134 
       
   135         /**
       
   136         * Creates listbox, sets empty listbox text
       
   137         */
       
   138         void CreateListBoxL();
       
   139 
       
   140         /**
       
   141         * From CoeControl,SizeChanged.
       
   142         */
       
   143         void SizeChanged();
       
   144 
       
   145        /**
       
   146         * From CoeControl,CountComponentControls.
       
   147         */
       
   148         TInt CountComponentControls() const;
       
   149 
       
   150        /**
       
   151         * From CCoeControl,ComponentControl.
       
   152         */
       
   153         CCoeControl* ComponentControl(TInt aIndex) const;
       
   154 
       
   155         /**
       
   156         * Handles control events
       
   157         *
       
   158         * event handling section
       
   159         * e.g Listbox events
       
   160         */
       
   161         void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
       
   162 
       
   163         /**
       
   164         * Handles the key events OK button, arrow keys, delete key.
       
   165         */
       
   166         TKeyResponse OfferKeyEventL(
       
   167             const TKeyEvent& aKeyEvent, TEventCode aType);
       
   168        
       
   169         /**
       
   170         * Gets list of policies from VpnAPI and displays them in listbox.
       
   171         * 
       
   172         */
       
   173         void ShowPoliciesL(); 
       
   174 
       
   175 
       
   176 
       
   177 
       
   178 
       
   179 #ifdef __SERIES60_HELP
       
   180         /**
       
   181         * This function is called when Help application is launched.  
       
   182         * (other items were commented in a header).
       
   183         */
       
   184         void GetHelpContext(TCoeHelpContext& aContext) const;
       
   185 #endif //__SERIES60_HELP
       
   186 
       
   187        
       
   188     private: //data
       
   189 
       
   190     };
       
   191 
       
   192 #endif // __VPNMANAGEMENTUIPOLICYCONTAINER_H__
       
   193 
       
   194 // End of File