ximpfw/presence/srcpresencedatamodel/presentitygroups/presentitygroupinfoimp.h
changeset 51 61fad867f68e
equal deleted inserted replaced
-1:000000000000 51:61fad867f68e
       
     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:  MPresentityGroupInfo API object implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPRESENTITYGROUPINFOIMP_H
       
    19 #define CPRESENTITYGROUPINFOIMP_H
       
    20 
       
    21 #include "ximpapidataobjbase.h"
       
    22 #include "presenceapiobjbase.h"
       
    23 #include <presentitygroupinfo.h>
       
    24 
       
    25 #include <e32std.h>
       
    26 #include <s32strm.h>
       
    27 
       
    28 class CXIMPIdentityImp;
       
    29 
       
    30 /**
       
    31  * MPresenceInfo API object implementation.
       
    32  *
       
    33  * @lib ximpdatamodel.dll
       
    34  * @since S60 v3.2
       
    35  */
       
    36 NONSHARABLE_CLASS( CPresentityGroupInfoImp ): public CXIMPApiDataObjBase,
       
    37                                                   public MPresentityGroupInfo
       
    38     {
       
    39     public:
       
    40     /** The class ID. */
       
    41     enum { KClassId = PRIMP_CLSID_CPRESENTITYGROUPINFOIMP };
       
    42 
       
    43 public:
       
    44 
       
    45     IMPORT_C static CPresentityGroupInfoImp* NewLC( 
       
    46                     const MXIMPIdentity& aIdentity, 
       
    47                     const TDesC16& aDisplayName );
       
    48     IMPORT_C static CPresentityGroupInfoImp* NewLC();
       
    49     IMPORT_C static CPresentityGroupInfoImp* NewL();
       
    50     virtual ~CPresentityGroupInfoImp();
       
    51 
       
    52 private:
       
    53 
       
    54     CPresentityGroupInfoImp();
       
    55     void ConstructL();
       
    56     void ConstructL( const MXIMPIdentity& aIdentity, 
       
    57                      const TDesC16& aDisplayName );
       
    58    
       
    59     /**
       
    60      * @see CXIMPApiDataObjBase
       
    61      */
       
    62     XIMPIMP_DECLARE_DATAOBJ_BASE_PRIV_METHODS
       
    63 
       
    64 public: // From MXIMPBase
       
    65 
       
    66     /**
       
    67      * Implementation of MXIMPBase interface methods
       
    68      * @see MXIMPBase
       
    69      */
       
    70     XIMPIMP_DECLARE_IF_BASE_METHODS
       
    71 
       
    72     /**
       
    73      * @see CXIMPApiDataObjBase
       
    74      */
       
    75     XIMPIMP_DECLARE_DATAOBJ_BASE_METHODS
       
    76 
       
    77 
       
    78 public: // From MPresentityGroupInfo
       
    79 
       
    80     const MXIMPIdentity& GroupId() const;
       
    81     const TDesC16& GroupDisplayName() const;
       
    82     void SetGroupIdL( MXIMPIdentity* aIdentity );
       
    83     void SetGroupDisplayNameL( const TDesC16& aDisplayName );    
       
    84     
       
    85     
       
    86 public: // New functions
       
    87 
       
    88     /**
       
    89      * Internalizes object data from given stream.
       
    90      * @param aStream Stream to read.
       
    91      */
       
    92     IMPORT_C void InternalizeL( RReadStream& aStream );
       
    93 
       
    94 
       
    95     /**
       
    96      * TLinearOrder for ordering based on stored group id,
       
    97      * when this class is used within an RPointerArray or derivatives.
       
    98      */
       
    99     IMPORT_C static TInt GroupIdLinearOrder( 
       
   100             const CPresentityGroupInfoImp& aA,
       
   101             const CPresentityGroupInfoImp& aB );
       
   102             
       
   103     /**
       
   104      * Access to identity object
       
   105      * @return Identity
       
   106      */
       
   107     IMPORT_C const CXIMPIdentityImp& Identity() const;
       
   108 
       
   109 private: // data
       
   110 
       
   111     /**
       
   112      * Identity
       
   113      */
       
   114     CXIMPIdentityImp* iIdentity;
       
   115     
       
   116     /**
       
   117      * Displayname
       
   118      */
       
   119     RBuf16 iDisplayName;
       
   120 
       
   121     };
       
   122 
       
   123 
       
   124 #endif // CPRESENTITYGROUPINFOIMP_H