wvuing/wvuiave/AppSrc/CCAAppSettingsSAPExt.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  SAP extension to Application settings
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CCAAPPSETTINGSSAPEXT_H
       
    21 #define CCAAPPSETTINGSSAPEXT_H
       
    22 
       
    23 //  INCLUDES
       
    24 
       
    25 #include <e32base.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CIMPSPresenceConnectionUi;
       
    29 class CIMPSSAPSettings;
       
    30 class CIMPSSAPSettingsStore;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35  *  Application settings extension to SAP settings
       
    36  *  @lib chat.lib
       
    37  *  @since Series 60 3.0
       
    38  */
       
    39 class CCAAppSettingsSAPExt : public CBase
       
    40     {
       
    41     public:  // Constructors and destructor
       
    42 
       
    43         /**
       
    44          * Two-phased constructor.
       
    45         * @param aConnUI		   Connection UI..
       
    46          * @param aPreserveSessionIdInExit ETrue to preserve IMPSCUI Session Id when exiting,
       
    47          * needed in Always Online case
       
    48          * @param aSap If given, the settings will be saved in the sap
       
    49          * instead of cenrep.
       
    50          */
       
    51         static CCAAppSettingsSAPExt* NewL( CIMPSPresenceConnectionUi& aConnUi,
       
    52                                            TBool aPreserveSessionIdInExit = EFalse,
       
    53                                            CIMPSSAPSettings* aSap = NULL );
       
    54 
       
    55 
       
    56         /**
       
    57          * Two-phased constructor.
       
    58          * @see CCAAppSettingsSAPExt::NewL
       
    59          */
       
    60         static CCAAppSettingsSAPExt* NewLC( CIMPSPresenceConnectionUi& aConnUi,
       
    61                                             TBool aPreserveSessionIdInExit = EFalse,
       
    62                                             CIMPSSAPSettings* aSap = NULL );
       
    63 
       
    64         /**
       
    65          * Destructor.
       
    66          */
       
    67         virtual ~CCAAppSettingsSAPExt();
       
    68 
       
    69     public: // New functions
       
    70 
       
    71         /**
       
    72          * Sets int value to SAP settings
       
    73          * @since Series 60 3.0
       
    74          * @param aKey Key for key-value pair in SAP settings
       
    75          * @param aValue Value for key-value pair in SAP settings
       
    76          */
       
    77         void SetIntValueL( const TDesC& aKey, TInt aValue );
       
    78 
       
    79         /**
       
    80          * Gets int value from SAP settings
       
    81          * @since Series 60 3.0
       
    82          * @param aKey Key for key-value pair in SAP settings
       
    83          * @return Value for key
       
    84          */
       
    85         TInt IntValueL( const TDesC& aKey );
       
    86 
       
    87 
       
    88         /**
       
    89          * Sets alert tone file name to SAP settings
       
    90          * @since Series 60 3.0
       
    91          * @param aToneFileName Filename that is stored to SAP settings
       
    92          */
       
    93         void SetToneFileNameL( const TDesC& aToneFileName );
       
    94 
       
    95         /**
       
    96          * Gets alert tone file name from SAP settings
       
    97          * @since Series 60 3.0
       
    98          * @param aToneFileName Filename that is stored to SAP settings
       
    99          */
       
   100         void GetToneFileNameL( TDes& aToneFileName );
       
   101 
       
   102     private: //New functions
       
   103 
       
   104         /**
       
   105          * Gets editable stored SAP
       
   106          */
       
   107         CIMPSSAPSettings* StoredSAPLC();
       
   108 
       
   109         /**
       
   110          * Gets current SAP
       
   111          */
       
   112         CIMPSSAPSettings* CurrentSAPLC();
       
   113 
       
   114     private:
       
   115 
       
   116         /**
       
   117          * C++ default constructor.
       
   118          */
       
   119         CCAAppSettingsSAPExt( CIMPSPresenceConnectionUi& aConnUi,
       
   120                               TBool aPreserveSessionIdInExit );
       
   121 
       
   122         /**
       
   123          * By default Symbian 2nd phase constructor is private.
       
   124          */
       
   125         void ConstructL(  CIMPSSAPSettings* aSap );
       
   126 
       
   127     private:    // Data
       
   128         // Doesnt Own. Connection UI
       
   129         //Removed the ownership of iConnUI from this file and made it a reference
       
   130         //APPUI owns this connection UI instance and shares the same with this component.
       
   131         CIMPSPresenceConnectionUi& iConnUI;
       
   132 
       
   133         // Owns, sapsettingstore interface
       
   134         CIMPSSAPSettingsStore* iSapSettings;
       
   135 
       
   136         // does not own
       
   137         CIMPSSAPSettings* iSap;
       
   138 
       
   139         // ETrue if IMPSCUI Session Id should be preserved upon exit
       
   140         TBool iPreserveSessionIdInExit;
       
   141     };
       
   142 
       
   143 #endif      // CCAAPPSETTINGSSAPEXT_H 
       
   144 
       
   145 // End of File