williamr@2
|
1 |
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
// Local includes
|
williamr@2
|
15 |
//
|
williamr@2
|
16 |
//
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
/**
|
williamr@2
|
21 |
@file
|
williamr@2
|
22 |
@publishedPartner
|
williamr@2
|
23 |
@released
|
williamr@2
|
24 |
*/
|
williamr@2
|
25 |
|
williamr@2
|
26 |
// System includes
|
williamr@2
|
27 |
//
|
williamr@2
|
28 |
#include <ecom/ecom.h>
|
williamr@2
|
29 |
#include <push/cpushhandlerbase.h>
|
williamr@2
|
30 |
|
williamr@2
|
31 |
|
williamr@2
|
32 |
/**
|
williamr@2
|
33 |
Constructor.
|
williamr@2
|
34 |
*/
|
williamr@2
|
35 |
inline CPushHandlerBase::CPushHandlerBase()
|
williamr@2
|
36 |
: CActive(EPriorityStandard)
|
williamr@2
|
37 |
{
|
williamr@2
|
38 |
}
|
williamr@2
|
39 |
|
williamr@2
|
40 |
|
williamr@2
|
41 |
/**
|
williamr@2
|
42 |
Destructor.
|
williamr@2
|
43 |
*/
|
williamr@2
|
44 |
inline CPushHandlerBase::~CPushHandlerBase()
|
williamr@2
|
45 |
{
|
williamr@2
|
46 |
REComSession::DestroyedImplementation(iDtor_ID_Key);
|
williamr@2
|
47 |
}
|
williamr@2
|
48 |
|
williamr@2
|
49 |
|
williamr@2
|
50 |
/**
|
williamr@2
|
51 |
Finds and instantiates an ECom WAP Push Application plug-in that matches the
|
williamr@2
|
52 |
specified Application ID.
|
williamr@2
|
53 |
|
williamr@2
|
54 |
@return
|
williamr@2
|
55 |
WAP Push Application plug-in that handles the specified Application ID.
|
williamr@2
|
56 |
|
williamr@2
|
57 |
@param aMatchData
|
williamr@2
|
58 |
Application ID.
|
williamr@2
|
59 |
*/
|
williamr@2
|
60 |
inline CPushHandlerBase* CPushHandlerBase::NewL(const TDesC& aMatchData)
|
williamr@2
|
61 |
{
|
williamr@2
|
62 |
return NewL(aMatchData, KUidPushHandlerBase);
|
williamr@2
|
63 |
}
|
williamr@2
|
64 |
|
williamr@2
|
65 |
|
williamr@2
|
66 |
/**
|
williamr@2
|
67 |
Finds and instantiates an ECom plug-in that implements an interface specialised
|
williamr@2
|
68 |
from CPushHandlerBase.
|
williamr@2
|
69 |
|
williamr@2
|
70 |
This is a utility function for use by ECom interface classes that specialise
|
williamr@2
|
71 |
CPushHandlerBase, such as CContentHandlerBase.
|
williamr@2
|
72 |
|
williamr@2
|
73 |
@param aMatchData
|
williamr@2
|
74 |
ECom match data.
|
williamr@2
|
75 |
|
williamr@2
|
76 |
@param aInterfaceUid
|
williamr@2
|
77 |
UID of the required derived ECom interface.
|
williamr@2
|
78 |
|
williamr@2
|
79 |
@return
|
williamr@2
|
80 |
WAP Push plug-in that handles the specified Application ID.
|
williamr@2
|
81 |
*/
|
williamr@2
|
82 |
inline CPushHandlerBase* CPushHandlerBase::NewL(const TDesC& aMatchData, const TUid& aInterfaceUid)
|
williamr@2
|
83 |
{
|
williamr@2
|
84 |
// Convert match data to 8-bits
|
williamr@2
|
85 |
HBufC8* buf = HBufC8::NewLC(aMatchData.Length());
|
williamr@2
|
86 |
TPtr8 data = buf->Des();
|
williamr@2
|
87 |
data.Copy(aMatchData);
|
williamr@2
|
88 |
data.LowerCase(); // change to lower case
|
williamr@2
|
89 |
|
williamr@2
|
90 |
// Set resolving parameters
|
williamr@2
|
91 |
TEComResolverParams resolverParams;
|
williamr@2
|
92 |
resolverParams.SetDataType(data);
|
williamr@2
|
93 |
resolverParams.SetWildcardMatch(ETrue);
|
williamr@2
|
94 |
|
williamr@2
|
95 |
// Get the instantiation
|
williamr@2
|
96 |
CPushHandlerBase* pushHandler = REINTERPRET_CAST(CPushHandlerBase*,
|
williamr@2
|
97 |
REComSession::CreateImplementationL(aInterfaceUid,
|
williamr@2
|
98 |
_FOFF(CPushHandlerBase, iDtor_ID_Key),
|
williamr@2
|
99 |
resolverParams));
|
williamr@2
|
100 |
CleanupStack::PopAndDestroy(buf);
|
williamr@2
|
101 |
return pushHandler;
|
williamr@2
|
102 |
}
|
williamr@2
|
103 |
|
williamr@2
|
104 |
|
williamr@2
|
105 |
/**
|
williamr@2
|
106 |
Specifies an interface to handle logging.
|
williamr@2
|
107 |
|
williamr@2
|
108 |
Log messages are intended to aid debugging.
|
williamr@2
|
109 |
|
williamr@2
|
110 |
@param aLog
|
williamr@2
|
111 |
Log interface. This is stored in iLog.
|
williamr@2
|
112 |
*/
|
williamr@2
|
113 |
inline void CPushHandlerBase::SetLogger(MWapPushLog& aLog)
|
williamr@2
|
114 |
{
|
williamr@2
|
115 |
iLog = &aLog;
|
williamr@2
|
116 |
}
|
williamr@2
|
117 |
|
williamr@2
|
118 |
|
williamr@2
|
119 |
/**
|
williamr@2
|
120 |
Called by the framework to supply a CPluginKiller object.
|
williamr@2
|
121 |
|
williamr@2
|
122 |
The plug-in calls CPluginKiller::KillPushPlugin() to delete itself when it
|
williamr@2
|
123 |
has completed handling a message.
|
williamr@2
|
124 |
|
williamr@2
|
125 |
@param aPluginKiller
|
williamr@2
|
126 |
Plugin killer. This is stored in iPluginKiller.
|
williamr@2
|
127 |
*/
|
williamr@2
|
128 |
inline void CPushHandlerBase::SetKiller(CPluginKiller& aPluginKiller)
|
williamr@2
|
129 |
{
|
williamr@2
|
130 |
iPluginKiller = &aPluginKiller;
|
williamr@2
|
131 |
}
|
williamr@2
|
132 |
|
williamr@2
|
133 |
/**
|
williamr@2
|
134 |
Set the connection manager.
|
williamr@2
|
135 |
|
williamr@2
|
136 |
@param aManager Reference to connection manager object to be set.*/
|
williamr@2
|
137 |
inline void CPushHandlerBase::SetManager(MConnManObserver& aManager)
|
williamr@2
|
138 |
{
|
williamr@2
|
139 |
iManager = &aManager;
|
williamr@2
|
140 |
}
|
williamr@2
|
141 |
|
williamr@2
|
142 |
|
williamr@2
|
143 |
/**
|
williamr@2
|
144 |
Stores the passed TRequestStatus and sets it to KRequestPending.
|
williamr@2
|
145 |
|
williamr@2
|
146 |
@param aStatus
|
williamr@2
|
147 |
Asynchronous status, stored in iConfirmStatus.
|
williamr@2
|
148 |
*/
|
williamr@2
|
149 |
inline void CPushHandlerBase::SetConfirmationStatus(TRequestStatus& aStatus)
|
williamr@2
|
150 |
{
|
williamr@2
|
151 |
aStatus=KRequestPending;
|
williamr@2
|
152 |
iConfirmStatus = &aStatus;
|
williamr@2
|
153 |
}
|
williamr@2
|
154 |
|
williamr@2
|
155 |
/**
|
williamr@2
|
156 |
Completes the stored asynchronous status with the specified error code.
|
williamr@2
|
157 |
|
williamr@2
|
158 |
@param aErr
|
williamr@2
|
159 |
Error code.
|
williamr@2
|
160 |
*/
|
williamr@2
|
161 |
inline void CPushHandlerBase::SignalConfirmationStatus(TInt aErr)
|
williamr@2
|
162 |
{
|
williamr@2
|
163 |
User::RequestComplete(iConfirmStatus, aErr);
|
williamr@2
|
164 |
}
|