williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: This is the superclass interface for wider set of
|
williamr@2
|
15 |
* concrete WSF message classes.
|
williamr@2
|
16 |
*
|
williamr@2
|
17 |
*/
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
|
williamr@2
|
21 |
|
williamr@2
|
22 |
|
williamr@2
|
23 |
|
williamr@2
|
24 |
|
williamr@2
|
25 |
|
williamr@2
|
26 |
|
williamr@2
|
27 |
#ifndef M_SEN_MESSAGE_H
|
williamr@2
|
28 |
#define M_SEN_MESSAGE_H
|
williamr@2
|
29 |
|
williamr@2
|
30 |
#include <e32std.h>
|
williamr@2
|
31 |
|
williamr@2
|
32 |
// FORWARD DECLARATIONS
|
williamr@2
|
33 |
class CSenElement;
|
williamr@2
|
34 |
class CSenXmlReader;
|
williamr@2
|
35 |
|
williamr@2
|
36 |
//using namespace SenContext;
|
williamr@2
|
37 |
|
williamr@2
|
38 |
// CONSTANTS
|
williamr@2
|
39 |
//namespace SenContext // consider whether or not to declare new SenMessage c++ namespace
|
williamr@2
|
40 |
// {
|
williamr@2
|
41 |
// // Message class type enumeration for class casting:
|
williamr@2
|
42 |
// }
|
williamr@2
|
43 |
|
williamr@2
|
44 |
// FORWARD DECLARATIONS
|
williamr@2
|
45 |
class MSenMessageContext;
|
williamr@2
|
46 |
class MSenProperties;
|
williamr@2
|
47 |
|
williamr@2
|
48 |
// CLASS DECLARATION
|
williamr@2
|
49 |
/**
|
williamr@2
|
50 |
* This is abstract interface defines set of WSF message classes, providing
|
williamr@2
|
51 |
* convenience for other components, which typically cast this to some
|
williamr@2
|
52 |
* subclass via IsSafeToCast() method.
|
williamr@2
|
53 |
* @lib SenMessages.lib
|
williamr@2
|
54 |
* @since Series60 4.0
|
williamr@2
|
55 |
*/
|
williamr@2
|
56 |
class MSenMessage
|
williamr@2
|
57 |
{
|
williamr@2
|
58 |
public:
|
williamr@2
|
59 |
|
williamr@2
|
60 |
/**
|
williamr@2
|
61 |
* Class Enumeration
|
williamr@2
|
62 |
*/
|
williamr@2
|
63 |
enum TClass
|
williamr@2
|
64 |
{
|
williamr@2
|
65 |
EMessageBase = 0,
|
williamr@2
|
66 |
EHttpGetMsg = 1,
|
williamr@2
|
67 |
EHttpPostMsg = 2,
|
williamr@2
|
68 |
EHttpPutMsg = 3,
|
williamr@2
|
69 |
EHttpDeleteMsg = 4,
|
williamr@2
|
70 |
ESoapEnvelope = 5,
|
williamr@2
|
71 |
ESoapMessage = 6,
|
williamr@2
|
72 |
ESoapEnvelope2 = 7,
|
williamr@2
|
73 |
ESoapMessage2 = 8,
|
williamr@2
|
74 |
ESoapMessageDom2 = 9,
|
williamr@2
|
75 |
EAtomMessage = 10
|
williamr@2
|
76 |
};
|
williamr@2
|
77 |
/**
|
williamr@2
|
78 |
* Direction Enumeration
|
williamr@2
|
79 |
*/
|
williamr@2
|
80 |
enum TDirection
|
williamr@2
|
81 |
{
|
williamr@2
|
82 |
EOutbound = 0,
|
williamr@2
|
83 |
EInbound = 1
|
williamr@2
|
84 |
};
|
williamr@2
|
85 |
|
williamr@2
|
86 |
/**
|
williamr@2
|
87 |
* Gets the Message Type
|
williamr@2
|
88 |
*/
|
williamr@2
|
89 |
virtual TClass Type() = 0;
|
williamr@2
|
90 |
/**
|
williamr@2
|
91 |
* Gets the Message Direction
|
williamr@2
|
92 |
*/
|
williamr@2
|
93 |
virtual TDirection Direction() = 0;
|
williamr@2
|
94 |
|
williamr@2
|
95 |
|
williamr@2
|
96 |
/**
|
williamr@2
|
97 |
* Sets message context for this message. If context already
|
williamr@2
|
98 |
* exists, it is discarded and replaced by this context
|
williamr@2
|
99 |
* (context reset is performed).
|
williamr@2
|
100 |
* @param apNotOwnedContext is the context.
|
williamr@2
|
101 |
* Ownership is NOT transferred to this message.
|
williamr@2
|
102 |
* @return
|
williamr@2
|
103 |
* KErrNone on success
|
williamr@2
|
104 |
* KErrArgument if apOwnedContext == NULL
|
williamr@2
|
105 |
* or system-wide errorcode otherwise.
|
williamr@2
|
106 |
*/
|
williamr@2
|
107 |
virtual TInt SetContext(MSenMessageContext* apNotOwnedContext) = 0;
|
williamr@2
|
108 |
|
williamr@2
|
109 |
/**
|
williamr@2
|
110 |
* Getter for message's context
|
williamr@2
|
111 |
* @return message context, if this message relates to
|
williamr@2
|
112 |
* (has associated with) such context, or NULL.
|
williamr@2
|
113 |
*/
|
williamr@2
|
114 |
virtual MSenMessageContext* Context() = 0;
|
williamr@2
|
115 |
|
williamr@2
|
116 |
/**
|
williamr@2
|
117 |
* Sets properties for this message. Most typical use case
|
williamr@2
|
118 |
* is to set message spesific transport properties.
|
williamr@2
|
119 |
* @param apOwnedProperties pointer to the properties, which
|
williamr@2
|
120 |
* ownership is transferred to this class. This is performed
|
williamr@2
|
121 |
* in two different manners:
|
williamr@2
|
122 |
*
|
williamr@2
|
123 |
* 1. If message has context, the properties are (re)set into that context,
|
williamr@2
|
124 |
* discarding any pre-existing properties.
|
williamr@2
|
125 |
*
|
williamr@2
|
126 |
* 2. If context is NOT available, properties will be directly owned by
|
williamr@2
|
127 |
* this message.
|
williamr@2
|
128 |
* @return
|
williamr@2
|
129 |
* KErrNone on success
|
williamr@2
|
130 |
* KErrArgument if apOwnedProperties == NULL
|
williamr@2
|
131 |
* or system-wide errorcode otherwise.
|
williamr@2
|
132 |
*/
|
williamr@2
|
133 |
virtual TInt SetProperties(MSenProperties* apOwnedProperties) = 0;
|
williamr@2
|
134 |
|
williamr@2
|
135 |
/**
|
williamr@2
|
136 |
* Getter for message specific (transport) properties
|
williamr@2
|
137 |
* @return (transport) properties of this message,
|
williamr@2
|
138 |
* if such have been applied to this message
|
williamr@2
|
139 |
* or NULL otherwise.
|
williamr@2
|
140 |
*/
|
williamr@2
|
141 |
virtual MSenProperties* Properties() = 0;
|
williamr@2
|
142 |
|
williamr@2
|
143 |
virtual TBool IsSafeToCast(TClass aType) = 0;
|
williamr@2
|
144 |
/**
|
williamr@2
|
145 |
* Getter for transaction ID of this message.
|
williamr@2
|
146 |
* In case of receiving a response message from
|
williamr@2
|
147 |
* service provider, this transaction ID may be
|
williamr@2
|
148 |
* used to map the response with request that
|
williamr@2
|
149 |
* the service consumer sent via service connection.
|
williamr@2
|
150 |
* In such case, the consumer can store return
|
williamr@2
|
151 |
* value from SendL method that was invoked in
|
williamr@2
|
152 |
* order maintain this mapping.
|
williamr@2
|
153 |
* @return the transaction ID of this message
|
williamr@2
|
154 |
*/
|
williamr@2
|
155 |
virtual TInt TxnId() = 0;
|
williamr@2
|
156 |
|
williamr@2
|
157 |
/**
|
williamr@2
|
158 |
* Clone method that duplicates this message
|
williamr@2
|
159 |
* -- including all member data in the message.
|
williamr@2
|
160 |
* For the service consumers, a typical use case
|
williamr@2
|
161 |
* for cloning the message is when there is need
|
williamr@2
|
162 |
* to preserve the received response beyond the
|
williamr@2
|
163 |
* life time of a transaction. Normally, the
|
williamr@2
|
164 |
* response messages, that are owned by service
|
williamr@2
|
165 |
* connection are de-allocated after execution
|
williamr@2
|
166 |
* returns from MSenServiceConsumer interface's
|
williamr@2
|
167 |
* HandleMessageL or HandleErrorL method, back
|
williamr@2
|
168 |
* to the service connection.
|
williamr@2
|
169 |
* @return a pointer to a new message class instance,
|
williamr@2
|
170 |
* which ownership IS transferred to a caller. Note
|
williamr@2
|
171 |
* that caller is expected to cast this pointer to
|
williamr@2
|
172 |
* a proper subclass via the use of IsSafeToCast
|
williamr@2
|
173 |
* method. In case of responses, the message type
|
williamr@2
|
174 |
* is normally equal with the type of the request
|
williamr@2
|
175 |
* message that was sent by the consumer.
|
williamr@2
|
176 |
*/
|
williamr@2
|
177 |
virtual MSenMessage* CloneL() = 0;
|
williamr@2
|
178 |
};
|
williamr@2
|
179 |
|
williamr@2
|
180 |
#endif // M_SEN_MESSAGE_H
|
williamr@2
|
181 |
|
williamr@2
|
182 |
// End of File
|
williamr@2
|
183 |
|
williamr@2
|
184 |
|