omads/omadsextensions/adapters/agenda/inc/nsmlagendadataprovider.h
changeset 0 dab8a81a92de
child 1 95fdac6ccb5c
equal deleted inserted replaced
-1:000000000000 0:dab8a81a92de
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  DS agenda data provider
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __NSMLAGENDADATAPROVIDER_H__
       
    20 #define __NSMLAGENDADATAPROVIDER_H__
       
    21 
       
    22 //  INCLUDES
       
    23 #include "nsmlagendadatastore.h"
       
    24 #include <SmlDataFormat.h>
       
    25 
       
    26 // CONSTANTS
       
    27 _LIT( KNSmlDSAgendaDataStoreRsc_1_1_2,"z:NSMLAGENDADATASTORE_1_1_2.RSC" );
       
    28 _LIT( KNSmlDSAgendaDataStoreRsc_1_2,"z:NSMLAGENDADATASTORE_1_2.RSC" );
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 // ------------------------------------------------------------------------------------------------
       
    33 // CNSmlAgendaDataProvider provides basic interface for syncronization
       
    34 // partner to be able to access CNSmlAgendaDataStore instance.
       
    35 //
       
    36 // @lib nsmlagendadataprovider.dll
       
    37 // ------------------------------------------------------------------------------------------------
       
    38 class CNSmlAgendaDataProvider : public CSmlDataProvider
       
    39 	{
       
    40     public:
       
    41 
       
    42         /**
       
    43         * Two-phased constructor.
       
    44         */
       
    45 	    static CNSmlAgendaDataProvider* NewL();
       
    46 
       
    47         /**
       
    48         * Destructor.
       
    49         */
       
    50 	    virtual ~CNSmlAgendaDataProvider();
       
    51 
       
    52     private:
       
    53 
       
    54         /**
       
    55         * Not supported.
       
    56         */
       
    57 	    void DoOnFrameworkEvent( TSmlFrameworkEvent, TInt aParam1, TInt aParam2 );
       
    58 
       
    59         /**
       
    60         * Returns ETrue if operation of id aOpId is supported otherwice returns EFalse.
       
    61         */
       
    62 	    TBool DoSupportsOperation( TUid aOpId ) const;
       
    63 
       
    64         /**
       
    65         * Gives a reference to DataStoreFormat attribute structure.
       
    66         */
       
    67 	    const CSmlDataStoreFormat& DoStoreFormatL();
       
    68 
       
    69         /**
       
    70         * Gives a reference to available datastore names structure.
       
    71         */
       
    72 	    CDesCArray* DoListStoresLC();
       
    73 
       
    74         /**
       
    75         * Gives a reference to a default datastore name.
       
    76         */
       
    77 	    const TDesC& DoDefaultStoreL();
       
    78 
       
    79         /**
       
    80         * Greates new CNSmlAgendaDataStore instance.
       
    81         */
       
    82 	    CSmlDataStore* DoNewStoreInstanceLC();
       
    83 
       
    84 	    /**
       
    85 		This method returns the set of filters that can be used to send to the SyncML server.
       
    86 		* @return New filters.
       
    87 		*/
       
    88 		const RPointerArray<CSyncMLFilter>& DoSupportedServerFiltersL();
       
    89 		
       
    90 		/**
       
    91 		This method checks what filters are supported by server.
       
    92 		@param	aServerDataStoreFormat	The store format of server
       
    93 		@param	aFilters				The array that includes filters
       
    94 		@param	aChangeInfo				The change information about changes that data provider did
       
    95 		*/
       
    96 		void DoCheckSupportedServerFiltersL(const CSmlDataStoreFormat& aServerDataStoreFormat, RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo);
       
    97 		
       
    98 		/**
       
    99 		This method updates dynamic filters up-to-date.
       
   100 		@param	aFilters				The array that includes filters
       
   101 		@param	aChangeInfo				The change information about changes that data provider did
       
   102 		*/
       
   103 		void DoCheckServerFiltersL(RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo);
       
   104 		
       
   105 		/**
       
   106 		This method generates a record filter query to be sent to the SyncML server for the provided filters.
       
   107 		@param	aFilters			The filters to be used for the query generation
       
   108 		@param	aMatch				The filter match type to be used
       
   109 		@param	aFilterMimeType		The mime type of the returned filter query
       
   110 		@param	TSyncMLFilterType 	The filter type of the returned filter query
       
   111 		@param  aStoreName			The name of the used store
       
   112 		@return						The record filter query to be sent to the SyncML server - empty if no record filter involved
       
   113 									for this specific filter
       
   114 		*/
       
   115 		HBufC* DoGenerateRecordFilterQueryLC(const RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterMatchType aMatch, TDes& aFilterMimeType, TSyncMLFilterType& aFilterType, TDesC& aStoreName);
       
   116 		
       
   117 		/**
       
   118 		This method generates a field filter query to be sent to the SyncML server for the provided filters.
       
   119 		@param	aFilters		The filters to be used for the query generation
       
   120 		@param	aFilterMimeType		The mime type of the returned filter query
       
   121 		@param	aProperties		The field filter query to be sent to the SyncML server - empty if no field filter involved
       
   122 								for this specific filter
       
   123 		@param  aStoreName		The name of the used store
       
   124 		*/
       
   125 		void DoGenerateFieldFilterQueryL(const RPointerArray<CSyncMLFilter>& aFilters, TDes& aFilterMimeType, RPointerArray<CSmlDataProperty>& aProperties, TDesC& aStoreName);
       
   126 	    
       
   127         /**
       
   128         * C++ default constructor.
       
   129         */
       
   130 	    CNSmlAgendaDataProvider();
       
   131  
       
   132         /**
       
   133         * By default Symbian 2nd phase constructor is private.
       
   134         */
       
   135 	    void ConstructL();
       
   136 	    
       
   137         /**
       
   138         * Returns data providers own supported features in a store format class.
       
   139         */
       
   140 	    CSmlDataStoreFormat* DoOwnStoreFormatL();
       
   141 
       
   142     private:
       
   143         // Agenda data store
       
   144 	    CNSmlAgendaDataStore* iAgnDataStore;
       
   145         // String ool
       
   146 	    RStringPool iStringPool;
       
   147         // Data store format
       
   148 	    CSmlDataStoreFormat* iDSFormat;
       
   149         // A handle to a file server session
       
   150 	    RFs iSession;
       
   151 	    // Filter array
       
   152 	    RPointerArray<CSyncMLFilter> iFilterArray;
       
   153 	};
       
   154 
       
   155 #endif // __NSMLAGENDADATAPROVIDER_H__
       
   156             
       
   157 // End of File