vpnui/vpnmanagementui/inc/vpnuiloader.h
changeset 0 33413c0669b9
child 38 9f4e37332ce5
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     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:   VPN management main view
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef  __VPNUILOADER_H__
       
    19 #define  __VPNUILOADER_H__
       
    20 
       
    21 // INCLUDES
       
    22 #include <AknProgressDialog.h>
       
    23 #include <ConeResLoader.h>
       
    24 #include "vpnapiwrapper.h"
       
    25 #include "vpnmanagementuidefs.h"
       
    26 #include "uirunner.h"
       
    27 
       
    28 // CONSTANTS
       
    29 /**
       
    30  * Specifies the type of the waitnote text.
       
    31  */
       
    32 enum
       
    33     {
       
    34     EConnectingVia = 0x0,
       
    35     EProcessingStepN = 0x1
       
    36     };
       
    37 
       
    38 const TInt KSecondsToShowConnectingVia = 3;
       
    39    
       
    40 // FORWARD DECLARATIONS
       
    41 
       
    42 // CLASS DECLARATION
       
    43 class CAknWaitDialog;
       
    44 class CVpnManagementUiView;
       
    45 class CVpnManagementUi;
       
    46 /**
       
    47 *  CVpnUiLoader view control class.
       
    48 *
       
    49 *  @lib vpnmanagementui.lib
       
    50 */
       
    51 class CVpnUiLoader : public CCoeControl, public MCoeControlObserver, 
       
    52     public MProgressDialogCallback
       
    53     {
       
    54     public: // functions 
       
    55 
       
    56         /**
       
    57         * Destructor.
       
    58         */
       
    59         ~CVpnUiLoader();
       
    60 
       
    61         /**
       
    62          * NewL
       
    63          *
       
    64          * @since S60 3.0
       
    65          * @param aRect ?description
       
    66          * @param aViewId ?description
       
    67          * @return self
       
    68          */
       
    69         static class CVpnUiLoader* NewL(
       
    70             const TRect& aRect, TUid aViewId, CVpnManagementUiView* aUiView );
       
    71 
       
    72         /**
       
    73         * NewLC
       
    74         */
       
    75         static class CVpnUiLoader* NewLC(
       
    76             const TRect& aRect, TUid aViewId, CVpnManagementUiView* aUiView );
       
    77 
       
    78         /**
       
    79         * ChangeViewL
       
    80         * @param aNewTab change to given tab
       
    81         */
       
    82         void ChangeViewL(TInt aNewTab, TInt aSelectionIndex = -1); 
       
    83         
       
    84         /**
       
    85         * Activates the VPN policies, VPN policy servers and
       
    86         * VPN log views title
       
    87         */
       
    88         void ActivateTitleL(TInt aCurrentTitle);
       
    89 
       
    90         void ActivateTitleL(TInt aCurrentTitle, TDes& aText);
       
    91 
       
    92         /**
       
    93         * Activates the VPN log view Navipane text
       
    94         */
       
    95         void ActivateNaviTextL();
       
    96 
       
    97         /**
       
    98         * Added here because FocusChanged need to be included
       
    99         * in every control derived from CCoeControl that can have listbox 
       
   100         */
       
   101         void FocusChanged(TDrawNow aDrawNow);
       
   102 
       
   103         /**
       
   104         * Push the NaviPane to stack.
       
   105         */
       
   106         void PushNaviPaneL();
       
   107 
       
   108         /**
       
   109         * Pop the NaviPane from stack.
       
   110         */
       
   111         void PopNaviPane();
       
   112 
       
   113         /**
       
   114         * Push the DefaultNaviPane (empty) to stack.
       
   115         */
       
   116         void PushDefaultNaviPaneL();
       
   117 
       
   118         /**
       
   119         * Shows the error note 
       
   120         */
       
   121         void ShowErrorNoteL();
       
   122 
       
   123         /**
       
   124         * Get selection name to the connecting via wait note 
       
   125         */
       
   126         void GetSelectionNameL(TDes& aText);
       
   127 
       
   128         /**
       
   129         * Shows the Connecting via or Processing step wait note 
       
   130         */
       
   131         void ShowWaitNoteL();
       
   132 
       
   133         /**
       
   134         * Deletes the wait note 
       
   135         */
       
   136         void DeleteWaitNoteL();
       
   137 
       
   138         /**
       
   139         * Set text to wait note 
       
   140         */
       
   141         void SetTextL();
       
   142 
       
   143         //from MProgressDialogCallback
       
   144         void DialogDismissedL( TInt aButtonId );
       
   145 
       
   146 		/**
       
   147      	* Check if Disk space goes below critical level.
       
   148      	* @param aShowErrorNote If ETrue, a warning note is shown.
       
   149      	* @param aBytesToWrite Amount of disk space to be allocated.
       
   150      	* @return ETrue if allocation would go below critical level.
       
   151      	*/
       
   152     	TBool FFSSpaceBelowCriticalLevelL( TBool aShowErrorNote,
       
   153                                            TInt aBytesToWrite /*=0*/ );
       
   154 
       
   155         /**
       
   156         * Returns pointer to main management view 
       
   157         */
       
   158 		CAknView* GetVpnManagementUiView() const;
       
   159 		
       
   160 		/**
       
   161 		*  CVpnApiWrapper
       
   162 		*/
       
   163 		CVpnApiWrapper& VpnApiWrapperL();	
       
   164 		
       
   165 		/**
       
   166 		* Returns the id to the GS view that launched us
       
   167 		*/
       
   168         TVwsViewId GSViewId() const;			
       
   169 		
       
   170 		/**
       
   171 		* Sets the id to the GS view that launched us
       
   172 		* @param aGsViewId The id to the GS view
       
   173 		*/
       
   174         void SetGSViewId( TVwsViewId aGsViewId );			
       
   175 
       
   176     public: //data
       
   177 
       
   178         /**
       
   179         * Added here because FocusChanged need to be included
       
   180         * in every control derived from CCoeControl that can have listbox 
       
   181         */
       
   182         CEikColumnListBox* iListBox;
       
   183 
       
   184         /**
       
   185         * If ETrue, We are coming back from server parameters view.
       
   186         */
       
   187         TBool iBackFromServerDefinition;
       
   188 
       
   189         /**
       
   190         * If ETrue, new Server definition has created.
       
   191         */
       
   192         TBool iNewServerDefinition;
       
   193         /**
       
   194         * If ETrue, show Define policy server query when empty list.
       
   195         */
       
   196         TBool iShowDefineQuery;
       
   197  
       
   198         MUiRunnerObserver* iObserver;
       
   199 
       
   200         CAknWaitDialog*     iWaitDialog;
       
   201 
       
   202         TInt iCurrentPolicyIndex;
       
   203         TInt iCurrentServerIndex;
       
   204         TBool iPolicyUpdate;
       
   205         TBuf<KMaxUiSelectionNameLength> iSelectionName;
       
   206     
       
   207     private: // data
       
   208         
       
   209         /**
       
   210         * Used to wrap asynchronous calls
       
   211         */
       
   212         CVpnApiWrapper*          iVpnApiWrapper;        
       
   213         
       
   214     private: // implementation
       
   215 
       
   216         void ConstructL(const TRect& aRect, TUid aViewId);
       
   217         CVpnUiLoader(CVpnManagementUiView* aUiView);
       
   218         void HandleControlEventL( CCoeControl* aControl,
       
   219             TCoeEvent aEventType );
       
   220         TKeyResponse OfferKeyEventL(
       
   221             const TKeyEvent& aKeyEvent, TEventCode aType);
       
   222     public:    
       
   223         void AddResourceFileL(TBool aKeepOpen = EFalse);
       
   224         void ReleaseResource(TBool aForceClose = EFalse);
       
   225    
       
   226     private: //data
       
   227 
       
   228         /**
       
   229         * For Navipane
       
   230         */
       
   231         CAknNavigationDecorator* iVersionInfoInNaviPane;
       
   232 
       
   233         /**
       
   234         * For Navipane
       
   235         */
       
   236         CAknNavigationControlContainer* iNaviPane;
       
   237 
       
   238 
       
   239         /**
       
   240         * To store the previous view id 
       
   241         */
       
   242         TUid iPreviousViewId;
       
   243 
       
   244         /**
       
   245         * To store the previous view id  
       
   246         */
       
   247         TUid iPreviousAppViewId;
       
   248 
       
   249         TInt iTextToShow;
       
   250         TInt iStateCodeToShow;
       
   251         TTime iWaitNoteStartTime;
       
   252         
       
   253         /**
       
   254         * Views to be registered and unregistered
       
   255         */
       
   256         CAknView* iVpnManagementUiView;
       
   257         CAknView* iVpnManagementUiLogView;
       
   258         CAknView* iVpnManagementUiPolicyView;
       
   259         CAknView* iVpnManagementUiParametersView;
       
   260         CAknView* iVpnManagementUiServerView;
       
   261         
       
   262         CVpnManagementUi* iCVpnManagementUi;
       
   263         
       
   264         /**
       
   265         * To get hold of iResourceLoader
       
   266         */
       
   267         RConeResourceLoader iResourceLoader;        
       
   268 
       
   269         TVwsViewId iGsViewId; // the view id of the view which launched us
       
   270         TBool iKeepOpen;
       
   271         TBool iPolicyViewVisited;
       
   272         TBool iLogViewVisited;
       
   273    };
       
   274 
       
   275 #endif // __VPNUILOADER_H__
       
   276 
       
   277 // End of File