ximpfw/presence/srcpresencedatamodel/presencepublishing/ownpresenceeventimp.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:  MOwnPresenceEvent API object implementation.
       
    15  *
       
    16 */
       
    17 
       
    18 #ifndef COWNPRESENCEEVENTIMP_H
       
    19 #define COWNPRESENCEEVENTIMP_H
       
    20 
       
    21 #include <ownpresenceevent.h>
       
    22 #include "ximpapieventbase.h"
       
    23 #include "presenceinfo.h"
       
    24 #include "ximpdatasubscriptionstateimp.h"
       
    25 #include "presenceapiobjbase.h"
       
    26 
       
    27 
       
    28 class RReadStream;
       
    29 class CPresenceInfoImp;
       
    30 class CXIMPDataSubscriptionStateImp;
       
    31 
       
    32 /**
       
    33  * MOwnPresenceEvent API object implementation.
       
    34  *
       
    35  * @lib ximpdatamodel.dll
       
    36  * @since S60 v3.2
       
    37  */
       
    38 NONSHARABLE_CLASS( COwnPresenceEventImp ): public CXIMPApiEventBase,
       
    39                                                public MOwnPresenceEvent
       
    40     {
       
    41 public:
       
    42     /** The class ID. */
       
    43     enum { KClassId = PRIMP_CLSID_COWNPRESENCEEVENTIMP };
       
    44 
       
    45 public:
       
    46     /**
       
    47      * Exported instantiation method for initializing
       
    48      * new event object.
       
    49      */
       
    50     IMPORT_C static COwnPresenceEventImp* NewLC(
       
    51         CXIMPDataSubscriptionStateImp* aState );
       
    52     IMPORT_C static COwnPresenceEventImp* NewL(
       
    53         CXIMPDataSubscriptionStateImp* aState );
       
    54 
       
    55 
       
    56     /**
       
    57      * Instantiation method for event automation.
       
    58      * Method signature must be exactly this to work
       
    59      * with event delivery automation system.
       
    60      *
       
    61      * Event implementation must be registered to
       
    62      * XIMPEventCodec KXIMPEventConstructorTable.
       
    63      */
       
    64     static CXIMPApiEventBase* NewFromStreamLC( RReadStream& aStream );
       
    65 
       
    66     virtual ~COwnPresenceEventImp();
       
    67 
       
    68 
       
    69 private:
       
    70     COwnPresenceEventImp();
       
    71     void ConstructL( CXIMPDataSubscriptionStateImp* aState );
       
    72     void ConstructL( RReadStream& aStream );
       
    73 
       
    74 public: // From API base interfaces
       
    75 
       
    76     /**
       
    77      * Implementation of MXIMPBase interface methods
       
    78      * @see MXIMPBase
       
    79      */
       
    80     XIMPIMP_DECLARE_IF_BASE_METHODS
       
    81 
       
    82 
       
    83     /**
       
    84      * Implementation of MXIMPEventBase interface and
       
    85      * CXIMPApiEventBase methods
       
    86      *
       
    87      * @see MXIMPEventBase
       
    88      * @see CXIMPApiEventBase
       
    89      */
       
    90     XIMPIMP_DECLARE_EVENT_BASE_METHODS
       
    91 
       
    92     void InternalizeL( RReadStream& aStream );
       
    93 
       
    94 
       
    95 public: // From MOwnPresenceEvent
       
    96 
       
    97     /**
       
    98      * Implementation of MOwnPresenceEvent interface methods
       
    99      * @see MOwnPresenceEvent
       
   100      */
       
   101     const MPresenceInfo& SubscribedPresence() const;
       
   102     const MXIMPDataSubscriptionState& DataSubscriptionState() const;
       
   103 
       
   104 public:  // new methods
       
   105 
       
   106     /**
       
   107      * Set new presence info.
       
   108      * Ownership transferred.
       
   109      * @param aInfoImp The info imp
       
   110      */
       
   111     void SetPresenceInfo( CPresenceInfoImp* aInfoImp );
       
   112 
       
   113 private: // data
       
   114 
       
   115     /**
       
   116      * Presence Document
       
   117      * Own.
       
   118      */
       
   119      CPresenceInfoImp* iPresenceInfo;
       
   120 
       
   121     /**
       
   122      *
       
   123      */
       
   124     CXIMPDataSubscriptionStateImp* iSubscriptionState;
       
   125     };
       
   126 
       
   127 
       
   128 #endif // COWNPRESENCEEVENTIMP_H