mds_plat/metadata_engine_api/inc/mderelationdef.h
changeset 60 79f826a55db2
parent 0 c53acadfccc6
equal deleted inserted replaced
58:fe894bb075c2 60:79f826a55db2
       
     1 /*
       
     2 * Copyright (c) 2009 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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MDERELATIONDEF_H__
       
    19 #define __MDERELATIONDEF_H__
       
    20 
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include <mdccommon.h>
       
    25 
       
    26 // Forward declaration
       
    27 class CMdCSerializationBuffer;
       
    28 class CMdENamespaceDef;
       
    29 class TMdCRelationDef;
       
    30 
       
    31 
       
    32 /**
       
    33  * Relation definition.
       
    34  */
       
    35 NONSHARABLE_CLASS(CMdERelationDef) : public CBase
       
    36 	{
       
    37 public:	
       
    38 
       
    39 	static CMdERelationDef* NewL(const TMdCRelationDef& aRelationDef, CMdCSerializationBuffer& aSchemaBuffer,
       
    40 			CMdENamespaceDef& aNamespaceDef);
       
    41 
       
    42 	static CMdERelationDef* NewLC(const TMdCRelationDef& aRelationDef, CMdCSerializationBuffer& aSchemaBuffer,
       
    43 			CMdENamespaceDef& aNamespaceDef);
       
    44 
       
    45 	/**
       
    46 	 * Returns the name of the item.
       
    47 	 *
       
    48 	 * @return  name
       
    49 	 */
       
    50 	IMPORT_C const TDesC& Name() const;
       
    51 
       
    52 	/**
       
    53 	 * Compare this relation definition with other relation definition.
       
    54 	 *
       
    55 	 * @param aRelationDef other relation definition
       
    56 	 *
       
    57 	 * @return  0 if relations are same, 1 or more if this is greater than other 
       
    58 	 *          and -1 or less if this is less than other.
       
    59 	 */
       
    60 	IMPORT_C TInt Compare(const CMdERelationDef& aRelationDef) const;
       
    61 
       
    62 	/**
       
    63 	 * Returns namespace definition of namespace which contains this relation
       
    64 	 * @return namespace definition of relation
       
    65 	 */
       
    66 	IMPORT_C CMdENamespaceDef& NamespaceDef() const;
       
    67 
       
    68 public:		
       
    69 
       
    70 	/**
       
    71 	 * Destructor.
       
    72 	 */
       
    73 	virtual ~CMdERelationDef();
       
    74 
       
    75 	TDefId Id() const;
       
    76 
       
    77 private:
       
    78 	CMdERelationDef(const TMdCRelationDef& aRelationDef, CMdENamespaceDef& aNamespaceDef);
       
    79 
       
    80 	void ConstructL(CMdCSerializationBuffer& aSchemaBuffer);
       
    81 
       
    82 private:
       
    83 	const TMdCRelationDef& iRelationDef;
       
    84 	CMdENamespaceDef& iNamespaceDef;
       
    85 
       
    86 	TPtrC16 iName;
       
    87 	};
       
    88 
       
    89 #endif  // __MDERELATIONDEF_H__