uiservicetabsettings/inc/cvimpstsettingsstore.h
changeset 0 5e5d6b214f4f
equal deleted inserted replaced
-1:000000000000 0:5e5d6b214f4f
       
     1 /*
       
     2 * Copyright (c) 2008 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:  vimpst settings store definitions
       
    15 *
       
    16 */
       
    17 #ifndef __CVIMPSTSETTINGSSTORE_H
       
    18 #define __CVIMPSTSETTINGSSTORE_H
       
    19 
       
    20 #include <e32base.h>
       
    21 
       
    22 /** types of settings provided in meco settings */
       
    23 enum TSettingItemName
       
    24     {
       
    25     ETOUDlgOff = 0x00000000,                      // key value to enable or disable TOU Dialog to be shown 
       
    26                                                     //0-> show TOU(default),1->Disable TOU..
       
    27     EURLRegistrationOff = 0x00000001,             // key value to enable or disable URL registration query
       
    28                                                     //0->URL registration on,1-> URL registration off.
       
    29     EServiceSuccessfullLogin = 0x00000002,
       
    30     EServiceToneFileName = 0x00000003,              // key value to get the IM tone File name.complete path of the file name should be provided. example "C:\sounds\digital\imtone.wav"                        
       
    31     EServiceURLLink = 0x00000004,                    // key value to get the URL link for IM based on service     
       
    32     EServiceAvatar = 0x00000005,                  // key value to get the Own Avatar for IM based on service    
       
    33     EServiceAvatarMimeType = 0x00000006,          // key value to get the Own Avatar s 'mimetype' for IM based on service   
       
    34     EServiceOwnAvatarIconIndex = 0x00000007 ,         // key value to get the Own Icon index for avatar s  
       
    35     // key value to check whether the  "Cancel Login" is supported or not   
       
    36     // if setting "value = 1" then cancel login not supported else supported.
       
    37     // if cancel is supported , no need to write anything to cenrep.
       
    38     // By default its taken as supported.
       
    39     // if not supported then write explicitly this setting as '1'
       
    40     EServiceCancelLoginNotSupported = 0x00000008,
       
    41     EServiceOwnStatusMessagesOnline = 0x00000009,   // storing 4 previous messages for online
       
    42     EServiceOwnStatusMessagesBusy = 0x0000000A,   // storing 4 previous messages for busy
       
    43     EServiceOwnStatusMessagesAway = 0x0000000B,   // storing 4 previous messages for away
       
    44     // key value to check whether the  "ChangeConnection" is supported or not   
       
    45     // if setting "value = 1" then ChangeConnection not supported else supported.
       
    46     // if ChangeConnection is supported , no need to write anything to cenrep.
       
    47     // By default its taken as supported.
       
    48     // if not supported then write explicitly this setting as '1'
       
    49     EServiceChangeConnectionNotSupported = 0x0000000C,
       
    50     // Presence Info used to republish own presence status in case of network lost and recovered
       
    51     EServicePresenceAvailablilityValue = 0x0000000D,              //Presence Availablility Info
       
    52     EServicePresenceSessionIdentifier = 0x0000000E,               //Presence Session Identifier
       
    53     EServiceCustomStatusMessage = 0x0000000F,											//Presence Custom Status Message
       
    54     EServiceLastUserName = 0x00000010															// set username in cenrep.
       
    55     };                                                      
       
    56 
       
    57 
       
    58 
       
    59 //CLASS  DECLARATION
       
    60 /**  
       
    61  *  M-Class for meco settingstore API's 
       
    62  *  @lib vimpstsettingsstore.lib
       
    63  *  @since S60 5.0
       
    64  */
       
    65 class MVIMPSTSettingsStore
       
    66     {        
       
    67     public:     //Interface
       
    68         
       
    69         /**
       
    70          * virtual Destructor.
       
    71          */
       
    72         virtual ~MVIMPSTSettingsStore()
       
    73             {
       
    74             }
       
    75         
       
    76         /**
       
    77         * Peforms Get/Set operation in the cenrep
       
    78         * @param aServiceId, id if the service for which settings are get/set      
       
    79         * @param aSettingItemName, setting item name 
       
    80         * @param aValue, variable to set/get the value
       
    81         * @return TInt, used as error passing value. 
       
    82         */      
       
    83         virtual TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemName, TInt& aValue ) const = 0;
       
    84         virtual TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TInt aValue ) = 0;
       
    85         
       
    86         /**
       
    87          * Peforms Get/Set operation in the cenrep
       
    88          * @param aServiceId, id if the service for which settings are get/set      
       
    89          * @param aSettingItemName, setting item name 
       
    90          * @param aBuffer, variable to set/get the value
       
    91          * @return TInt, used as error passing value.  
       
    92          */  
       
    93         virtual TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, RBuf& aBuffer ) const = 0;
       
    94         virtual TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TDesC& aBuffer ) = 0;
       
    95         
       
    96         /**
       
    97          * Peforms Get/Set operation in the cenrep
       
    98          * @param aServiceId, id if the service for which settings are get/set      
       
    99          * @param aSettingItemName, setting item name 
       
   100          * @param aBuffer, variable to set/get the value
       
   101          * @return TInt, used as error passing value.  
       
   102          */  
       
   103         virtual TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, RBuf8& aBuffer ) const = 0;
       
   104         virtual TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TDesC8& aBuffer ) = 0;
       
   105         
       
   106     };
       
   107 
       
   108 /**
       
   109  *  vimpst settings API class
       
   110  *
       
   111  *  Main class of managing vimpst settings
       
   112  *
       
   113  *  @code example code of how to get/set a value to the setting item in cenrep 
       
   114  *  MVIMPSTSettingsStore* settings = CVIMPSTUiSettingsStore::NewLC();
       
   115  *  TInt value = 1;
       
   116  *  TInt err = settings->SetL(serviceId, ETOUDlgOff, value );
       
   117  *  similarly for getting the value
       
   118  *  settings->GetL(serviceId, ETOUDlgOff, value);
       
   119  *  delete settings or use clean up stack to push and pop 
       
   120  *  @lib vimpstsettingsstore.lib
       
   121  *  @since S60 v5.0
       
   122  */
       
   123 class CVIMPSTSettingsCenRep;
       
   124 class CVIMPSTSettings;
       
   125 
       
   126 class CVIMPSTSettingsStore   :           public CBase,                                            
       
   127                                          public MVIMPSTSettingsStore
       
   128     {
       
   129     
       
   130     public: // Constructors and destructor
       
   131         /**
       
   132          * Constructors
       
   133 		* Do not use MVIMPSTSettingStore object as parameter while calling PopAndDestroy
       
   134          */
       
   135         IMPORT_C static MVIMPSTSettingsStore* NewLC();
       
   136         /**
       
   137          * Constructors , 
       
   138 		* No not push MVIMPSSettingStore instance on cleanupstack,maily NewL can be used for member variable
       
   139          */
       
   140         IMPORT_C static MVIMPSTSettingsStore* NewL();
       
   141 
       
   142         /**
       
   143          * Destructors.
       
   144          */
       
   145         virtual ~CVIMPSTSettingsStore();
       
   146         
       
   147     private:        
       
   148         
       
   149         /**
       
   150          * Performs the 2nd phase of construction.
       
   151          */
       
   152          void ConstructL();
       
   153         
       
   154     private:        
       
   155         /**
       
   156         * Peforms Get/Set operation in the cenrep
       
   157         * @param aServiceId, id if the service for which settings are get/set      
       
   158         * @param aSettingItemName, setting item name 
       
   159         * @param aValue, variable to set/get the value
       
   160         * @return TInt, used as error passing value. 
       
   161         */      
       
   162         TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemName, TInt& aValue ) const;
       
   163         TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TInt aValue );
       
   164         
       
   165         /**
       
   166          * Peforms Get/Set operation in the cenrep
       
   167          * @param aServiceId, id if the service for which settings are get/set      
       
   168          * @param aSettingItemName, setting item name 
       
   169          * @param aBuffer, variable to set/get the value
       
   170          * @return TInt, used as error passing value.  
       
   171          */  
       
   172         TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, RBuf& aBuffer ) const;
       
   173         TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TDesC& aBuffer ) ;
       
   174         
       
   175         /**
       
   176          * Peforms Get/Set operation in the cenrep
       
   177          * @param aServiceId, id if the service for which settings are get/set      
       
   178          * @param aSettingItemName, setting item name 
       
   179          * @param aBuffer, variable to set/get the value
       
   180          * @return TInt, used as error passing value.  
       
   181          */  
       
   182         TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, RBuf8& aBuffer ) const;
       
   183         TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TDesC8& aBuffer ) ;
       
   184         
       
   185         /**
       
   186          * Peforms comparision operation of userid in the cenrep
       
   187          * @param aServiceId, id off the service for which user name is to be compared with cenrep store user id's      
       
   188          * @param auserId, user name to be compared with cenrep store user id's
       
   189          * @return TBool, if TOU is already shown to user return ETrue else EFalse  
       
   190          */ 
       
   191         TBool IsTOUShownL(TUint32 aServiceId, const TDesC& auserId) ;
       
   192         
       
   193         /**
       
   194          * Peforms Set operation of userid in the cenrep
       
   195          * @param aServiceId, id of the service for which user name is to be stored in cenrep store      
       
   196          * @param auserId, user name to be stored in cenrep store
       
   197          * @return TBool, successful will return ETrue else EFalse  
       
   198          */  
       
   199         TBool SetTOUShownL(TUint32 aServiceId, const TDesC& auserId );
       
   200         
       
   201     private: // helper functions
       
   202         
       
   203         void GetSAPL( TUint32 aServiceId , CVIMPSTSettings* aSettings ); 
       
   204         
       
   205         
       
   206     private:
       
   207         // owns : pointer to cen rep
       
   208         CVIMPSTSettingsCenRep* iCenrepStore;
       
   209         // owns : pointer to settings
       
   210         CVIMPSTSettings* iSettings;
       
   211     };
       
   212 
       
   213 #endif /*__CVIMPSTSETTINGSSTORE_H*/