|
1 /* |
|
2 * s_presencefeatures.cpp Copyright (c) 2006, 2007 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: Interface for presence context. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "s_presencefeatures.h" |
|
20 #include "s_presentitygroups.h" |
|
21 #include "s_ximppresenceauthorization.h" |
|
22 #include "s_presencepublishing.h" |
|
23 #include "s_presenceobjectfactory.h" |
|
24 #include "s_presencewatching.h" |
|
25 |
|
26 MPresenceAuthorizationStub gPresenceAuthorizationStub; |
|
27 MPresencePublishingStub gMPresenceFeaturesStubPublishing; |
|
28 MPresenceObjectFactoryStub gMPresenceFeaturesStubObjectFactory; |
|
29 MPresenceWatchingStub gMPresenceFeaturesStubPresenceWatching; |
|
30 |
|
31 /** |
|
32 * Factory method to instantiate MPresenceFeatures. |
|
33 * |
|
34 * Factory method to instantiate platform default |
|
35 * MXIMPClient implementation through the ECom. |
|
36 * If the default presence framework isn't supported |
|
37 * in the platform, leaves with errorcode signalled |
|
38 * from ECom. |
|
39 * |
|
40 * @return The new presence client object. Object |
|
41 * ownership is returned to caller. |
|
42 */ |
|
43 MPresenceFeatures* MyMPresenceFeatureStub::NewStubL( MXIMPContext* /*aContext*/ ) |
|
44 { |
|
45 |
|
46 MyMPresenceFeatureStub* ret = new (ELeave) MyMPresenceFeatureStub(); |
|
47 CleanupStack::PushL(ret); |
|
48 ret->ContructL(); |
|
49 CleanupStack::Pop(); |
|
50 return ret; |
|
51 } |
|
52 |
|
53 void MyMPresenceFeatureStub::ContructL() |
|
54 { |
|
55 iGroups = new (ELeave) MyPresentityGroupsStub(); |
|
56 } |
|
57 |
|
58 /** |
|
59 * Public destructor. |
|
60 * Objects can be deleted through this interface. |
|
61 */ |
|
62 MyMPresenceFeatureStub::~MyMPresenceFeatureStub() |
|
63 { |
|
64 delete iGroups; |
|
65 }; |
|
66 |
|
67 |
|
68 /** |
|
69 * Default constructor to zero initialize |
|
70 * the iEcomDtorID member. |
|
71 */ |
|
72 MyMPresenceFeatureStub::MyMPresenceFeatureStub() |
|
73 { |
|
74 |
|
75 } |
|
76 |
|
77 |
|
78 /** |
|
79 * Gets reference to object factory interface. |
|
80 * |
|
81 * Returned object factory interface is used |
|
82 * to instantiate presence objects. |
|
83 * |
|
84 * @return Object factory interface. |
|
85 * No ownership is returned caller. |
|
86 */ |
|
87 MPresenceObjectFactory& MyMPresenceFeatureStub::PresenceObjectFactory() const |
|
88 { |
|
89 // MPresenceObjectFactory* ret = NULL; |
|
90 // return *ret; |
|
91 return gMPresenceFeaturesStubObjectFactory; |
|
92 }; |
|
93 |
|
94 |
|
95 /** |
|
96 * Gets reference to presence watching interface. |
|
97 * |
|
98 * @return Requested interface. |
|
99 * No ownership is returned caller. |
|
100 */ |
|
101 MPresenceWatching& MyMPresenceFeatureStub::PresenceWatching() const |
|
102 { |
|
103 //MPresenceWatching* ret = NULL; |
|
104 //return *ret; |
|
105 return gMPresenceFeaturesStubPresenceWatching; |
|
106 }; |
|
107 |
|
108 |
|
109 |
|
110 /** |
|
111 * Gets reference to presence publishing interface. |
|
112 * |
|
113 * @return Requested interface. |
|
114 * No ownership is returned caller. |
|
115 */ |
|
116 MPresencePublishing& MyMPresenceFeatureStub::PresencePublishing() const |
|
117 { |
|
118 // MPresencePublishing* ret = NULL; |
|
119 // return *ret; |
|
120 return gMPresenceFeaturesStubPublishing; |
|
121 }; |
|
122 |
|
123 |
|
124 |
|
125 /** |
|
126 * Gets reference to presentity groups interface. |
|
127 * |
|
128 * @return Requested interface. |
|
129 * No ownership is returned caller. |
|
130 */ |
|
131 MPresentityGroups& MyMPresenceFeatureStub::PresentityGroups() const |
|
132 { |
|
133 return *iGroups; |
|
134 }; |
|
135 |
|
136 |
|
137 /** |
|
138 * Gets reference to presence authorization interface. |
|
139 * |
|
140 * @return Requested interface. |
|
141 * No ownership is returned caller. |
|
142 */ |
|
143 MPresenceAuthorization& MyMPresenceFeatureStub::PresenceAuthorization() const |
|
144 { |
|
145 return gPresenceAuthorizationStub; |
|
146 }; |
|
147 |
|
148 |
|
149 const TAny* MyMPresenceFeatureStub::GetInterface( |
|
150 TInt32 /*aInterfaceId*/, |
|
151 TIfGetOps /*aOps*/ ) const |
|
152 { |
|
153 return NULL; |
|
154 } |
|
155 |
|
156 TAny* MyMPresenceFeatureStub::GetInterface( |
|
157 TInt32 /*aInterfaceId*/, |
|
158 TIfGetOps /*aOps*/ ) |
|
159 { |
|
160 return NULL; |
|
161 } |
|
162 |
|
163 TInt32 MyMPresenceFeatureStub::GetInterfaceId() const |
|
164 { |
|
165 return 0; |
|
166 } |
|
167 |
|
168 |