ximpfw/presence/srcpresencedatamodel/presenceinfo/presenceinfofieldimp.h
changeset 0 e6b17d312c8b
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Implementation of presence info field object.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPRESENCEINFOFIELDIMP_H
       
    19 #define CPRESENCEINFOFIELDIMP_H
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <s32strm.h> // RWriteStream, RReadStream
       
    23 #include <ximpbase.h>
       
    24 #include <ximpdatamodelifids.hrh>
       
    25 #include "ximpapidataobjbase.h"
       
    26 #include "presenceapiobjbase.h"
       
    27 #include "presenceinfofield.h"
       
    28 
       
    29 /**
       
    30  * Implementation of presence info field object.
       
    31  *
       
    32  *
       
    33  * @since S60 v3.2
       
    34  */
       
    35 NONSHARABLE_CLASS( CPresenceInfoFieldImp ): public CXIMPApiDataObjBase, 
       
    36                                                 public MPresenceInfoField
       
    37     {
       
    38     public:
       
    39 
       
    40     /** The class ID. */
       
    41     enum { KClassId = PRIMP_CLSID_CPRESENCEINFOFIELDIMP };
       
    42 
       
    43 public:
       
    44 
       
    45     IMPORT_C static CPresenceInfoFieldImp* NewLC( const TDesC8& aFieldName,
       
    46                                                       CXIMPApiDataObjBase* aFieldValue );
       
    47     
       
    48     IMPORT_C static CPresenceInfoFieldImp* NewLC();
       
    49 
       
    50     virtual ~CPresenceInfoFieldImp();
       
    51 
       
    52 private:
       
    53 
       
    54     CPresenceInfoFieldImp();
       
    55 
       
    56     void ConstructL( const TDesC8& aFieldName,
       
    57                      CXIMPApiDataObjBase* aFieldValue );
       
    58 
       
    59     void ConstructL();
       
    60 
       
    61     /**
       
    62      * @see CXIMPApiDataObjBase
       
    63      */
       
    64     XIMPIMP_DECLARE_DATAOBJ_BASE_PRIV_METHODS
       
    65 
       
    66 public: // From MXIMPBase
       
    67 
       
    68     /**
       
    69      * Implementation of MXIMPBase interface methods
       
    70      * @see MXIMPBase
       
    71      */
       
    72     XIMPIMP_DECLARE_IF_BASE_METHODS
       
    73 
       
    74     /**
       
    75      * @see CXIMPApiDataObjBase
       
    76      */
       
    77     XIMPIMP_DECLARE_DATAOBJ_BASE_METHODS
       
    78 
       
    79 public: // New functions
       
    80 
       
    81     /**
       
    82      * Internalizes object data from given stream.
       
    83      * @param aStream Stream to read.
       
    84      */
       
    85     IMPORT_C void InternalizeL( RReadStream& aStream );
       
    86 
       
    87 
       
    88 public: // from MPresenceInfoField
       
    89 
       
    90     /**
       
    91      * @see MPresenceInfoField
       
    92      */
       
    93     const TDesC8& FieldType() const;
       
    94     const MXIMPBase& FieldValue() const;
       
    95     MXIMPBase& FieldValue();
       
    96     void SetFieldValue( MXIMPBase* aFieldValue );
       
    97     void SetFieldTypeL( const TDesC8& aFieldType );
       
    98 
       
    99 private: // data
       
   100 
       
   101     // owned. name of the field
       
   102     RBuf8 iFieldName;
       
   103 
       
   104     // owned. the actual field.
       
   105     CXIMPApiDataObjBase* iFieldValue;
       
   106     };
       
   107     
       
   108 
       
   109 #endif // CPRESENCEINFOFIELDIMP_H
       
   110 
       
   111 
       
   112