1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/app/cmmsaccounts.h Wed Mar 31 12:27:01 2010 +0100
1.3 @@ -0,0 +1,127 @@
1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __CMMSACCOUNT_H__
1.20 +#define __CMMSACCOUNT_H__
1.21 +
1.22 +
1.23 +#include <e32base.h>
1.24 +
1.25 +class CRepository;
1.26 +class CMmsSettings;
1.27 +class TMmsAccountId;
1.28 +class MMmsSettingsObserver;
1.29 +
1.30 +
1.31 +/**
1.32 +The maximum account name size
1.33 +
1.34 +@publishedAll
1.35 +@released
1.36 +*/
1.37 +const TInt KMmsAccountNameSize = 256;
1.38 +
1.39 +
1.40 +
1.41 +/**
1.42 +MMS account ID
1.43 +
1.44 +@publishedAll
1.45 +@released
1.46 +*/
1.47 +class TMmsAccountId
1.48 + {
1.49 +public:
1.50 + /** MMS account Id */
1.51 + TInt iMmsAccountId;
1.52 +
1.53 + /** MMS account Name */
1.54 + TBuf<KMmsAccountNameSize> iMmsAccountName;
1.55 + };
1.56 +
1.57 +
1.58 +/**
1.59 +Stores MMS settings.
1.60 +
1.61 +@publishedAll
1.62 +@released
1.63 +*/
1.64 +class CMmsAccounts : public CActive
1.65 + {
1.66 +public:
1.67 + IMPORT_C static CMmsAccounts* NewL( );
1.68 + IMPORT_C static CMmsAccounts* NewLC( );
1.69 + IMPORT_C virtual ~CMmsAccounts();
1.70 +
1.71 + // Observer functions
1.72 + IMPORT_C void AddObserverL(MMmsSettingsObserver & aObserver);
1.73 + IMPORT_C void RemoveObserver(MMmsSettingsObserver & aObserver);
1.74 +
1.75 + IMPORT_C TMmsAccountId CreateMMSAccountL(const TDesC& aAccountName, const CMmsSettings& aSettings);
1.76 + IMPORT_C TInt MaxMMSAccounts();
1.77 +
1.78 + IMPORT_C void GetMMSAccountsL(RArray<TMmsAccountId>& aAccountIds) const;
1.79 + IMPORT_C void DeleteMMSAccountL(const TMmsAccountId& aAccountId);
1.80 +
1.81 + IMPORT_C void LoadSettingsL(const TMmsAccountId& aAccountId, CMmsSettings& aSettings);
1.82 + IMPORT_C void PopulateDefaultSettingsL(CMmsSettings& aSettings);
1.83 +
1.84 + IMPORT_C void SaveSettingsL(const TMmsAccountId& aAccountId, const CMmsSettings& aSettings) const;
1.85 +
1.86 + IMPORT_C TMmsAccountId DefaultMMSAccountL( ) const;
1.87 + IMPORT_C void SetDefaultMMSAccountL(const TMmsAccountId& aAccount);
1.88 +
1.89 +private:
1.90 + CMmsAccounts();
1.91 + void ConstructL();
1.92 + void DoLoadSettingsL(TUint32 aAccountId, CMmsSettings& aSettings);
1.93 + void DoSaveSettingsL(TUint32 aAccountId, const CMmsSettings& aSettings, const TDesC& aAccountName) const;
1.94 +
1.95 + void DoCancel( );
1.96 + void RunL( );
1.97 +
1.98 + TUint GetNextEmptyAccountSlotL();
1.99 +
1.100 +private:
1.101 + enum TMmsSettingsCenRepId
1.102 + {
1.103 + EMmsAccountName = 0x00000000,
1.104 + EMmsSettingsVersion = 0x00000001,
1.105 + EMmsApplicationID = 0x00000002,
1.106 + EMmsAddress = 0x00000003,
1.107 + EMmsCreationMode = 0x00000004,
1.108 + EMmsSettingsFlags = 0x00000005,
1.109 + EMmsProxyCount = 0x00000006,
1.110 + EMmsNapIdCount = 0x00000007,
1.111 + EMmsAutomaticDownload = 0x00000008,
1.112 + EMmsValidityPeriod = 0x00000009,
1.113 + EMmsMaxDownloadSize = 0x0000000A,
1.114 + EMmsMaxDownloadRetries = 0x0000000B,
1.115 + EMmsDownloadRetryInterval = 0x0000000C,
1.116 + EMmsMaxSendMsgSize = 0x0000000D,
1.117 + EMmsDeviceContentClass = 0x0000000E,
1.118 + EMmsMaxImageHeight = 0x0000000F,
1.119 + EMmsMaxImageWidth = 0x00000010,
1.120 +
1.121 + EMmsProxyList = 0x00001000,
1.122 + EMmsNapIdList = 0x00002000,
1.123 + };
1.124 +
1.125 +private:
1.126 + CRepository* iRepository;
1.127 + RPointerArray<MMmsSettingsObserver> iObservers;
1.128 + };
1.129 +
1.130 +#endif // __CMMSACCOUNT_H__