|
51
|
1 |
/*
|
|
|
2 |
* 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: Implementation of MXIMPContext
|
|
|
15 |
*
|
|
|
16 |
*/
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
#include <ximpcontext.h>
|
|
|
20 |
#include "presencefeaturesimp.h"
|
|
|
21 |
#include "presenceobjectfactoryimp.h"
|
|
|
22 |
#include "presencepublishingimp.h"
|
|
|
23 |
#include "presentitygroupsimp.h"
|
|
|
24 |
#include "presencewatchingimp.h"
|
|
|
25 |
#include "presenceauthorizationimp.h"
|
|
|
26 |
#include "ximpcontextclientinfoimp.h"
|
|
|
27 |
#include "ximpidentityimp.h"
|
|
|
28 |
#include "ximpcontextinternal.h"
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
|
|
|
32 |
// ============================ MEMBER FUNCTIONS =============================
|
|
|
33 |
|
|
|
34 |
// ---------------------------------------------------------------------------
|
|
|
35 |
// CPresenceFeaturesImp::NewL()
|
|
|
36 |
// ---------------------------------------------------------------------------
|
|
|
37 |
//
|
|
|
38 |
EXPORT_C CPresenceFeaturesImp* CPresenceFeaturesImp::NewL(MXIMPContext* aContext)
|
|
|
39 |
{
|
|
|
40 |
CPresenceFeaturesImp* self = new( ELeave ) CPresenceFeaturesImp() ;
|
|
|
41 |
CleanupStack::PushL( self );
|
|
|
42 |
self->ConstructL(aContext);
|
|
|
43 |
CleanupStack::Pop();
|
|
|
44 |
return self;
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
// ---------------------------------------------------------------------------
|
|
|
48 |
// Implement supported interface access.
|
|
|
49 |
// ---------------------------------------------------------------------------
|
|
|
50 |
//
|
|
|
51 |
|
|
|
52 |
XIMPIMP_IF_BASE_GET_INTERFACE_BEGIN( CPresenceFeaturesImp,
|
|
|
53 |
MPresenceFeatures )
|
|
|
54 |
XIMPIMP_IF_BASE_GET_INTERFACE_END()
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
XIMPIMP_IF_BASE_GET_CONST_INTERFACE_BEGIN( CPresenceFeaturesImp,
|
|
|
58 |
MPresenceFeatures )
|
|
|
59 |
XIMPIMP_IF_BASE_GET_INTERFACE_END()
|
|
|
60 |
|
|
|
61 |
// ---------------------------------------------------------------------------
|
|
|
62 |
// CPresenceFeaturesImp::~CPresenceFeaturesImp()
|
|
|
63 |
// ---------------------------------------------------------------------------
|
|
|
64 |
//
|
|
|
65 |
CPresenceFeaturesImp::~CPresenceFeaturesImp()
|
|
|
66 |
{
|
|
|
67 |
delete iPresGroup;
|
|
|
68 |
delete iPresWatch;
|
|
|
69 |
delete iPresAuth;
|
|
|
70 |
delete iPresPub;
|
|
|
71 |
delete iPresObjFactory;
|
|
|
72 |
iCtxInternal = NULL;
|
|
|
73 |
}
|
|
|
74 |
|
|
|
75 |
|
|
|
76 |
// ---------------------------------------------------------------------------
|
|
|
77 |
// CPresenceFeaturesImp::CPresenceFeaturesImp( CXIMPContextClientProxy& aCtxProxy )
|
|
|
78 |
// ---------------------------------------------------------------------------
|
|
|
79 |
//
|
|
|
80 |
CPresenceFeaturesImp::CPresenceFeaturesImp()
|
|
|
81 |
{
|
|
|
82 |
}
|
|
|
83 |
|
|
|
84 |
// ---------------------------------------------------------------------------
|
|
|
85 |
// CPresenceFeaturesImp::SetCtxL(MXIMPContext* aContext)
|
|
|
86 |
// ---------------------------------------------------------------------------
|
|
|
87 |
//
|
|
|
88 |
void CPresenceFeaturesImp::SetCtxL(MXIMPContext* aContext)
|
|
|
89 |
{
|
|
|
90 |
if(!aContext)
|
|
|
91 |
User::Leave(KErrArgument);
|
|
|
92 |
iCtxInternal = TXIMPGetInterface<MXIMPContextInternal>::From(*aContext,EReturnNullIfUnknown);
|
|
|
93 |
|
|
|
94 |
}
|
|
|
95 |
|
|
|
96 |
// ---------------------------------------------------------------------------
|
|
|
97 |
// CPresenceFeaturesImp::ConstructL(MXIMPContext* aContext)
|
|
|
98 |
// ---------------------------------------------------------------------------
|
|
|
99 |
//
|
|
|
100 |
void CPresenceFeaturesImp::ConstructL(MXIMPContext* aContext)
|
|
|
101 |
{
|
|
|
102 |
SetCtxL(aContext);
|
|
|
103 |
|
|
|
104 |
iPresObjFactory = CPresenceObjectFactoryImp::NewL();
|
|
|
105 |
iPresPub = CPresencePublishingImp::NewL( *iCtxInternal );
|
|
|
106 |
iPresWatch = CPresenceWatchingImp::NewL( *iCtxInternal );
|
|
|
107 |
iPresGroup = CPresentityGroupsImp::NewL( *iCtxInternal );
|
|
|
108 |
iPresAuth = CPresenceAuthorizationImp::NewL(*iCtxInternal );
|
|
|
109 |
}
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
// ---------------------------------------------------------------------------
|
|
|
113 |
// CPresenceFeaturesImp::PresenceObjectFactory()
|
|
|
114 |
// ---------------------------------------------------------------------------
|
|
|
115 |
//
|
|
|
116 |
MPresenceObjectFactory& CPresenceFeaturesImp::PresenceObjectFactory() const
|
|
|
117 |
{
|
|
|
118 |
return *iPresObjFactory;
|
|
|
119 |
}
|
|
|
120 |
|
|
|
121 |
|
|
|
122 |
// ---------------------------------------------------------------------------
|
|
|
123 |
// CPresenceFeaturesImp::PresencePublishing()
|
|
|
124 |
// ---------------------------------------------------------------------------
|
|
|
125 |
//
|
|
|
126 |
MPresencePublishing& CPresenceFeaturesImp::PresencePublishing() const
|
|
|
127 |
{
|
|
|
128 |
return *iPresPub;
|
|
|
129 |
}
|
|
|
130 |
|
|
|
131 |
|
|
|
132 |
// ---------------------------------------------------------------------------
|
|
|
133 |
// CPresenceFeaturesImp::PresentityGroups()
|
|
|
134 |
// ---------------------------------------------------------------------------
|
|
|
135 |
//
|
|
|
136 |
MPresentityGroups& CPresenceFeaturesImp::PresentityGroups() const
|
|
|
137 |
{
|
|
|
138 |
return *iPresGroup;
|
|
|
139 |
}
|
|
|
140 |
|
|
|
141 |
// ---------------------------------------------------------------------------
|
|
|
142 |
// CPresenceFeaturesImp::PresenceWatching()
|
|
|
143 |
// ---------------------------------------------------------------------------
|
|
|
144 |
//
|
|
|
145 |
MPresenceWatching& CPresenceFeaturesImp::PresenceWatching() const
|
|
|
146 |
{
|
|
|
147 |
return *iPresWatch;
|
|
|
148 |
}
|
|
|
149 |
|
|
|
150 |
// ---------------------------------------------------------------------------
|
|
|
151 |
// CPresenceFeaturesImp::PresenceWatching()
|
|
|
152 |
// ---------------------------------------------------------------------------
|
|
|
153 |
//
|
|
|
154 |
MPresenceAuthorization& CPresenceFeaturesImp::PresenceAuthorization() const
|
|
|
155 |
{
|
|
|
156 |
return *iPresAuth;
|
|
|
157 |
}
|
|
|
158 |
|
|
|
159 |
|
|
|
160 |
|