messagingappbase/smsmtm/clientmtm/inc/csmsaccount.h
changeset 25 84d9eb65b26f
parent 23 238255e8b033
child 27 e4592d119491
child 37 518b245aa84c
child 79 2981cb3aa489
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __CSMSACCOUNT_H__
       
    17 #define __CSMSACCOUNT_H__
       
    18 
       
    19 
       
    20 #include <e32base.h>
       
    21 #include <msvapi.h>
       
    22 
       
    23 
       
    24 class CSmsSettings;
       
    25 class CMsvOffPeakTimes;
       
    26 class CMsvScheduleSettings;
       
    27 class CMsvSendErrorActions;
       
    28 class CMsvSysAgentActions;
       
    29 class CRepository;
       
    30 
       
    31 
       
    32 /**
       
    33 Stores SMS service and Schedule Send settings to Central Repository. 
       
    34 
       
    35 @publishedAll
       
    36 @released
       
    37 */
       
    38 NONSHARABLE_CLASS (CSmsAccount) : public CBase, public MMsvSessionObserver
       
    39 	{
       
    40 public:
       
    41 
       
    42 	IMPORT_C static CSmsAccount* NewL();
       
    43 	IMPORT_C static CSmsAccount* NewLC();
       
    44 	IMPORT_C virtual ~CSmsAccount();
       
    45 
       
    46 	IMPORT_C void InitialiseDefaultSettingsL(CSmsSettings& aSmsSettings);
       
    47 	IMPORT_C void InitialiseDefaultSettingsL(CMsvScheduleSettings& aScheduleSettings, CMsvOffPeakTimes& aOffPeakTimes, CMsvSendErrorActions& aErrorActions, CMsvSysAgentActions& aSysAgentActions);
       
    48 	IMPORT_C void LoadSettingsL(CSmsSettings& aSmsSettings);
       
    49 	IMPORT_C void LoadSettingsL(CMsvScheduleSettings& aScheduleSettings, CMsvOffPeakTimes& aOffPeakTimes, CMsvSendErrorActions& aErrorActions, CMsvSysAgentActions& aSysAgentActions);
       
    50     IMPORT_C void SaveSettingsL(const CSmsSettings& aSmsSettings) const;
       
    51 	IMPORT_C void SaveSettingsL(const CMsvScheduleSettings& aScheduleSettings, const CMsvOffPeakTimes& aOffPeakTimes, const CMsvSendErrorActions& aErrorActions, const CMsvSysAgentActions& aSysAgentActions) const;
       
    52 
       
    53 private:
       
    54 	CSmsAccount();
       
    55 	void ConstructL();
       
    56 	void HandleSessionEventL(TMsvSessionEvent , TAny* , TAny* , TAny* );
       
    57 	CMsvSession& SessionL();	
       
    58 	
       
    59 	TMsvId CreateSmsServiceL();
       
    60 	void ResetSettings();
       
    61 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
       
    62 	void CreateHeaderStoreL();
       
    63 #endif
       
    64 private:
       
    65 	enum TSmsSettingsCenRepId
       
    66 		{
       
    67 		// Service Settings		
       
    68 		ESmsServiceId					= 0x00000000,
       
    69 		ESmsSettingsVersionId			= 0x00000001,
       
    70 		ESmsSettingsMesssageVersionId	= 0x00000002,
       
    71 		ESmsValidityPeriodId			= 0x00000003,
       
    72 		ESmsValidityPeriodFormatId	   	= 0x00000004,     	
       
    73 		ESmsAlphabetId					= 0x00000005,
       
    74 		ESmsMsgFlagsId					= 0x00000006,
       
    75 		ESmsMessageConversionId			= 0x00000007,
       
    76 		ESmsFlagsId						= 0x00000008,
       
    77 		ESmsStatusReportHandlingId		= 0x00000009,
       
    78 		ESmsSpecialMessageHandlingId	= 0x0000000A,
       
    79 		ESmsCommDbActionId				= 0x0000000B,
       
    80 		ESmsDeliveryId					= 0x0000000C,
       
    81 		ESmsDefaultSCId					= 0x0000000D,
       
    82 		ESmsSCAddressesCountId			= 0x0000000E,
       
    83 		ESmsBearerActionId				= 0x0000000F,
       
    84 		ESmsBearerId					= 0x00000010,
       
    85 		ESmsClass2FolderId				= 0x00000020,
       
    86 		ESmsDescriptionLengthId			= 0x00000030,
       
    87 		ESmsAccountNameId				= 0x00000040,
       
    88 		
       
    89 		ESmsSCAddressesPartialId		= 0x00001000,
       
    90 		EMsgSMSTimeStampSettings		= 0x000A0020
       
    91 		};
       
    92 
       
    93 private:
       
    94 	CMsvSession* iMsvSession;
       
    95 	CRepository* iRepository;
       
    96 	};
       
    97 
       
    98 #endif // __CSMSACCOUNT_H__