1.1 --- a/epoc32/include/obexclientmtm.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,305 +0,0 @@
1.4 -// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// 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.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -//
1.18 -
1.19 -#ifndef __OBEXCLIENTMTM_H__
1.20 -#define __OBEXCLIENTMTM_H__
1.21 -
1.22 -
1.23 -
1.24 -#include <mtclbase.h> //CBaseMtm
1.25 -
1.26 -// temporary forward declaration for now...
1.27 -class CObexHeaderList;
1.28 -
1.29 -class CMsvEntry;
1.30 -class CMtmDllRegistry;
1.31 -class CRichText;
1.32 -class TMsvEntry;
1.33 -class CRegisteredMtmDll;
1.34 -class CMsvSession;
1.35 -class CObexMtmHeader;
1.36 -
1.37 -extern const TInt KMaxObexPasswordLength;
1.38 -
1.39 -
1.40 -
1.41 -class TObexMtmProgress
1.42 -/**
1.43 -Used to determine the progress for the current obex send operation.
1.44 -
1.45 -@publishedPartner
1.46 -@released
1.47 -*/
1.48 - {
1.49 -public:
1.50 -
1.51 - ///The current state the send operation is in
1.52 - enum TSendState
1.53 - {
1.54 - ENullOp = 0, ///< Undefined state
1.55 - EInitialise, ///< Initialise Obex client object
1.56 - EConnect, ///< Trying to connect
1.57 - EConnectAttemptComplete, ///< Connection complete
1.58 - ESendObject, ///< Send Obex object
1.59 - ESendNextObject, ///< Send next Obex object
1.60 - ESendComplete, ///< Send complete
1.61 - EDisconnected, ///< Disconnected
1.62 - EUserCancelled, ///< User has cancelled the send, the current operation is unimportant
1.63 - ESendError, ///< Problem with the send
1.64 - EInitialised, ///< Initialisation complete
1.65 - EMovedToSent ///< Move sent message to outbox (not supported from v7.0s)
1.66 - };
1.67 - TSendState iSendState; ///< Current state of send operation
1.68 - TInt iTotalEntryCount; ///< Total number of objects to send
1.69 - TInt iEntriesDone; ///< Number of entries sent
1.70 - TInt iCurrentEntrySize; ///< Length attribute of the current object (bytes)
1.71 - TInt iCurrentBytesTrans;///< Number of bytes sent of the current object
1.72 - TInt iError; ///< Operation error code
1.73 - };
1.74 -
1.75 -
1.76 -
1.77 -class CObexClientMtm : public CBaseMtm
1.78 -/**
1.79 -CObexClientMtm
1.80 -
1.81 -Abstract base class for Client Mtms that send obex objects
1.82 -
1.83 -The functionality missing is an implementation of InvokeAsyncFunctionL()
1.84 -which should return a messaging operation for a specific transport, InitialiseHeaderL() which is used
1.85 -to create a CObexMtmHeader derived object of the appropriate type, and TestInvariant() which is used to
1.86 -perform invariant testing of the derived types (in debug only).
1.87 -These pure-virtual functions are the transport specific aspects of the MTM.
1.88 -
1.89 -@internalTechnology
1.90 -@released
1.91 -*/
1.92 - {
1.93 -public:
1.94 -
1.95 - /// Contains the connect the timeout values for connect and put operations
1.96 - struct STimeouts
1.97 - {
1.98 - TInt iConnectTimeout;
1.99 - TInt iPutTimeout;
1.100 - };
1.101 -
1.102 - //CBaseMtm Implementation
1.103 -
1.104 - /**
1.105 - * Commits cached changes to the message store, by calling CommitChangesL.
1.106 - *
1.107 - * @leave KErrXxx System-wide error codes if message cannot be saved.
1.108 - */
1.109 -
1.110 - IMPORT_C virtual void SaveMessageL();
1.111 -
1.112 - /**
1.113 - * This function loads the header from the message store
1.114 - *
1.115 - * @leave KErrXXX system-wide error codes
1.116 - */
1.117 -
1.118 - IMPORT_C virtual void LoadMessageL();
1.119 -
1.120 - /**
1.121 - * Ensure that the current message context part indicated is valid. Currently only works on KMsvMessagePartRecipient--all other parts
1.122 - * are assumed to be valid
1.123 - *
1.124 - * @param aPartList Bitmask indicating parts of message to be validated
1.125 - * @return Bitmask of any invalid parts--KErrNone otherwise
1.126 - */
1.127 -
1.128 - IMPORT_C virtual TUint ValidateMessage(TMsvPartList aPartList);
1.129 -
1.130 - /**
1.131 - * Finds the given text within the specified parts of the current message context. NOT IMPLEMENTED!
1.132 - *
1.133 - * @param aTextToFind Reference to the text to search for in the specified message parts
1.134 - * @param aPartList Bitmask indicating parts of message to be searched for the text
1.135 - * @return Bitmask of any parts containing the message text
1.136 - */
1.137 -
1.138 - IMPORT_C virtual TMsvPartList Find(const TDesC& aTextToFind, TMsvPartList aPartList);
1.139 -
1.140 - /**
1.141 - * Unsupported
1.142 - *
1.143 - * @leave Leaves always with KErrNotSupported
1.144 - */
1.145 -
1.146 - IMPORT_C virtual CMsvOperation* ReplyL (TMsvId aReplyEntryId, TMsvPartList aPartlist, TRequestStatus& aCompletionStatus);
1.147 -
1.148 - /**
1.149 - * Unsupported
1.150 - *
1.151 - * @leave Leaves always with KErrNotSupported
1.152 - */
1.153 -
1.154 - IMPORT_C virtual CMsvOperation* ForwardL(TMsvId aForwardEntryId, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
1.155 - // addresssee list (used by objects with no MTM knowledge)
1.156 -
1.157 - /**
1.158 - * Adds addressee to the addressee "list". Note that this MUST be a TDesC containing binary data representing
1.159 - * the TSockAddress of the addressee, usually as a TDesC16. This function will then package the data directly into
1.160 - * 8 bit data.
1.161 - * NB: Only ONE addressee is supported
1.162 - *
1.163 - * @param aRealAddress Reference to the address of the recipient
1.164 - * @leave KErrXXX if address cannot be appended
1.165 - * @leave KErrAlreadyExists if the Addressee "list" already contains an entry
1.166 - */
1.167 -
1.168 - IMPORT_C virtual void AddAddresseeL(const TDesC& aRealAddress);
1.169 -
1.170 - /**
1.171 - * Adds addressee to the addressee "list". Note that this MUST be a TDesC containing binary data representing
1.172 - * the TSockAddress of the addressee, usually as a TDesC16. This function will then package the data directly into
1.173 - * 8 bit data.
1.174 - * NB: Only ONE addressee is supported
1.175 - *
1.176 - * @param aRealAddress Reference to the address of the recipient
1.177 - * @param aAlias Reference to the alias of the recipient--ignored in this implementation
1.178 - * @leave KErrXXX if address cannot be appended
1.179 - * @leave KErrAlreadyExists if the Addressee "list" already contains an entry
1.180 - */
1.181 -
1.182 - IMPORT_C virtual void AddAddresseeL(const TDesC& aRealAddress, const TDesC& aAlias);
1.183 -
1.184 - /**
1.185 - * Removes addressee at index aIndex from the addressee "list".
1.186 - *
1.187 - * @param aIndex zero-based index of the addressee (ignored since "there can be only one").
1.188 - */
1.189 -
1.190 - IMPORT_C virtual void RemoveAddressee(TInt aIndex);
1.191 -
1.192 - /**
1.193 - * Sets the subject of the current message context
1.194 - *
1.195 - * @param aSubject Reference to the new message subject text
1.196 - * @leave Leaves if creation of new HBufC fails
1.197 - */
1.198 -
1.199 - IMPORT_C void SetSubjectL(const TDesC& aSubject);
1.200 -
1.201 - /**
1.202 - * Returns the subject of the current message context. Will not leave.
1.203 - *
1.204 - * @return const TPtrC representation of the Subject, or an empty TPtrC if the subject hasn't been set
1.205 - * @leave Never
1.206 - */
1.207 -
1.208 - IMPORT_C const TPtrC SubjectL() const;
1.209 -
1.210 - IMPORT_C void CreateMessageAttachmentL(TMsvId aAttachmentId);
1.211 -
1.212 -
1.213 - // --- RTTI functions ---
1.214 -
1.215 - /**
1.216 - * Gives the capability of the MTM.
1.217 - *
1.218 - * @param aCapability capability to be queried
1.219 - * @param aResponse capability dependent return value.
1.220 - * @return KErrNone if the capability is supported, or KErrNotSupported if not.
1.221 - */
1.222 -
1.223 - IMPORT_C virtual TInt QueryCapability(TUid aCapability, TInt& aResponse);
1.224 -
1.225 - IMPORT_C virtual void InvokeSyncFunctionL(TInt aFunctionId,const CMsvEntrySelection& aSelection, TDes8& aParameter);
1.226 -
1.227 - /**
1.228 - * Create a new message for this MTM. This creates a new messaging entry, then
1.229 - * re-initialises the MTM's CObexMtmHeader object.
1.230 - *
1.231 - * @param aServiceId The ID of the service for which the message is to be created
1.232 - * @leave KErrXxx Standard EPOC error codes if construction of new objects fails
1.233 - */
1.234 -
1.235 - IMPORT_C virtual void CreateMessageL(TMsvId /*aServiceId*/);
1.236 -
1.237 - /**
1.238 - * Destructor deletes FileNameExternaliser and Header
1.239 - */
1.240 -
1.241 - IMPORT_C ~CObexClientMtm();
1.242 -
1.243 - /**
1.244 - * Commits cached changes to the message store.
1.245 - *
1.246 - * @leave KErrXxx System-wide error codes if changes cannot be committed.
1.247 - */
1.248 -
1.249 - IMPORT_C void CommitChangesL();
1.250 -
1.251 - /**
1.252 - * This function calculates the size of all attachments to the message by either:
1.253 - *
1.254 - * @li summing the sizes of each of the children or;
1.255 - * @li reading in all of the filenames from the store, and summing their sizes.*
1.256 - *
1.257 - * @return total size of the attachments.
1.258 - * @leave KErrXXX system-wide error codes
1.259 - */
1.260 -
1.261 - IMPORT_C TInt32 GetAttachmentSizeL();
1.262 -
1.263 -
1.264 -protected:
1.265 -
1.266 - /**
1.267 - * Constructor. Initialises iMsgTypeUid with Uid provided by the derived class.
1.268 - *
1.269 - * @param aRegisteredMtmDll Registration data for MTM DLL.
1.270 - * @param aMsvSession CMsvSession of the client requesting the object.
1.271 - * @param aMsgTypeUid Uid of the message
1.272 - */
1.273 -
1.274 - IMPORT_C CObexClientMtm(CRegisteredMtmDll& aRegisteredMtmDll, CMsvSession& aMsvSession, TUid aMsgTypeUid);
1.275 -
1.276 - /**
1.277 - * Empty implementation provided for future-proofing.
1.278 - */
1.279 -
1.280 - IMPORT_C void ConstructL();
1.281 -
1.282 -
1.283 - /// Initialises header information (must be overidden in derived class)
1.284 - virtual void InitialiseHeaderL() = 0;
1.285 -
1.286 - /**
1.287 - * Resets the MTM when the context is switched.
1.288 - * Must be called by the derived class's ContextEntrySwitched prior to constructing a new header.
1.289 - */
1.290 -
1.291 - IMPORT_C void ContextEntrySwitched(); // called after the context of this instance has been changed to another entry
1.292 -
1.293 -protected:
1.294 - CObexMtmHeader* iHeader; ///<Header information that must be initialised by InitialiseHeaderL in the derived classes!
1.295 -
1.296 -private:
1.297 - const TUid iMsgTypeUid; ///<Message type UID, set by the derived class's constructor as appropriate for each derived MTM
1.298 - };
1.299 -
1.300 -//Custom invariant test macro--allows TestInvariant() function to be virtual
1.301 -
1.302 -#ifdef _DEBUG
1.303 -#define __TEST_INVARIANT_VIRTUAL TestInvariant();
1.304 -#else
1.305 -#define __TEST_INVARIANT_VIRTUAL
1.306 -#endif //__DEBUG__
1.307 -
1.308 -#endif // __OBEXCLIENTMTM_H__