metadataengine/server/inc/mdsrelationdef.h
changeset 0 c53acadfccc6
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     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:  Class to hold description about one relation
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MDSRELATIONDEF_H__
       
    19 #define __MDSRELATIONDEF_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 #include "mdsitemdef.h"
       
    24 
       
    25 
       
    26 class CMdCSerializationBuffer;
       
    27 
       
    28 
       
    29 /**
       
    30  *  Metadata relationdef class
       
    31  *
       
    32  *  This class is responsible for holding information about one relation
       
    33  *
       
    34  */
       
    35 class CMdsRelationDef : public CMdsItemDef
       
    36     {
       
    37     friend class CMdsNamespaceDef;
       
    38 public:
       
    39 	/**
       
    40 	 * Create new relation object
       
    41 	 * @param aId id of relation
       
    42 	 * @param aName name of relation
       
    43 	 * @return pointer to new created relation
       
    44 	 */
       
    45     static CMdsRelationDef* NewL( const TDesC& aName );
       
    46 
       
    47 	/**
       
    48 	 * Create new relation object
       
    49 	 * @param aId id of relation
       
    50 	 * @param aName name of relation
       
    51 	 * @return pointer to new created relation
       
    52 	 */
       
    53     static CMdsRelationDef* NewLC( const TDesC& aName );
       
    54 
       
    55     virtual ~CMdsRelationDef();
       
    56     
       
    57 
       
    58     TBool operator==( const CMdsRelationDef& aRelationDef ) const;
       
    59 
       
    60 	inline TBool operator!=( const CMdsRelationDef& aRelationDef ) const;
       
    61 
       
    62 	void StoreToDBL( const TDefId aNamespaceDefId );
       
    63 
       
    64 	/**
       
    65      * Get required size of serialized buffer when this is serialized.
       
    66      *
       
    67      * @return required size of serialized buffer
       
    68      */
       
    69     TUint32 RequiredBufferSize();
       
    70 
       
    71     /**
       
    72      * Serialize own data to serialized buffer (correct position must be set 
       
    73      * before calling) and return new position of serialized buffer.
       
    74 	 *
       
    75      * @param aBuffer  serialized buffer.
       
    76      */
       
    77     TMdCOffset SerializeL(CMdCSerializationBuffer& aBuffer, TMdCOffset aFreeSpace);
       
    78 
       
    79 private:
       
    80 	/**
       
    81 	 * 2nd phase construction
       
    82 	 * @param aName name of event
       
    83 	 */
       
    84     void ConstructL( const TDesC& aName );
       
    85 
       
    86 private: // data
       
    87 
       
    88     };
       
    89 
       
    90 #include "mdsrelationdef.inl"
       
    91 
       
    92 #endif // __MDSRELATIONDEF_H__