accesssec_plat/wapi_security_settings_ui_api/inc/wapisecuritysettingsui.h
branchRCL_3
changeset 46 c74b3d9f6b9e
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
       
     1 /*
       
     2 * Copyright (c) 2001-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 the License "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: Declares the main handler CWAPISecuritySettings, UI CWAPISecuritySettingsUI and public API for the WAPI Security Settings. 
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 10 %
       
    20 */
       
    21 
       
    22 #ifndef WAPISECURITYSETTINGSUI_H
       
    23 #define WAPISECURITYSETTINGSUI_H
       
    24 
       
    25 // INCLUDES
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <WapiCertificates.h>
       
    29 
       
    30 #include <metadatabase.h>
       
    31 #include <commsdattypesv1_1.h>
       
    32 
       
    33 using namespace CommsDat;
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CEikonEnv;
       
    37 class CWAPISecuritySettingsUi;
       
    38 class CWAPISecuritySettingsUiImpl;
       
    39 class CWAPISecuritySettingsImpl;
       
    40 class CCommsDatabase;
       
    41 
       
    42 // CLASS DECLARATION
       
    43 /*
       
    44 * WAPI Security Settings. Enables loading, saving and editing the settings
       
    45 * (editing via CWAPISecuritySettingsUi).
       
    46 * Proxy around the real implementation in CWAPISecuritySettingsUiImpl. 
       
    47 */
       
    48 NONSHARABLE_CLASS( CWAPISecuritySettings ) : public CBase
       
    49     {
       
    50 
       
    51     public: // Constructors and destructor
       
    52 
       
    53         /**
       
    54         * Two-phased constructor. Leaves on failure.
       
    55         * @return The constructed CWAPISecuritySettings object.
       
    56         */
       
    57         IMPORT_C static CWAPISecuritySettings* NewL();
       
    58 
       
    59 
       
    60         /**
       
    61         * Destructor.
       
    62         */
       
    63         IMPORT_C ~CWAPISecuritySettings();
       
    64 
       
    65 
       
    66     public:     // Types
       
    67 
       
    68         enum TEvent                     // Events happening during edit.
       
    69             {
       
    70             ENone           = 0x0000,   // Nothing happened.
       
    71             EModified       = 0x0001,   // Data changed.
       
    72             EValid          = 0x0010,   // All data entered are valid, they can be
       
    73                                         // saved
       
    74             
       
    75             EExitReq        = 0x0020,   // Exit option requested, also caller 
       
    76                                         // app should close
       
    77             EShutDownReq    = 0x0040    // ShutDown was requested
       
    78             };
       
    79         
       
    80         enum TWapiKeyFormat
       
    81             {
       
    82             EWapiKeyAscii   = 0,
       
    83             EWapiKeyHex     = 1
       
    84             };
       
    85         
       
    86     public:     // New methods
       
    87 
       
    88         
       
    89         /**
       
    90         * Edit WAPI certificate settings.
       
    91         * @param aUi UI to be used.
       
    92         * @param aTitle Title Pane text to display during edit.
       
    93         * @return Exit reason.
       
    94         */
       
    95         IMPORT_C TInt EditL( CWAPISecuritySettingsUi& aUi, 
       
    96                              const TDesC& aTitle );
       
    97 
       
    98         
       
    99         /**
       
   100         * Load WAPI certificate settings and configuration from database.
       
   101         * @param aIapRecordID 
       
   102         * @param aSession Commsdat session
       
   103         */
       
   104         IMPORT_C void LoadL( TUint32 aIapRecordId, CMDBSession& aSession );
       
   105 
       
   106         /**
       
   107         * Tells if the settings are valid and can be saved
       
   108         * @return ETrue if all the compulsory settings have been entered
       
   109         */
       
   110         IMPORT_C TBool IsValid() const;
       
   111 
       
   112         /**
       
   113         * Save WAPI certificate settings of the IAP to the database.
       
   114         * @param aIapRecordID 
       
   115         * @param aSession Commsdat session
       
   116         */
       
   117         IMPORT_C void SaveL( TUint32 aIapRecordId, CMDBSession& aSession ) const;
       
   118 
       
   119         /**
       
   120         * Sets the Pre-shared key. Also sets Authentication method to PSK.
       
   121         * @param aKeyFormat     Key format
       
   122         * @param aPreSharedKey  The key to be set
       
   123         */
       
   124         IMPORT_C void SetPreSharedKeyL( const TWapiKeyFormat aKeyFormat, const TDesC& aPreSharedKey );
       
   125                 
       
   126         /**
       
   127         * Delete AP related data from certificate database tables
       
   128         *
       
   129         * @param aId        Service table id
       
   130         */
       
   131         IMPORT_C void DeleteAPSpecificDataL( const TInt aId );
       
   132     
       
   133     private:    // Data 
       
   134 
       
   135         // Implementation. Owned.
       
   136         CWAPISecuritySettingsImpl* iImpl;  
       
   137 
       
   138     };
       
   139 
       
   140 /**
       
   141 * User interface to edit WAPI Security Settings.
       
   142 * Proxy around the real implementation in CWAPISecuritySettingsUiImpl.
       
   143 */
       
   144 NONSHARABLE_CLASS( CWAPISecuritySettingsUi ) : public CBase
       
   145     {
       
   146 
       
   147     public:     // Constructors and destructor
       
   148 
       
   149         /**
       
   150         * Two-phased constructor. Leaves on failure.
       
   151         * @param aEikEnv Eikon environment.
       
   152         * @return The constructed CWAPISecuritySettingsUi object.
       
   153         */
       
   154         IMPORT_C static CWAPISecuritySettingsUi* NewL( CEikonEnv& aEikEnv );
       
   155 
       
   156         /**
       
   157         * Destructor.
       
   158         */
       
   159         IMPORT_C virtual ~CWAPISecuritySettingsUi();
       
   160 
       
   161     private:    // Friends
       
   162 
       
   163         friend class CWAPISecuritySettings;
       
   164 
       
   165     private:    // Data 
       
   166 
       
   167         // Implementation. Owned.
       
   168         CWAPISecuritySettingsUiImpl* iImpl;
       
   169 
       
   170     };
       
   171 #endif
       
   172 
       
   173 
       
   174 // End of File