diff -r 73a1feb507fb -r bc78a40cd63c mmshplugins/mmshsettingsuiplugin/inc/mussipprofilemodel.h --- a/mmshplugins/mmshsettingsuiplugin/inc/mussipprofilemodel.h Tue Aug 31 15:12:07 2010 +0300 +++ b/mmshplugins/mmshsettingsuiplugin/inc/mussipprofilemodel.h Wed Sep 01 12:31:01 2010 +0100 @@ -12,6 +12,7 @@ * Contributors: * * Description: Class implementing SIP profile model. +* Version : %version: 9 % << Don't touch! Updated by Synergy at check-out. * */ @@ -23,25 +24,21 @@ #include "mmussipprofilehandler.h" #include -#include -#include #include - +#include +#include class CSIPManagedProfileRegistry; - +class CMusSettingsModel; /** * CMusSIPProfileModel model class. * Model class implementing SIP profile model. - * - * @since S60 v3.2 */ -class CMusSIPProfileModel - :public CBase, - public MSIPProfileRegistryObserver, - public MMusSIPProfileHandler - { +class CMusSIPProfileModel : public CBase, + public MSIPProfileRegistryObserver, + public MMusSIPProfileHandler +{ public: static CMusSIPProfileModel* NewL(); @@ -57,17 +54,32 @@ * From MMusSIPProfileHandler. * Returns the index of the default SIP profile. * @return KErrNotFound, if one does not exist, otherwise index of the - * default SIP profile. + * default SIP profile. */ - virtual TInt DefaultProfileIndex(); + TInt DefaultProfileIndex(); /** * From MMusSIPProfileHandler. * Returns the id of the default SIP profile. * @return KErrNotFound, if one does not exist, otherwise id of the - * default SIP profile. + * default SIP profile. + */ + TUint32 DefaultProfileId(); + + /* + * Disables MUS profile */ - virtual TUint32 DefaultProfileId(); + void DisableProfileL(); + + /* + * Enables MUS profile + */ + void EnableProfileL(); + + /* + * Checks, if MUS profile is enabled + */ + TBool ProfileEnabledL(); /** * From MMusSIPProfileHandler. @@ -75,7 +87,7 @@ * @param aId Profile id * @return Profile index or KErrNotFound if no matching profile is found. */ - virtual TInt ProfileIndexByIdL( TUint32 aId ); + TInt ProfileIndexByIdL( TUint32 aId ); /** * From MMusSIPProfileHandler. @@ -83,19 +95,19 @@ * @param aIndex Profile index * @return Profile id or KUnknownProfileId if no matching profile is found. */ - virtual TUint32 ProfileIdByIndex( TUint aIndex ); + TUint32 ProfileIdByIndex( TUint aIndex ); /** * From MMusSIPProfileHandler. - * Returns pointer to the SIP profile array, does not change ownership. + * Returns a reference to the SIP profile array. * Note that previously returned value goes out of scope after a new * call to ProfileArrayL. So it is not advised to store return value * in long persistent variable, but rather to be used like stack * variables for safety. * - * @return Pointer to internally cached SIP profile array. + * @return Reference to internally cached SIP profile array. */ - virtual CArrayPtr* ProfileArrayL(); + RPointerArray& ProfileArrayL(); public: // From base class MSIPProfileRegistryObserver. @@ -104,68 +116,65 @@ * SIP profile information event. * @param aProfileId Id of SIP profile in question. * @param aEvent Type of information event. - */ - virtual void ProfileRegistryEventOccurred( + */ + void ProfileRegistryEventOccurred( TUint32 aSIPProfileId, TEvent aEvent ); - /** - * From MSIPProfileRegistryObserver. - * An asynchronous error has occurred related to SIP profile. - * @param aSIPProfileId Id of the failed profile. - * @param aError An error code. - */ - virtual void ProfileRegistryErrorOccurred( - TUint32 aSIPProfileId, - TInt aError ); + /** + * From MSIPProfileRegistryObserver. + * An asynchronous error has occurred related to SIP profile. + * @param aSIPProfileId Id of the failed profile. + * @param aError An error code. + */ + void ProfileRegistryErrorOccurred( + TUint32 aSIPProfileId, + TInt aError ); + + +public: + + /** + * Set CMusSettingsModel to handle ProfileRegistry Event. + * @param aCMusSettingsModel the CMusSettingsModel to handle ProfileRegistry Event + */ + void SetCMusSettingsModel(CMusSettingsModel* aCMusSettingsModel); protected: /** - * Reads the profile array from SIP Profile Client. - */ - void ReadArrayFromEngineL(); - - /** * Sorts internal array of SIP profiles by id. */ void SortProfilesL(); - /** - * Deletes internally cached profiles. - */ - void DeleteProfiles(); - - /** - * Reads profile list from the engine; if reading fails, - * keeps the old list safe. - */ - void ReadProfileListFromEngineSafeL(); private: CMusSIPProfileModel(); void ConstructL(); - - /** - * For deleting RPointerArray in case of leave. - */ - static void ResetAndDestroy( TAny* aPointerArray ); + private: // data /** - * Instance of the SIP profile registry engine for managing SIP profiles. - * Own. - */ + * Instance of the SIP profile registry engine for managing SIP profiles. + * Own. + */ CSIPManagedProfileRegistry* iEngine; /** - * Locally cached array of SIP profiles. - * Own. - */ - CArrayPtrFlat* iProfiles; + * Locally cached array of SIP profiles. + */ + RPointerArray iProfiles; + + /** + * CMusSettingsModel to handle ProfileRegistry + * Event + */ + CMusSettingsModel* iCMusSettingsModel; + + };