1.1 --- a/epoc32/include/mw/msenmessage.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/msenmessage.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,184 @@
1.4 -msenmessage.h
1.5 +/*
1.6 +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description: This is the superclass interface for wider set of
1.19 +* concrete WSF message classes.
1.20 +*
1.21 +*/
1.22 +
1.23 +
1.24 +
1.25 +
1.26 +
1.27 +
1.28 +
1.29 +
1.30 +
1.31 +#ifndef M_SEN_MESSAGE_H
1.32 +#define M_SEN_MESSAGE_H
1.33 +
1.34 +#include <e32std.h>
1.35 +
1.36 +// FORWARD DECLARATIONS
1.37 +class CSenElement;
1.38 +class CSenXmlReader;
1.39 +
1.40 +//using namespace SenContext;
1.41 +
1.42 +// CONSTANTS
1.43 +//namespace SenContext // consider whether or not to declare new SenMessage c++ namespace
1.44 +// {
1.45 +// // Message class type enumeration for class casting:
1.46 +// }
1.47 +
1.48 +// FORWARD DECLARATIONS
1.49 +class MSenMessageContext;
1.50 +class MSenProperties;
1.51 +
1.52 +// CLASS DECLARATION
1.53 +/**
1.54 +* This is abstract interface defines set of WSF message classes, providing
1.55 +* convenience for other components, which typically cast this to some
1.56 +* subclass via IsSafeToCast() method.
1.57 +* @lib SenMessages.lib
1.58 +* @since Series60 4.0
1.59 +*/
1.60 +class MSenMessage
1.61 + {
1.62 + public:
1.63 +
1.64 + /**
1.65 + * Class Enumeration
1.66 + */
1.67 + enum TClass
1.68 + {
1.69 + EMessageBase = 0,
1.70 + EHttpGetMsg = 1,
1.71 + EHttpPostMsg = 2,
1.72 + EHttpPutMsg = 3,
1.73 + EHttpDeleteMsg = 4,
1.74 + ESoapEnvelope = 5,
1.75 + ESoapMessage = 6,
1.76 + ESoapEnvelope2 = 7,
1.77 + ESoapMessage2 = 8,
1.78 + ESoapMessageDom2 = 9,
1.79 + EAtomMessage = 10
1.80 + };
1.81 + /**
1.82 + * Direction Enumeration
1.83 + */
1.84 + enum TDirection
1.85 + {
1.86 + EOutbound = 0,
1.87 + EInbound = 1
1.88 + };
1.89 +
1.90 + /**
1.91 + * Gets the Message Type
1.92 + */
1.93 + virtual TClass Type() = 0;
1.94 + /**
1.95 + * Gets the Message Direction
1.96 + */
1.97 + virtual TDirection Direction() = 0;
1.98 +
1.99 +
1.100 + /**
1.101 + * Sets message context for this message. If context already
1.102 + * exists, it is discarded and replaced by this context
1.103 + * (context reset is performed).
1.104 + * @param apNotOwnedContext is the context.
1.105 + * Ownership is NOT transferred to this message.
1.106 + * @return
1.107 + * KErrNone on success
1.108 + * KErrArgument if apOwnedContext == NULL
1.109 + * or system-wide errorcode otherwise.
1.110 + */
1.111 + virtual TInt SetContext(MSenMessageContext* apNotOwnedContext) = 0;
1.112 +
1.113 + /**
1.114 + * Getter for message's context
1.115 + * @return message context, if this message relates to
1.116 + * (has associated with) such context, or NULL.
1.117 + */
1.118 + virtual MSenMessageContext* Context() = 0;
1.119 +
1.120 + /**
1.121 + * Sets properties for this message. Most typical use case
1.122 + * is to set message spesific transport properties.
1.123 + * @param apOwnedProperties pointer to the properties, which
1.124 + * ownership is transferred to this class. This is performed
1.125 + * in two different manners:
1.126 + *
1.127 + * 1. If message has context, the properties are (re)set into that context,
1.128 + * discarding any pre-existing properties.
1.129 + *
1.130 + * 2. If context is NOT available, properties will be directly owned by
1.131 + * this message.
1.132 + * @return
1.133 + * KErrNone on success
1.134 + * KErrArgument if apOwnedProperties == NULL
1.135 + * or system-wide errorcode otherwise.
1.136 + */
1.137 + virtual TInt SetProperties(MSenProperties* apOwnedProperties) = 0;
1.138 +
1.139 + /**
1.140 + * Getter for message specific (transport) properties
1.141 + * @return (transport) properties of this message,
1.142 + * if such have been applied to this message
1.143 + * or NULL otherwise.
1.144 + */
1.145 + virtual MSenProperties* Properties() = 0;
1.146 +
1.147 + virtual TBool IsSafeToCast(TClass aType) = 0;
1.148 + /**
1.149 + * Getter for transaction ID of this message.
1.150 + * In case of receiving a response message from
1.151 + * service provider, this transaction ID may be
1.152 + * used to map the response with request that
1.153 + * the service consumer sent via service connection.
1.154 + * In such case, the consumer can store return
1.155 + * value from SendL method that was invoked in
1.156 + * order maintain this mapping.
1.157 + * @return the transaction ID of this message
1.158 + */
1.159 + virtual TInt TxnId() = 0;
1.160 +
1.161 + /**
1.162 + * Clone method that duplicates this message
1.163 + * -- including all member data in the message.
1.164 + * For the service consumers, a typical use case
1.165 + * for cloning the message is when there is need
1.166 + * to preserve the received response beyond the
1.167 + * life time of a transaction. Normally, the
1.168 + * response messages, that are owned by service
1.169 + * connection are de-allocated after execution
1.170 + * returns from MSenServiceConsumer interface's
1.171 + * HandleMessageL or HandleErrorL method, back
1.172 + * to the service connection.
1.173 + * @return a pointer to a new message class instance,
1.174 + * which ownership IS transferred to a caller. Note
1.175 + * that caller is expected to cast this pointer to
1.176 + * a proper subclass via the use of IsSafeToCast
1.177 + * method. In case of responses, the message type
1.178 + * is normally equal with the type of the request
1.179 + * message that was sent by the consumer.
1.180 + */
1.181 + virtual MSenMessage* CloneL() = 0;
1.182 + };
1.183 +
1.184 +#endif // M_SEN_MESSAGE_H
1.185 +
1.186 +// End of File
1.187 +
1.188 +