|
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: Presence Service Connection own presence subscription implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CPSCOWNPRESENCESUBSCRIPTIONITEM_H |
|
19 #define CPSCOWNPRESENCESUBSCRIPTIONITEM_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include "presenceinfoimp.h" |
|
23 #include "ximpsubscriptionitem.h" |
|
24 #include "ximpsubscriptionitembase.h" |
|
25 |
|
26 class MXIMPItemParentBase; |
|
27 class MXIMPPscContext; |
|
28 class CPresenceInfoFilterImp; |
|
29 class COwnPresenceEventImp; |
|
30 |
|
31 /** |
|
32 * PSC own presence subscription implementation |
|
33 * |
|
34 * @since S60 v3.2 |
|
35 */ |
|
36 class COwnPresenceSubscriptionItem : public CXIMPSubscriptionItemBase |
|
37 { |
|
38 |
|
39 public: // Construction and destruction |
|
40 |
|
41 /** |
|
42 * Construction |
|
43 * @param aParent. Parent has to be informed when this object is deleted by RemoveMe method. |
|
44 */ |
|
45 static COwnPresenceSubscriptionItem* NewLC( MXIMPItemParentBase& aParent ); |
|
46 |
|
47 /** |
|
48 * Destruction |
|
49 * - Remember to inform parent about delete. |
|
50 */ |
|
51 virtual ~COwnPresenceSubscriptionItem(); |
|
52 |
|
53 private: // Construction and destruction |
|
54 |
|
55 /** |
|
56 * Construction |
|
57 * @param aParent. Parent has to be informed when this object is deleted by RemoveMe method. |
|
58 */ |
|
59 COwnPresenceSubscriptionItem( MXIMPItemParentBase& aParent ); |
|
60 |
|
61 /** |
|
62 * Construction |
|
63 */ |
|
64 void ConstructL(); |
|
65 |
|
66 public: // New methods |
|
67 |
|
68 /** |
|
69 * Current presence information filter. |
|
70 * @return Current presence information filter. |
|
71 */ |
|
72 IMPORT_C CPresenceInfoFilterImp& SubscriptionPif(); |
|
73 |
|
74 /** |
|
75 * Set current presence information filter. Overwrites existing one. |
|
76 * Ownership is transferred to callee. |
|
77 * @param aPif Current presence information filter. |
|
78 */ |
|
79 IMPORT_C void SetSubscriptionPif( CPresenceInfoFilterImp* aPif ); |
|
80 |
|
81 /** |
|
82 * Collect aggregated presence information filter wihtout given context. |
|
83 * @param aContext. Exluded context from aggregated pif. |
|
84 * @return Aggregated pif without exluded context. |
|
85 */ |
|
86 IMPORT_C CPresenceInfoFilterImp* CollectSubscriptionPifWithoutCtxL( |
|
87 MXIMPPscContext* aContext ); |
|
88 |
|
89 /** |
|
90 * Set presence information. Overwrites existing one. |
|
91 * @param aPresenceInfo. New presence information. |
|
92 */ |
|
93 IMPORT_C void SetPresenceInfoL( CPresenceInfoImp* aPresenceInfo ); |
|
94 |
|
95 public: // From MXIMPSubscriptionItem |
|
96 |
|
97 /** |
|
98 * Synthesise own presence information to given context. |
|
99 * Presence information is filtered with context pif. |
|
100 * @param aContext. Target context for own presence information. |
|
101 */ |
|
102 void SynthesiseSubscriptionEventToL( MXIMPPscContext* aContext, TBool aForceEvent ); |
|
103 |
|
104 private: // From CXIMPSubscriptionItemBase |
|
105 |
|
106 /** |
|
107 * @see CXIMPSubscriptionItemBase |
|
108 */ |
|
109 void CleanExpired(); |
|
110 |
|
111 private: // Data |
|
112 |
|
113 /** |
|
114 * Current presence information filter. |
|
115 */ |
|
116 CPresenceInfoFilterImp* iPif; |
|
117 |
|
118 /** |
|
119 * Current presence info |
|
120 */ |
|
121 CPresenceInfoImp* iPresenceInfo; |
|
122 }; |
|
123 |
|
124 |
|
125 /* ======================================================================== */ |
|
126 |
|
127 |
|
128 |
|
129 #endif // CPSCOWNPRESENCESUBSCRIPTIONITEM_H |