syncmlfw/ds/hostserver/dshostclient/inc/nsmldsdpinformation.h
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     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:  Utilities for DS Loader Framework
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __NSMLDSDPINFORMATION_H__ 
       
    20 #define __NSMLDSDPINFORMATION_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <s32strm.h>
       
    25 #include <SyncMLDef.h>
       
    26 #include <SmlDataSyncDefs.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CSmlDataStoreFormat;
       
    30 class RSmlFilterDef;
       
    31 class MSmlSyncRelationship;
       
    32 class CNSmlDbCaps;
       
    33 class MSmlDataItemUidSet;
       
    34 class CDesC8Array;
       
    35 
       
    36 // DATA TYPES
       
    37 
       
    38 // ------------------------------------------------------------------------------------------------
       
    39 // Data provider information for SOS Server.
       
    40 // Doesn't handle freeing of member variable pointers. 
       
    41 //
       
    42 // @lib nsmldshostclient.lib
       
    43 // ------------------------------------------------------------------------------------------------
       
    44 struct TNSmlDPInformation
       
    45 	{
       
    46 	public:
       
    47 		TSmlDataProviderId iId;
       
    48 		TVersion iVersion;
       
    49 		TSmlProtocolVersion iProtocolVer;
       
    50 		HBufC* iDisplayName;
       
    51 		CDesC8Array* iMimeTypes;
       
    52 		CDesC8Array* iMimeVersions;
       
    53 	};
       
    54 	
       
    55 // CLASS DECLARATION
       
    56 
       
    57 // ------------------------------------------------------------------------------------------------
       
    58 // Class for transporting data provider information over IPC.
       
    59 //
       
    60 // @lib nsmldshostclient.lib
       
    61 // ------------------------------------------------------------------------------------------------
       
    62 class CNSmlDPInformation : public CBase
       
    63 	{
       
    64 	public:
       
    65 		/**
       
    66 		* Creates new instance of CNSmlDPInformation based class.
       
    67 		* @return CNSmlDPInformation*. Newly created instance.
       
    68 		*/
       
    69 		IMPORT_C static CNSmlDPInformation* NewL();
       
    70 		
       
    71 		/**
       
    72 		* Creates new instance of CNSmlDPInformation based class.
       
    73 		* @return CNSmlDPInformation*. Newly created instance that is pushed to cleanup stack.
       
    74 		*/
       
    75 		IMPORT_C static CNSmlDPInformation* NewLC();
       
    76 		
       
    77 		/**
       
    78 		* C++ Destructor.
       
    79 		*/
       
    80 		IMPORT_C ~CNSmlDPInformation();
       
    81 		
       
    82 		/**
       
    83 		* sets data provider id.
       
    84 		* @param TSmlDataProviderId. data provider id to set.
       
    85 		*/
       
    86 		IMPORT_C void SetId(TSmlDataProviderId aId) const;
       
    87 
       
    88 		/**
       
    89 		* Returns display name of data provider.
       
    90 		* @return HBufC*. Display name
       
    91 		*/
       
    92 		IMPORT_C const HBufC* DisplayName() const;
       
    93 		
       
    94 		/**
       
    95 		* Sets display name of data provider
       
    96 		* @param aDisplayName. Display name
       
    97 		*/
       
    98 		IMPORT_C void SetDisplayNameL( const TDesC& aDisplayName );
       
    99 		
       
   100 		/**
       
   101 		* Returns mime type of data provider.
       
   102 		* @return CDesC8Array*. Mime types
       
   103 		*/
       
   104 		IMPORT_C const CDesC8Array* MimeTypes() const;
       
   105 		
       
   106 		/**
       
   107 		* Sets mime type of data provider.
       
   108 		* @param aMimeType. Mime types. Class takes the ownership
       
   109 		*/
       
   110 		IMPORT_C void SetMimeTypesL( CDesC8Array* aMimeTypes );
       
   111 		
       
   112 		/**
       
   113 		* Returns mime version of data provider.
       
   114 		* @return CDesC8Array*. Mime versions
       
   115 		*/
       
   116 		IMPORT_C const CDesC8Array* MimeVers() const;
       
   117 		
       
   118 		/**
       
   119 		* Sets mime version of data provider
       
   120 		* @param aMimeVersions. Mime version. Class takes the ownership
       
   121 		*/
       
   122 		IMPORT_C void SetMimeVersL( CDesC8Array* aMimeVersions );
       
   123 		
       
   124 		/**
       
   125 		* Returns protocol version of data provider.
       
   126 		* @return TSmlProtocolVersion. The protocol version supported.
       
   127 		*/	
       
   128 		IMPORT_C TSmlProtocolVersion ProtocolVersion() const;
       
   129 		
       
   130 		/**
       
   131 		* Sets protocol version of data provider
       
   132 		* @param aProtocol. The protocol version supported.
       
   133 		*/
       
   134 		IMPORT_C void SetProtocolVersion( TSmlProtocolVersion aProtocol );
       
   135 		
       
   136 		/**
       
   137 		* Returns version number of data provider.
       
   138 		* @return const const TVersion&. The version number.
       
   139 		*/
       
   140 		IMPORT_C const TVersion& Version() const;
       
   141 		
       
   142 		/**
       
   143 		* Sets version of data provider
       
   144 		* @param aProtocol. The protocol version supported.
       
   145 		*/
       
   146 		IMPORT_C void SetVersion( const TVersion& aVersion );
       
   147 		
       
   148 		/**
       
   149 		* Returns all the information of data provider.
       
   150 		* @return TNSmlDPInformation*. Ownership is changed to the caller.
       
   151 		*/	
       
   152 		IMPORT_C TNSmlDPInformation* InformationD();
       
   153 		
       
   154 		/**
       
   155 		* This method externalizes class to stream.
       
   156 		* @param aStream. Externalize is done to this stream.
       
   157 		*/
       
   158 		IMPORT_C void ExternalizeL( RWriteStream& aStream ) const;
       
   159 		
       
   160 		/**
       
   161 		* This method internalizes class from stream.
       
   162 		* @param aStream. Internalize is done from this stream.
       
   163 		*/
       
   164 		IMPORT_C void InternalizeL( RReadStream& aStream );
       
   165 
       
   166 	private:
       
   167 		/**
       
   168 		* C++ constructor.
       
   169 		*/	
       
   170 		CNSmlDPInformation();
       
   171 		
       
   172 		/**
       
   173 		* ConstrucL
       
   174 		*/	
       
   175 		void ConstructL();
       
   176 		
       
   177 	private:
       
   178 		TNSmlDPInformation* iInfo;
       
   179 	};
       
   180 		
       
   181 
       
   182 #endif // __NSMLDSDPINFORMATION_H__
       
   183 
       
   184 // End of File