examples/Messaging/TextMTM/txut/TXUT.H

00001 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 //
00015 
00016 #if !defined (__TXUT_H__)
00017 #define __TXUT_H__
00018 
00019 #if !defined(__BADESCA_H__)
00020 #include <badesca.h>
00021 #endif
00022 #if !defined(__MSVAPI_H__)
00023 #include <msvapi.h>
00024 #endif
00025 
00026 
00027 
00028 // TextMTM UIDs
00029 LOCAL_D const TInt KUidMsgTypeTextValue = 0x10005247;
00030 LOCAL_D const TUid KUidMsgTypeText = { KUidMsgTypeTextValue};
00031 LOCAL_D const TUid theTechnologyTypeUid = { KUidMsgTypeTextValue};
00032 
00033 LOCAL_D const TUid KUidMsvMtmTextServerDLL      ={0xE800005F};
00034 LOCAL_D const TUid KUidMsvMtmTextClientDLL      ={0xE800005D};
00035 LOCAL_D const TUid KUidMsvMtmTextUiDLL          ={0xE8000060};
00036 LOCAL_D const TUid KUidMsvMtmTextUiDataDLL      ={0x10003C61};
00037 LOCAL_D const TUid KUidTextMtmVersion1          ={ KUidMsgTypeTextValue};
00038 
00039 // Constants
00040 LOCAL_D const TInt KUidTxtMTMSettingsValue = 0x1000525A;
00041 LOCAL_D const TUid KUidTxtMTMSettings={KUidTxtMTMSettingsValue};
00042 LOCAL_D const TInt KMaxTextMessageSize = 0xFFFF;
00043 
00044 
00045 //
00046 //      TTxtProgress: Operation progress information
00047 //
00048 
00049 class TTxtProgress
00050         {
00051 public:
00052         TInt            iTotalMsgs;
00053         TInt            iMsgsProcessed;
00054         TInt            iErrorCode; // client side needs to be informed of an error
00055         TMsvId          iNewId; // Used with CreateL, or any copy/move, storing the last moved message id.
00056         };
00057 
00058 typedef TPckgBuf<TTxtProgress> TTxtProgressBuf;
00059 
00060 //
00061 // TxtUtils: Generic static utility functions
00062 //
00063 
00064 class TxtUtils
00065         {
00066 public:
00067         // Build file name for associated entry, given its entry.
00068         IMPORT_C static void GetEntryFileNameL(TFileName& aFileName, TMsvEntry& aEntry);
00069         };
00070 
00071 //
00072 // TMTMTxtSettings: contains the settings for a service.
00073 // In pre 9.0 releases, settings are stored in the CMsvStore
00074 // associated with the service entry.
00075 //
00076 // From 9.0, the CMTMTxtSettings class should be used to
00077 // store/load settings into the central repository.
00078 
00079 class CMsvStore;
00080 class TMTMTxtSettings
00081         {
00082 public:
00083         TFileName RootFolder() const;
00084         void SetRootFolder(const TDesC& aRootFolder);
00085 private:
00086         TFileName iRootFolder;
00087         };
00088 
00089 inline void TMTMTxtSettings::SetRootFolder(const TDesC& aRootFolder)
00090         {
00091         iRootFolder = aRootFolder;
00092         }
00093 
00094 inline TFileName TMTMTxtSettings::RootFolder() const
00095         {
00096         return iRootFolder;
00097         }
00098 
00099 class CRepository;
00100 
00105 class CMTMTxtSettings: public CBase
00106         {
00107 public:
00108         IMPORT_C static CMTMTxtSettings* NewL();
00109         ~CMTMTxtSettings();
00110         // load, save, and delete text mtm settings
00111         IMPORT_C void LoadSettingsL(TMsvId aServiceId, TMTMTxtSettings& aSettings) const;
00112         IMPORT_C void SaveSettingsL(TMsvId aServiceId, const TMTMTxtSettings& aSettings);
00113         IMPORT_C void DeleteSettingsL(TMsvId aServiceId);
00114         // handle a setting that specifies what the default service is
00115         IMPORT_C TMsvId DefaultServiceL() const;
00116         IMPORT_C void SetDefaultServiceL(TMsvId aService);
00117         IMPORT_C void DeleteDefaultServiceSettingL();
00118 
00119 private:
00120         void ConstructL();
00121         void CreateOrSetL(TUint aKey, const TDesC& aValue);
00122         void CreateOrSetL(TUint aKey, TInt aValue);
00123         TUint32 FindAccountL(TMsvId aService) const;
00124         TUint GetNextAccountSlotL();
00125         void DeleteSettingL(TUint32 settingId);
00126 
00127 private:
00128         CRepository* iRepository;
00129         };
00130 
00131 #endif

Generated on Thu Jan 21 10:32:59 2010 for TB10.1 Example Applications by  doxygen 1.5.3