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