|
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: MPresenceInfo API object implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CPRESENCEINFOIMP_H |
|
19 #define CPRESENCEINFOIMP_H |
|
20 |
|
21 #include "ximpapidataobjbase.h" |
|
22 #include "presenceapiobjbase.h" |
|
23 #include <presenceinfo.h> |
|
24 #include <s32strm.h> |
|
25 #include "presencetypehelpers.h" |
|
26 |
|
27 class CPersonPresenceInfoImp; |
|
28 class CServicePresenceInfoImp; |
|
29 class CDevicePresenceInfoImp; |
|
30 class CPresenceInfoFilterImp; |
|
31 |
|
32 |
|
33 /** |
|
34 * MPresenceInfo API object implementation. |
|
35 * |
|
36 * @lib ximpdatamodel.dll |
|
37 * @since S60 v3.2 |
|
38 */ |
|
39 NONSHARABLE_CLASS( CPresenceInfoImp ): public CXIMPApiDataObjBase, |
|
40 public MPresenceInfo |
|
41 { |
|
42 public: |
|
43 /** The class ID. */ |
|
44 enum { KClassId = PRIMP_CLSID_CPRESENCEINFOIMP }; |
|
45 |
|
46 |
|
47 public: |
|
48 |
|
49 IMPORT_C static CPresenceInfoImp* NewLC(); |
|
50 IMPORT_C static CPresenceInfoImp* NewL(); |
|
51 virtual ~CPresenceInfoImp(); |
|
52 |
|
53 private: |
|
54 |
|
55 CPresenceInfoImp(); |
|
56 void ConstructL(); |
|
57 |
|
58 public: // From MXIMPBase |
|
59 |
|
60 /** |
|
61 * Implementation of MXIMPBase interface methods |
|
62 * @see MXIMPBase |
|
63 */ |
|
64 XIMPIMP_DECLARE_IF_BASE_METHODS |
|
65 |
|
66 public: // From CXIMPApiDataObjBase |
|
67 |
|
68 /** |
|
69 * @see CXIMPApiDataObjBase |
|
70 */ |
|
71 XIMPIMP_DECLARE_DATAOBJ_BASE_METHODS |
|
72 |
|
73 public: // From MPresenceInfo |
|
74 |
|
75 const MPersonPresenceInfo* PersonPresence() const; |
|
76 MPersonPresenceInfo* PersonPresence(); |
|
77 void SetPersonPresenceL( MPersonPresenceInfo* aPersonPresence ); |
|
78 |
|
79 TInt ServicePresenceCount() const; |
|
80 const MServicePresenceInfo& ServicePresenceAt( TInt aIndex ) const; |
|
81 void LookupServicePresenceByServiceType( MServicePresenceInfo*& aServicePresence, |
|
82 const TDesC8& aMatch ) const; |
|
83 void AddServicePresenceL( MServicePresenceInfo* aServicePresence ); |
|
84 |
|
85 TInt DevicePresenceCount() const; |
|
86 const MDevicePresenceInfo& DevicePresenceAt( TInt aIndex ) const; |
|
87 void AddDevicePresenceL( MDevicePresenceInfo* aDevicePresence ); |
|
88 |
|
89 public: // New functions |
|
90 |
|
91 /** |
|
92 * Internalizes object data from given stream. |
|
93 * @param aStream Stream to read. |
|
94 */ |
|
95 IMPORT_C void InternalizeL( RReadStream& aStream ); |
|
96 |
|
97 /** |
|
98 * Creates and returns a filtered copy of this class, according |
|
99 * to the given filter. |
|
100 * Ownership transferred. |
|
101 * @param aFilter The filter to use |
|
102 * @return New filtered info imp instance |
|
103 */ |
|
104 IMPORT_C CPresenceInfoImp* FilteredInfoLC( |
|
105 const CPresenceInfoFilterImp& aFilter |
|
106 ) const; |
|
107 |
|
108 private: // data |
|
109 |
|
110 |
|
111 /** |
|
112 * OWN: |
|
113 */ |
|
114 CPersonPresenceInfoImp* iPersonPresence; |
|
115 |
|
116 /** |
|
117 * OWN: |
|
118 */ |
|
119 RPrServicePrInfoArray iServicePresences; |
|
120 |
|
121 /** |
|
122 * OWN: |
|
123 */ |
|
124 RPrDevicePrInfoArray iDevicePresences; |
|
125 |
|
126 }; |
|
127 |
|
128 |
|
129 #endif // CPRESENCEINFOIMP_H |