mmshplugins/mmshsettingsuiplugin/inc/mussipprofilemodel.h
branchRCL_3
changeset 13 a184f3d659e6
parent 2 b31261fd4e04
child 32 73a1feb507fb
equal deleted inserted replaced
11:ff8a573c0e2e 13:a184f3d659e6
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  Class implementing SIP profile model.
    14 * Description:  Class implementing SIP profile model.
    15 *  Version     : %version: 7 % << Don't touch! Updated by Synergy at check-out.
    15 *  Version     : %version: 9 % << Don't touch! Updated by Synergy at check-out.
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 
    19 
    20 
    20 
    23 
    23 
    24 
    24 
    25 #include "mmussipprofilehandler.h"
    25 #include "mmussipprofilehandler.h"
    26 #include <e32base.h>
    26 #include <e32base.h>
    27 #include <sipprofileregistryobserver.h>
    27 #include <sipprofileregistryobserver.h>
    28 
    28 #include <sipobserver.h>
       
    29 #include <sipconnectionobserver.h>
    29 
    30 
    30 class CSIPManagedProfileRegistry;
    31 class CSIPManagedProfileRegistry;
    31 class CMusSettingsModel;
    32 class CMusSettingsModel;
    32 
       
    33 
    33 
    34 /**
    34 /**
    35  *  CMusSIPProfileModel model class.
    35  *  CMusSIPProfileModel model class.
    36  *  Model class implementing SIP profile model.
    36  *  Model class implementing SIP profile model.
    37  */
    37  */
    38 class CMusSIPProfileModel
    38 class CMusSIPProfileModel : public CBase,
    39     :public CBase,
    39                             public MSIPProfileRegistryObserver,
    40      public MSIPProfileRegistryObserver,
    40                             public MMusSIPProfileHandler
    41 	 public MMusSIPProfileHandler
    41 {
    42 	 {
       
    43 public:
    42 public:
    44 
    43 
    45     static CMusSIPProfileModel* NewL();
    44     static CMusSIPProfileModel* NewL();
    46 
    45 
    47     /**
    46     /**
    53 
    52 
    54     /**
    53     /**
    55      * From MMusSIPProfileHandler.
    54      * From MMusSIPProfileHandler.
    56      * Returns the index of the default SIP profile.
    55      * Returns the index of the default SIP profile.
    57      * @return KErrNotFound, if one does not exist, otherwise index of the
    56      * @return KErrNotFound, if one does not exist, otherwise index of the
    58      *         default SIP profile.
    57      * default SIP profile.
    59      */
    58      */
    60     virtual TInt DefaultProfileIndex();
    59     TInt DefaultProfileIndex();
    61 
    60 
    62     /**
    61     /**
    63      * From MMusSIPProfileHandler.
    62      * From MMusSIPProfileHandler.
    64      * Returns the id of the default SIP profile.
    63      * Returns the id of the default SIP profile.
    65      * @return KErrNotFound, if one does not exist, otherwise id of the
    64      * @return KErrNotFound, if one does not exist, otherwise id of the
    66      *         default SIP profile.
    65      * default SIP profile.
    67      */
    66      */
    68 	virtual TUint32 DefaultProfileId();
    67     TUint32 DefaultProfileId();
    69 	
    68 	
       
    69     /*
       
    70      * Disables MUS profile
       
    71      */
       
    72     void DisableProfileL();
    70 	
    73 	
    71 	/*
    74     /*
    72 	 * 
    75      * Enables MUS profile
    73 	 * 
    76      */
    74 	 */
    77     void EnableProfileL();
    75 	virtual void DisableProfileL();
       
    76 	
    78 	
    77 	/*
    79     /*
    78      * 
    80      * Checks, if MUS profile is enabled
    79      * 
       
    80      */
    81      */
    81 	virtual void EnableProfileL();
    82     TBool ProfileEnabledL();
    82 	
       
    83 	/*
       
    84      * 
       
    85      * 
       
    86      */
       
    87 	virtual TBool ProfileEnabledL();
       
    88 
    83 
    89     /**
    84     /**
    90      * From MMusSIPProfileHandler.
    85      * From MMusSIPProfileHandler.
    91      * Returns SIP profile index on locally cached array based on id.
    86      * Returns SIP profile index on locally cached array based on id.
    92      * @param aId Profile id
    87      * @param aId Profile id
    93      * @return Profile index or KErrNotFound if no matching profile is found.
    88      * @return Profile index or KErrNotFound if no matching profile is found.
    94      */
    89      */
    95     virtual TInt ProfileIndexByIdL( TUint32 aId );
    90     TInt ProfileIndexByIdL( TUint32 aId );
    96 
    91 
    97     /**
    92     /**
    98      * From MMusSIPProfileHandler.
    93      * From MMusSIPProfileHandler.
    99      * Returns profile id based on index.
    94      * Returns profile id based on index.
   100      * @param aIndex Profile index
    95      * @param aIndex Profile index
   101      * @return Profile id or KUnknownProfileId if no matching profile is found.
    96      * @return Profile id or KUnknownProfileId if no matching profile is found.
   102      */
    97      */
   103     virtual TUint32 ProfileIdByIndex( TUint aIndex );
    98     TUint32 ProfileIdByIndex( TUint aIndex );
   104 
    99 
   105     /**
   100     /**
   106      * From MMusSIPProfileHandler.
   101      * From MMusSIPProfileHandler.
   107      * Returns a reference to the SIP profile array.
   102      * Returns a reference to the SIP profile array.
   108      * Note that previously returned value goes out of scope after a new
   103      * Note that previously returned value goes out of scope after a new
   110      * in long persistent variable, but rather to be used like stack
   105      * in long persistent variable, but rather to be used like stack
   111      * variables for safety.
   106      * variables for safety.
   112      *
   107      *
   113      * @return Reference to internally cached SIP profile array.
   108      * @return Reference to internally cached SIP profile array.
   114      */
   109      */
   115     virtual RPointerArray<CSIPProfile>& ProfileArrayL();
   110     RPointerArray<CSIPProfile>& ProfileArrayL();
   116 
   111 
   117 public: // From base class MSIPProfileRegistryObserver.
   112 public: // From base class MSIPProfileRegistryObserver.
   118 
   113 
   119     /**
   114     /**
   120      * From MSIPProfileRegistryObserver.
   115      * From MSIPProfileRegistryObserver.
   121      * SIP profile information event.
   116      * SIP profile information event.
   122      * @param aProfileId Id of SIP profile in question.
   117      * @param aProfileId Id of SIP profile in question.
   123      * @param aEvent Type of information event.
   118      * @param aEvent Type of information event.
   124 	 */
   119      */
   125 	virtual void ProfileRegistryEventOccurred(
   120     void ProfileRegistryEventOccurred(
   126 	    TUint32 aSIPProfileId,
   121 	    TUint32 aSIPProfileId,
   127 	    TEvent aEvent );
   122 	    TEvent aEvent );
   128 
   123 
   129 	/**
   124     /**
   130      * From MSIPProfileRegistryObserver.
   125     * From MSIPProfileRegistryObserver.
   131 	 * An asynchronous error has occurred related to SIP profile.
   126     * An asynchronous error has occurred related to SIP profile.
   132      * @param aSIPProfileId Id of the failed profile.
   127     * @param aSIPProfileId Id of the failed profile.
   133 	 * @param aError An error code.
   128     * @param aError An error code.
   134 	 */
   129     */
   135 	virtual void ProfileRegistryErrorOccurred(
   130     void ProfileRegistryErrorOccurred(
   136 	    TUint32 aSIPProfileId,
   131         TUint32 aSIPProfileId,
   137 	    TInt aError );
   132         TInt aError );
   138 	
   133 
   139 	
   134 
   140 	
   135 public:
       
   136     
   141     /**
   137     /**
   142      * Set CMusSettingsModel to handle ProfileRegistry Event.
   138      * Set CMusSettingsModel to handle ProfileRegistry Event.
   143      * @param aCMusSettingsModel the CMusSettingsModel to handle ProfileRegistry Event
   139      * @param aCMusSettingsModel the CMusSettingsModel to handle ProfileRegistry Event
   144      */		
   140      */		
   145 	void SetCMusSettingsModel(CMusSettingsModel* aCMusSettingsModel);
   141     void SetCMusSettingsModel(CMusSettingsModel* aCMusSettingsModel);
   146 
   142 
   147 protected:
   143 protected:
   148 
   144 
   149     /**
   145     /**
   150      * Sorts internal array of SIP profiles by id.
   146      * Sorts internal array of SIP profiles by id.
   160     
   156     
   161 
   157 
   162 private: // data
   158 private: // data
   163 
   159 
   164     /**
   160     /**
   165      * Instance of the SIP profile registry engine for managing SIP profiles.
   161     * Instance of the SIP profile registry engine for managing SIP profiles.
   166      * Own.
   162     * Own.
   167      */
   163     */
   168     CSIPManagedProfileRegistry* iEngine;
   164     CSIPManagedProfileRegistry* iEngine;
   169 
   165 
   170     /**
   166     /**
   171      * Locally cached array of SIP profiles.
   167     * Locally cached array of SIP profiles.
   172      */
   168     */
   173     RPointerArray<CSIPProfile> iProfiles;
   169     RPointerArray<CSIPProfile> iProfiles;
   174     
   170     
   175     /**
   171     /**
   176       * CMusSettingsModel to handle ProfileRegistry 
   172     * CMusSettingsModel to handle ProfileRegistry 
   177       * Event
   173     * Event
   178       */
   174     */
   179     CMusSettingsModel* iCMusSettingsModel;
   175     CMusSettingsModel* iCMusSettingsModel;
       
   176     
       
   177     
   180 
   178 
   181     };
   179     };
   182 
   180 
   183 #endif // C_MUSSIPPROFILEMODEL_H
   181 #endif // C_MUSSIPPROFILEMODEL_H