ximpfw/presence/srcpresencedatamodel/presencepublishing/presencewatcherinfoimp.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 CPRESENTITYWATCHERINFOIMP_H
       
    19 #define CPRESENTITYWATCHERINFOIMP_H
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <s32strm.h>
       
    23 #include <presencewatcherinfo.h>
       
    24 #include "ximpapidataobjbase.h"
       
    25 #include "presenceapiobjbase.h"
       
    26 
       
    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( CPresenceWatcherInfoImp ): public CXIMPApiDataObjBase,
       
    37                                                   public MPresenceWatcherInfo
       
    38     {
       
    39     public:
       
    40     /** The class ID. */
       
    41     enum { KClassId = PRIMP_CLSID_CPRESENCEWATCHERINFOIMP };
       
    42 
       
    43 public:
       
    44 
       
    45     IMPORT_C static CPresenceWatcherInfoImp* NewLC(
       
    46                     const MPresenceWatcherInfo::TWatcherType aType,
       
    47                     const MXIMPIdentity& aIdentity,
       
    48                     const TDesC16& aDisplayName );
       
    49     IMPORT_C static CPresenceWatcherInfoImp* NewLC();
       
    50     IMPORT_C static CPresenceWatcherInfoImp* NewL();
       
    51     virtual ~CPresenceWatcherInfoImp();
       
    52 
       
    53 private:
       
    54 
       
    55     CPresenceWatcherInfoImp();
       
    56     void ConstructL();
       
    57     void ConstructL( const MPresenceWatcherInfo::TWatcherType aType,
       
    58                      const MXIMPIdentity& aIdentity,
       
    59                      const TDesC16& aDisplayName );
       
    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: // From MPresenceWatcherInfo
       
    80 
       
    81     const MXIMPIdentity& WatcherId() const;
       
    82     const TDesC16& WatcherDisplayName() const;
       
    83     MPresenceWatcherInfo::TWatcherType WatcherType() const;
       
    84     void SetWatcherIdL( MXIMPIdentity* aIdentity );
       
    85     void SetWatcherDisplayNameL( const TDesC16& aDisplayName );
       
    86     void SetWatcherTypeL( MPresenceWatcherInfo::TWatcherType aType );    
       
    87     
       
    88     
       
    89 
       
    90 
       
    91 public: // New functions
       
    92 
       
    93     /**
       
    94      * Internalizes object data from given stream.
       
    95      * @param aStream Stream to read.
       
    96      */
       
    97     IMPORT_C void InternalizeL( RReadStream& aStream );
       
    98 
       
    99     /**
       
   100      * Set identity
       
   101      */
       
   102     IMPORT_C void SetIdentity( CXIMPIdentityImp* aIdentity );
       
   103 
       
   104     /**
       
   105      * Set identity
       
   106      */
       
   107     IMPORT_C void SetDisplayName( HBufC16* aDisplayName );
       
   108 
       
   109     /**
       
   110      * TLinearOrder for ordering based on stored group id,
       
   111      * when this class is used within an RPointerArray or derivatives.
       
   112      */
       
   113     IMPORT_C static TInt IdLinearOrder(
       
   114             const CPresenceWatcherInfoImp& aA,
       
   115             const CPresenceWatcherInfoImp& aB );
       
   116 
       
   117     /**
       
   118      * Access to identity object
       
   119      * @return Identity
       
   120      */
       
   121     IMPORT_C const CXIMPIdentityImp& IdentityImp() const;
       
   122 
       
   123 private: // data
       
   124 
       
   125     /**
       
   126      * Identity
       
   127      */
       
   128     CXIMPIdentityImp* iIdentity;
       
   129 
       
   130     /**
       
   131      * Displayname
       
   132      */
       
   133     RBuf16 iDisplayName;
       
   134 
       
   135     /**
       
   136      * Watcher type
       
   137      */
       
   138     MPresenceWatcherInfo::TWatcherType iType;
       
   139     
       
   140     };
       
   141 
       
   142 
       
   143 #endif // CPRESENTITYWATCHERINFOIMP_H