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