diff -r 2bb96f4ecad8 -r 8e7494275d3a omads/omadsextensions/adapters/agenda/inc/nsmlagendadatastore.h --- a/omads/omadsextensions/adapters/agenda/inc/nsmlagendadatastore.h Thu Aug 19 09:41:17 2010 +0300 +++ b/omads/omadsextensions/adapters/agenda/inc/nsmlagendadatastore.h Tue Aug 31 15:05:37 2010 +0300 @@ -21,6 +21,10 @@ // INCLUDES +#include "nsmlconstants.h" +#include "nsmlchangefinder.h" +#include "NSmlDataModBase.h" +#include "nsmlagendadefines.hrh" #include #include #include @@ -32,13 +36,9 @@ #include #include #include +#include #include #include -#include -#include "nsmlconstants.h" -#include "nsmlchangefinder.h" -#include "NSmlDataModBase.h" -#include "nsmlagendadefines.hrh" // CONSTANTS const TInt KNSmlAgendaCompressLimit = 20; @@ -49,36 +49,15 @@ const TInt KNSmlCompactAfterChanges = 30; const TInt KNSmlDefaultStoreNameMaxSize = 256; const TInt KNSmlItemDataExpandSize = 1024; -const TInt KDbPersonal = 100000; -const TUid KRepositoryId = { 0x2000CF7E }; -const TInt KNsmlDsOrphanEvent = 0xB ; -const TUint KNSmlAgendaAdapterUid = 0x101F6DDD; -const TUint KNSmlAgendaAdapterStreamUid = 0x101F6DDD+0x10009d8d; _LIT( KNSmlDriveC, "C" ); -_LIT( KNSmlAgendaStoreNameForDefaultDB, "Calendar" ); -_LIT( KNSmlAgendaFileNameForDefaultDB, "c:calendar" ); +_LIT( KNSmlAgendaStoreNameForDefaultDB, "C:Calendar" ); +_LIT8( KNSmlMRUtilitiesEComPlugInUID, "AgnEntryUi" ); _LIT8( KNSmlVersitTokenRecurrenceID, "RECURRENCE-ID"); _LIT8( KNSmlVersitTokenXRecurrenceID, "X-RECURRENCE-ID"); _LIT8(KNSmlVersitTokenGeoID,"GEO"); -//RD_MULTICAL -// MIME content type for folder item -_LIT8( KNSmlContentTypeFolder, "application/vnd.omads-folder+xml" ); -// Email folder item type version -_LIT8( KNSmlContentTypeFolderVersion, "1.2" ); -_LIT8( KNSmlDefaultOpaqueData, "Default" ); - -const TInt KArrayGranularity = 30; -const TInt KBuffLength = 128; // DATA TYPES -enum TNSmlDataMimeType - { - ENSmlNone = 0, - ENSmlCalendar, - ENSmlFolder - }; -//RD_MULTICAL enum TNSmlDataStoreStatus { ENSmlClosed = 0, @@ -94,8 +73,6 @@ ENSmlICal, ENSmlNotSet }; -// FORWARD CLASS DECLARATIONS -class CNSmlAgendaAdapterLog; // CLASS DECLARATIONS // ---------------------------------------------------------------------------- @@ -198,20 +175,6 @@ */ const TDesC& DoGetDefaultFileNameL() const; - /** - * Providing DataStore access to CNSmlDataProvider Class - */ - CSmlDataStoreFormat* StoreFormatL(); - - /** - * Check existance of CalFile with the given ProfileID associativity - */ - TBool IsCalFileAvailableL( TInt aProfileId, CDesCArray* aCalFileArr ); - - /** - * Create CalFile with the attributes provided - */ - HBufC* CreateCalFileL( HBufC* aProfileName, TInt aProfileId ); private: /** @@ -511,21 +474,12 @@ /** * Completes an item operation started in DoCreateItemL(). */ - void DoCommitCreateCalItemL(); + void DoCommitCreateItemL(); /** * Completes an item operation started in DoReplaceItemL(). */ - void DoCommitReplaceCalItemL(); - /** - * Completes an Folder item operation started in DoCreateItemL(). - */ - void DoCommitCreateFolderItemL(); - - /** - * Completes an Folder item operation started in DoReplaceItemL(). - */ - void DoCommitReplaceFolderItemL(); + void DoCommitReplaceItemL(); /** * Gets property from old item. @@ -545,51 +499,7 @@ */ void SetPropertiesToDataL( HBufC8*& aValue, const TDesC8& aProperty ); - - /** - * Method to determine the MIME type, provided the UID - */ - void DataMimeType( TSmlDbItemUid aUid ); - - /** - * Get All the AdapterHandler instance - */ - void ListAllAgendaPluginAdaptersL(); - - /** - * Get the AdapterHandler instance - */ - void AgendaAdapterHandlerL(); - - /** - * Retrieve the CalendarFile and associated entries ID - */ - void SynchronizableCalEntryIdsL( RArray& aUidArray ); - - /** - * Method to retrieve the Id of the Calendar Entry - */ - void GetCalendarEntryIdL( TCalLocalUid& aParentId, TCalLocalUid& aCalId ) const; - /** - * Open the Store if present else create one to work upon - */ - void OpenStoreL(); - - /** - * Filters out the non-active items from the given array - */ - CNSmlDataItemUidSet* ActiveItemsL( CNSmlDataItemUidSet& aUids ) const; - - /** - * Populate iCommittedUidArr from the Stream - */ - void ExternalizeCommittedUidL() const; - - /** - * Write the contents of iCommittedUidArr to the Stream - */ - void InternalizeCommittedUidL() const; private: // Data // Key @@ -624,10 +534,8 @@ TInt iServerMaxObjectSize; // Name of the opened database HBufC* iOpenedStoreName; - // Name of the received storename - HBufC* iReceivedStoreName; // Default name of the database - HBufC* iDefaultStoreFileName; + HBufC* iDefaultStoreName; // Opened database ID TInt64 iOpenedStoreId; // Item's ID that is to be added @@ -648,113 +556,26 @@ CNSmlDataItemUidSet* iReplacedUids; // Uids of moved items CNSmlDataItemUidSet* iMovedUids; - /*// Session to calendar server + // Session to calendar server CCalSession* iVCalSession; // Internal progress notifier - CNSmlAgendaProgressview* iAgendaProgressview;*/ + CNSmlAgendaProgressview* iAgendaProgressview; // Interim Utility CCalenInterimUtils2* iInterimUtils; - /*// Importer + // Importer CCalenImporter* iImporter; // Exporter CCalenExporter* iExporter; + //Instance View + CCalInstanceView* iInstanceView; + // Entry view CCalEntryView* iEntryView; - CVersitTlsData *iVersitTlsData; // for better performance*/ - // Flag is Hierarchical Sync is supported - TBool iIsHierarchicalSyncSupported; - // Mime Type of Calendar Item - TNSmlDataMimeType iDataMimeType; - // Parent Id of the Calendar Item - TInt iParentItemId; - // Offset value - TUint iCalOffsetVal; - // Offset memory values of the Calendar DB - CArrayFixFlat* iCalOffsetArr; - // List of committed UIDs - CNSmlDataItemUidSet* iCommittedUidArr; - // Agenda Adapter Handler Instance - RPointerArray iAgendaPluginAdapters; - // Agenda Adapter Handler Instance - CNSmlAgendaAdapterHandler* iAgendaAdapterHandler; - // SyncRelationship instance - CNSmlAgendaAdapterLog* iAgendaAdapterLog; - // Flag indicating a Orphan Event - TBool iOrphanEvent; + CVersitTlsData *iVersitTlsData; // for better performance }; -// ---------------------------------------------------------------------------- -// CNSmlAgendaDataStoreUtil provides services to cope with maintaining calendar -// API's used for database access -// @lib nsmlagendadataprovider.dll -// ---------------------------------------------------------------------------- -NONSHARABLE_CLASS(CNSmlAgendaDataStoreUtil) : public CBase - { - public: - /** - * Two-phased constructor. - */ - static CNSmlAgendaDataStoreUtil* NewL(); - - /** - * Destructor. - */ - virtual ~CNSmlAgendaDataStoreUtil(); - - private: - /** - * C++ default constructor. - */ - CNSmlAgendaDataStoreUtil(); - - public: // New Functions - /** - * Initialize Calendar APIs for database access using the provided name and id - */ - void InitializeCalAPIsL( HBufC* aFileName, TSmlDbItemUid aUid = NULL ); - - - public: // Data - CCalSession* iCalSession; - CCalenExporter* iExporter; - CCalenImporter* iImporter; - CNSmlAgendaProgressview* iProgressView; - CCalEntryView* iEntryView; - CCalEntry* iEntry; - HBufC8* iFileName; - TSmlDbItemUid iUid; - }; - -// ---------------------------------------------------------------------------- -// CNSmlAgendaAdapterLog provides services know active Sync -// API's used for database access -// @lib nsmlagendadataprovider.dll -// ---------------------------------------------------------------------------- -NONSHARABLE_CLASS(CNSmlAgendaAdapterLog) : public CBase - { - public: - /** - * Two-phased constructor. - */ - static CNSmlAgendaAdapterLog* NewL( MSmlSyncRelationship& aSyncRelationship ); - - /** - * Destructor. - */ - virtual ~CNSmlAgendaAdapterLog(); - - private: - /** - * C++ default constructor. - */ - CNSmlAgendaAdapterLog( MSmlSyncRelationship& aSyncRelationship ); - - public: // Data - MSmlSyncRelationship& iSyncRelationship; - - }; #endif // __NSMLAGENDADATASTORE_H__ // End of File