mtpfws/mtpfw/dataproviders/dputility/inc/cmtpabstractdatacodemgr.h
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // mw/remoteconn/mtpfws/mtpfw/dataproviders/dputility/inc/cmtpabstractdatacodemgr.h
       
    15 // Abstract service provider's data code manager
       
    16 
       
    17 /**
       
    18  @file
       
    19  @internalComponent
       
    20  */
       
    21 
       
    22 #ifndef __CMTPABSTRACTDATACODEMGR_H__
       
    23 #define __CMTPABSTRACTDATACODEMGR_H__
       
    24 
       
    25 #include <mtp/mtpdataproviderapitypes.h>
       
    26 #include <mtp/tmtptypeguid.h>
       
    27 
       
    28 #include "mtpdebug.h"
       
    29 #include "mtpsvcdpconst.h"
       
    30 
       
    31 class MMTPDataProviderFramework;
       
    32 
       
    33 /**
       
    34 Keep service prop info, used by service related operation
       
    35 @internalComponent
       
    36 */
       
    37 class TMTPServicePropertyInfo
       
    38 	{
       
    39 public:
       
    40 	TUint16 iIndex;             // The enum index value of Service Property definition
       
    41 	TUint16 iServicePropCode;   // The Property Code, allocated by framework
       
    42 	TMTPTypeGuid iServicePropPKeyNamespace;  // The GUID of the NameSpace this property belongs to. Specified by Spec.
       
    43 	TUint32 iServicePropPKeyID; // The PKeyID, the index in the NameSpace. Specified by Spec.
       
    44 	TPtrC iServicePropertyName; // The Property Name
       
    45 
       
    46 public:
       
    47 	static IMPORT_C TInt LinearOrderServicePropOrder(const TMTPServicePropertyInfo& aLhs, const TMTPServicePropertyInfo& aRhs);
       
    48 	static IMPORT_C TInt LinearOrderServicePropOrder(const TUint16* aServicePropCode, const TMTPServicePropertyInfo& aObject);
       
    49 	};
       
    50 
       
    51 /**
       
    52 Keep format related info and all object properties belong to the format
       
    53 @internalComponent
       
    54 */
       
    55 class RMTPServiceFormat
       
    56 	{
       
    57 public:
       
    58 	IMPORT_C ~RMTPServiceFormat();
       
    59 
       
    60 	TUint16 iIndex;                 // The enum index value of Service Format definition
       
    61 	TUint16 iFormatCode;            // The Format Code, allocated by framework
       
    62 	TMTPTypeGuid iFormatGUID;    // The Format GUID, specified by Spec.
       
    63 	TUint16 iBaseFormatCode;        // The Base Format Code, reserved for further usage according to Spec.
       
    64 	TPtrC iFormatName;              // The Format Name
       
    65 	TPtrC iMIMEType;                // The Format MIME Type
       
    66 
       
    67 	// Property Code is TUint16 actually, but RArray<T> need 4 byte alignment.
       
    68 	// So use RArray<TUint32> to store property code
       
    69 	RArray<TUint32> iProps;         // Store all object properties code to specified format
       
    70 public:
       
    71 	//static auxiliary function
       
    72 	static IMPORT_C TBool FormatRelation(const TUint16* aFormatCode, const RMTPServiceFormat& aObject);
       
    73 	};
       
    74 
       
    75 /**
       
    76 Implements the service related data code(format, service prop and object prop) management.
       
    77 @internalComponent
       
    78 */
       
    79 class CMTPFullEnumDataCodeMgr: public CBase
       
    80 	{
       
    81 public:
       
    82 	IMPORT_C static CMTPFullEnumDataCodeMgr* NewL(MMTPDataProviderFramework& aFramework);
       
    83 	IMPORT_C virtual ~CMTPFullEnumDataCodeMgr();
       
    84 
       
    85 	// Common Service DataCodeMgr APIs
       
    86 	IMPORT_C TUint ServiceID() const;
       
    87 	IMPORT_C const TMTPTypeGuid& ServiceGUID() const;
       
    88 
       
    89 	IMPORT_C void GetSevicePropCodesL(RArray<TUint32>& aArray) const;
       
    90 	IMPORT_C const TMTPServicePropertyInfo* ServicePropertyInfo(TUint16 aServicePropCode) const;
       
    91 
       
    92 	// FullEnum specific APIs
       
    93 	IMPORT_C const RMTPServiceFormat& KnowledgeFormat() const;
       
    94 
       
    95 private:
       
    96 	CMTPFullEnumDataCodeMgr(MMTPDataProviderFramework& aFramework);
       
    97 	void ConstructL();
       
    98 
       
    99 	void BuildServiceIDL();
       
   100 	void BuildFormatL();
       
   101 	void BuildServicePropertyL();
       
   102 
       
   103 private:
       
   104 	MMTPDataProviderFramework& iFramework;
       
   105 	RArray<TMTPServicePropertyInfo> iServiceProperties;
       
   106 
       
   107 	// only Knowledge Format supported.
       
   108 	RMTPServiceFormat* iKnowledgeFormat;
       
   109 
       
   110 	TUint iServiceID;
       
   111 	TMTPTypeGuid iServiceGUID;
       
   112 	TMTPTypeGuid iPersistentServiceGUID;
       
   113 
       
   114 	/**
       
   115 	FLOGGER debug trace member variable.
       
   116 	*/
       
   117 	__FLOG_DECLARATION_MEMBER_MUTABLE;
       
   118 	};
       
   119 #endif // __CMTPABSTRACTDATACODEMGR_H__