williamr@2: /* williamr@2: * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * Client Mtm for multimedia messaging. williamr@2: * This is the API for accessing multimedia messaging engine. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: #ifndef MMSCLIENT_H williamr@2: #define MMSCLIENT_H williamr@2: williamr@2: // INCLUDES williamr@2: #include // base client mtm williamr@2: #include // TTimeInterval & TTime williamr@2: #include "mmsconst.h" // common constants williamr@2: williamr@2: // CONSTANTS williamr@2: williamr@2: // MACROS williamr@2: williamr@2: // DATA TYPES williamr@2: typedef struct williamr@2: { williamr@2: const TUint SymbianCharsetUID; williamr@2: const TUint IANAMIBEnum; williamr@2: }TMmsCharacterSetLookup; williamr@2: williamr@2: // FUNCTION PROTOTYPES williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CMmsSettings; williamr@2: class CMmsHeaders; williamr@2: class CMsvMimeHeaders; williamr@2: class CMsvFindText; williamr@2: class CMmsAttachmentWaiter; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * Client Mtm for multimedia messaging subsystem. williamr@2: * williamr@2: * This class will be the interface to the UI component and other williamr@2: * messaging component that might want to handle multimedia messages williamr@2: * (For example SendAs interface). williamr@2: * williamr@2: * This class provides access to MMS specific headers in the message. williamr@2: * williamr@2: * Note: new functions are added as the last virtual functions in order williamr@2: * not to to break the vtable williamr@2: * williamr@2: * @code williamr@2: * // Example of getting access to this class: williamr@2: * williamr@2: * // Called by an application that implements williamr@2: * // MMsvSessionObserver interface williamr@2: * williamr@2: * iSession = CMsvSession::OpenSyncL(*this); williamr@2: * CleanupStack::PushL(iSession); williamr@2: * iClientMtmRegistry = CClientMtmRegistry::NewL(*iSession); williamr@2: * CleanupStack::PushL(iClientMtmRegistry); williamr@2: * iMmsClient = (CMmsClientMtm *) iClientMtmRegistry-> williamr@2: * NewMtmL(KUidMsgTypeMultimedia); williamr@2: * CleanupStack::PushL(iMmsClient); williamr@2: * williamr@2: * // - do other initialization williamr@2: * williamr@2: * CleanupStack::Pop(3); //iSession, iClientMtmRegistry, iMmsClient williamr@2: * williamr@2: * // - call any public functions in CMmsClientMtm williamr@2: * williamr@2: * // When the application finishes, williamr@2: * // it must delete the objects in reverse order: williamr@2: * delete iMmsClient; williamr@2: * delete iClientMtmRegistry; williamr@2: * delete iSession; williamr@2: * @endcode williamr@2: */ williamr@2: williamr@2: class CMmsClientMtm :public CBaseMtm williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: williamr@2: /** williamr@2: * Factory function. williamr@2: * williamr@2: * The only function exported by this polymorphic interface dll. williamr@2: * This function is not directly called by the application that needs williamr@2: * access, it is called by an instance of CClientMtmRegistry class. williamr@2: * williamr@2: * @param[in] aRegisteredMtmDll Mtm Dll registry class williamr@2: * @param[in] aSession Message Server session. williamr@2: * @return Pointer to CMmsClientMtm class. williamr@2: */ williamr@2: IMPORT_C static CMmsClientMtm* NewL( williamr@2: CRegisteredMtmDll& aRegisteredMtmDll, williamr@2: CMsvSession& aSession ); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: virtual ~CMmsClientMtm(); williamr@2: williamr@2: public: // New functions williamr@2: williamr@2: // ---------------------------------------------------------- williamr@2: // Functions to create and modify message entries williamr@2: williamr@2: /** williamr@2: * Create a new message entry. williamr@2: * williamr@2: * @param[in] aDestination Target folder. williamr@2: * @param[in] aCompletionStatus Reference to the status of an active object. williamr@2: * This status will contain the relevant error code when the operation williamr@2: * completes. williamr@2: * @return Pointer to a message server operation (active object). williamr@2: * When the message has been created the progress information of the williamr@2: * operation provides the id of the created message in an 8-bit package williamr@2: * buffer. While the operation is in progress the package will contain a williamr@2: * null id (KMsvNullIndexEntryId). If there is an error while williamr@2: * creating the message the message will be deleted and the williamr@2: * package will contain a null id. williamr@2: * williamr@2: * This function is suitable when the caller is an active object or the williamr@2: * caller does not want to immediately change current context to the williamr@2: * new message entry. williamr@2: * williamr@2: * If the caller is not an active object and the caller wants the context williamr@2: * of CMmsClientMtm to be immediately set to the new entry, it is simpler williamr@2: * to call CreateMessageL. williamr@2: * @see CMmsClientMtm::CreateMessageL williamr@2: * williamr@2: * @code williamr@2: * // This example shows usage with a caller that is not an active object, williamr@2: * // so a separate waiter is needed. If the caller is an active object, williamr@2: * // the caller gives its own status to the function and continues williamr@2: * // execution in RunL function. williamr@2: * williamr@2: * CMsvOperation* myOperation = NULL; williamr@2: * CMsvOperationActiveSchedulerWait* wait = williamr@2: * CMsvOperationActiveSchedulerWait::NewLC(); williamr@2: * williamr@2: * // destinationId specifies the destination folder. williamr@2: * myOperation = iMmsClient->CreateNewEntryL( destinationId, wait->iStatus ); williamr@2: * williamr@2: * CleanupStack::PushL( myOperation ); williamr@2: * williamr@2: * wait->Start(); williamr@2: * williamr@2: * if ( wait->iStatus.Int() != KErrNone ) williamr@2: * { williamr@2: * // error handling, e.g. leave williamr@2: * } williamr@2: * williamr@2: * // Get the message id williamr@2: * TPckgBuf pkg; williamr@2: * pkg.Copy( myOperation->ProgressL() ); williamr@2: * TMsvId progress = pkg(); williamr@2: * CleanupStack::PopAndDestroy(2); // myOperation, wait; williamr@2: * williamr@2: * // Load the new message williamr@2: * iMmsClient->SwitchCurrentEntryL( progress ); williamr@2: * williamr@2: * // load the default values that were already intialized williamr@2: * // when the message was created williamr@2: * iMmsClient->LoadMessageL(); williamr@2: * williamr@2: * // continue adding data to the message williamr@2: * // ... williamr@2: * @endcode williamr@2: */ williamr@2: virtual CMsvOperation* CreateNewEntryL( williamr@2: TMsvId aDestination, williamr@2: TRequestStatus& aCompletionStatus); williamr@2: williamr@2: williamr@2: // ------------------------------------------------------------------- williamr@2: // FUNCTIONS TO HANDLE MMSC SETTINGS williamr@2: // williamr@2: // Only one MMS service entry may be created! williamr@2: // williamr@2: // The Client MTM maintains cached MMS service settings, referred to williamr@2: // as current service below. Some of those cached settings are used williamr@2: // as template values when a new multimedia message is created. williamr@2: // williamr@2: // Use Base MTM functions to get default service id. williamr@2: williamr@2: // williamr@2: /** williamr@2: * Create new service entry. williamr@2: * williamr@2: * Context is set to the new service entry. williamr@2: * Currently a maximum of one service is created, and further requests williamr@2: * do not create a new service entry. williamr@2: * @deprecated Only one MMS service is supported and it is automatically created. williamr@2: * Use DefaultServiceL() to get the id for the default service. williamr@2: */ williamr@2: virtual void CreateServiceL(); williamr@2: // williamr@2: williamr@2: // Functions to load, save, and access MMS Settings. williamr@2: // There is no need to change the context when these functions are used. williamr@2: // williamr@2: williamr@2: /** williamr@2: * Get a reference to CMmsSettings class. williamr@2: * williamr@2: * This method should be used by MMS UI only. Other applications should williamr@2: * not touch the MMS settings. The methods are needed in MMS Client API williamr@2: * to allow MMS UI to inform MMS Client MTM about changed settings. williamr@2: * williamr@2: * The contents of the class are those used by MMS Client MTM williamr@2: * when constructing a message. If the settings must be changed, williamr@2: * a copy must be made, and SetSettingsL function used to deliver williamr@2: * the settings to MMS Client MTM. williamr@2: * williamr@2: * @return constant reference to iMmsSettings member of CMmsClientMtm. williamr@2: * williamr@2: * @code williamr@2: * // Usage: williamr@2: * williamr@2: * CMmsSettings* settings = CMmsSettings::NewL(); williamr@2: * CleanupStack::PushL( settings ); williamr@2: * iMmsClient->RestoreSettingsL(); williamr@2: * settings->CopyL( iMmsClient->MmsSettings() ); williamr@2: * williamr@2: * // change settings here... williamr@2: * // The settings are changed using CMmsSettings API williamr@2: * williamr@2: * iMmsClient->SetSettingsL( *settings ); williamr@2: * iMmsClient->StoreSettingsL(); williamr@2: * CleanupStack::PopAndDestroy(); // settings williamr@2: * williamr@2: * @endcode williamr@2: */ williamr@2: virtual const CMmsSettings& MmsSettings(); williamr@2: williamr@2: /** williamr@2: * Copy the values from aSettings to CMmsClientMtm. williamr@2: * williamr@2: * This method should be used by MMS UI only. Other applications should williamr@2: * not touch the MMS settings. williamr@2: * williamr@2: * Used to provide new settings to MMS Client MTM when settings have williamr@2: * been changed. Will affect only messages created after the settings williamr@2: * have been changed. williamr@2: * williamr@2: * Use function StoreSettingsL to save the settings on disk. williamr@2: * williamr@2: * @param[in] aSettings New values for CMmsSettings williamr@2: */ williamr@2: virtual void SetSettingsL( const CMmsSettings& aSettings ); williamr@2: williamr@2: /** williamr@2: * Save settings to disk. williamr@2: * williamr@2: * This method should be used by MMS UI only. Other applications should williamr@2: * not touch the MMS settings. williamr@2: */ williamr@2: virtual void StoreSettingsL(); williamr@2: williamr@2: /** williamr@2: * Load settings from disk. williamr@2: * williamr@2: * This method should be used by MMS UI only. Other applications should williamr@2: * not touch the MMS settings. williamr@2: */ williamr@2: virtual void RestoreSettingsL(); williamr@2: williamr@2: // williamr@2: /** williamr@2: * Restore factory settings. williamr@2: * williamr@2: * Restore settings from ROM to the default service entry and select it williamr@2: * as the current service entry. williamr@2: * @param aLevel Defines the operations to be done. williamr@2: * @deprecated MMS UI should restore the factory settings directly. williamr@2: */ williamr@2: virtual void RestoreFactorySettingsL( williamr@2: TMmsFactorySettingsLevel aLevel = EMmsFactorySettingsLevelNormal ); williamr@2: // williamr@2: williamr@2: /** williamr@2: * Validate service. williamr@2: * williamr@2: * Checks that access point refers to a valid entry in comms database. williamr@2: * williamr@2: * @param[in] aServiceId Id of the MMS service williamr@2: * @return Error code. williamr@2: * - KErrNone: The service is OK. williamr@2: * - KErrNotFound: The service id is incorrect. williamr@2: * - KMmsErrorInvalidSettings: The settings contain invalid values. williamr@2: * This error is possible only if the settings file has been corrupted. williamr@2: * - KMmsErrorNoWAPAccessPoint: No access point has been defined. williamr@2: * - KMmsErrorAP1Invalid: MMS access point refers to an invalid entry in comms williamr@2: * database. williamr@2: * - KMmsErrorNoURI1: Home page has not been defined for MMS access point williamr@2: */ williamr@2: virtual TInt ValidateService( TMsvId aServiceId ); williamr@2: williamr@2: // ------------------------------------------------------------------- williamr@2: // FUNCTIONS TO HANDLE MMS HEADERS williamr@2: williamr@2: // Accessors and mutators (getters and setters) for header fields. williamr@2: // Some of these header fields have default values that are assigned williamr@2: // from cached service settings when a new header is allocated. williamr@2: // Some header fields are needed by protocol only. williamr@2: // Those headers don't have accessors and mutators here, williamr@2: // as they are used by Server MTM who accesses them directly williamr@2: // through functions offered by CMmsHeaders. williamr@2: williamr@2: /** williamr@2: * Set the sender of the message. williamr@2: * williamr@2: * If the sender of the message is not explicitly defined, the Proxy-Relay williamr@2: * or MMS Service Centre will add the sender's phone number. williamr@2: * williamr@2: * @param[in] aAlias The phone number of the sender of the message. williamr@2: * Maximum length 256 characters. This string will be included williamr@2: * as the sender of the message when the message is sent, but williamr@2: * the MMS Service Centre will check the validity of the williamr@2: * value and replace it with the actual phone number of the williamr@2: * sender if it is not correct. williamr@2: */ williamr@2: virtual void SetSenderL( const TDesC& aAlias ); williamr@2: williamr@2: /** williamr@2: * Get the sender of the message. williamr@2: * williamr@2: * @return Address of the sender of the message (for example phone number). williamr@2: * If the sender has not been defined, returns an empty string. williamr@2: */ williamr@2: virtual const TPtrC Sender() const; williamr@2: williamr@2: /** williamr@2: * Set the message class. williamr@2: * williamr@2: * If message class is not explicitly set, the message will have williamr@2: * class "Personal" by default. williamr@2: * williamr@2: * @param [in] aMessageClass Message class code. Possible values: williamr@2: * - EMmsClassPersonal: Message is a normal person-to-person message (default). williamr@2: * - EMmsClassAdvertisement: Message contains an advertisement. williamr@2: * - EMmsClassInformational: Message contains data from an information service. williamr@2: * - EMmsClassAuto: Message has been automatically generated by the phone. williamr@2: * This class is only valid for a message that is a read report to another message. williamr@2: */ williamr@2: virtual void SetMessageClass( TMmsMessageClass aMessageClass ); williamr@2: williamr@2: /** williamr@2: * Get the message class. williamr@2: * williamr@2: * @return Message class. Possible values: williamr@2: * - EMmsClassPersonal: Message is a normal person-to-person message (default). williamr@2: * - EMmsClassAdvertisement: Message contains an advertisement. williamr@2: * - EMmsClassInformational: Message contains data from an information service. williamr@2: * - EMmsClassAuto: Message has been automatically generated by the phone. williamr@2: * This class is only valid for a message that is a read report to another message. williamr@2: * - 0: Message class has not been defined. Handle as EMmsClassPersonal. williamr@2: */ williamr@2: virtual TInt MessageClass() const; williamr@2: williamr@2: /** williamr@2: * Set the validity period of the message. williamr@2: * williamr@2: * If the validity period is not defined for the message, default williamr@2: * validity period from MMS settings or MMS Service Centre will be used. williamr@2: * williamr@2: * @param[in] aInterval The length of time in seconds after which the williamr@2: * message will be discarded by MMS Service Centre. williamr@2: * MMSC may limit the maximum length of the validity period. williamr@2: */ williamr@2: virtual void SetExpiryInterval( TTimeIntervalSeconds aInterval ); williamr@2: williamr@2: /** williamr@2: * Get the validity period of the message. williamr@2: * williamr@2: * @return Storage time of the message in MMS Service Centre (in seconds). williamr@2: * If the message cannot be delivered to the recipient within the williamr@2: * validity period, it will be discarded. If the validity period is 0, williamr@2: * it has not been defined. williamr@2: */ williamr@2: virtual TTimeIntervalSeconds ExpiryInterval() const; williamr@2: williamr@2: /** williamr@2: * Set the expiration date of the message. williamr@2: * williamr@2: * @param[in] aDate The date and time when the message will expire williamr@2: * (In UTC time). The date must be later than 1970-01-01, 00:00:00 GMT williamr@2: * If the MMS Service Centre cannot deliver the message to the recipient williamr@2: * before the expiration date, the message will be discarded. If expiration williamr@2: * date or validity period have not been defined, default is used. williamr@2: */ williamr@2: virtual void SetExpiryDate( TTime aDate ); williamr@2: williamr@2: /** williamr@2: * Get the expiration date of the message. williamr@2: * williamr@2: * @return The date and time when the message will expire. (in UTC time). williamr@2: * If the expiration date has not been defined, TTime(0) will be williamr@2: * returned. williamr@2: */ williamr@2: virtual TTime ExpiryDate() const; williamr@2: williamr@2: /** williamr@2: * Set the delivery time interval for the message. williamr@2: * williamr@2: * @param[in] aInterval The length of time in seconds after which the message williamr@2: * will be delivered to the recipient by the MMS Service Centre. williamr@2: * If neither delivery time interval or delivery date have been defined, williamr@2: * MMS Service Centre will deliver the message immediately. williamr@2: */ williamr@2: virtual void SetDeliveryTimeInterval( TTimeIntervalSeconds aInterval ); williamr@2: williamr@2: /** williamr@2: * Get the delivery time interval of the message. williamr@2: * williamr@2: * @return The length of time in seconds after which the message will be williamr@2: * delivered to the recipient by MMS Service Centre. If the delivery williamr@2: * time interval is 0, it has not been defined. williamr@2: */ williamr@2: virtual TTimeIntervalSeconds DeliveryTimeInterval() const; williamr@2: williamr@2: /** williamr@2: * Set the delivery date for the message. williamr@2: * williamr@2: * @param[in] aDate The date and time when the message will be delivered williamr@2: * to the recipient by the MMSC (in UTC time). The date must be williamr@2: * later than 1970-01-01, 00:00:00 GMT. If neither delivery time williamr@2: * interval or delivery date have been defined, MMS Service Centre williamr@2: * will deliver the message immediately. williamr@2: */ williamr@2: virtual void SetDeliveryDate( TTime aDate ); williamr@2: williamr@2: /** williamr@2: * Get the delivery date of the message. williamr@2: * williamr@2: * @return The date and time when the message will be (or was) delivered williamr@2: * to the recipient by the MMSC (in UTC time). If the delivery date williamr@2: * has not been defined, TTime(0) is returned. williamr@2: */ williamr@2: virtual TTime DeliveryDate() const; williamr@2: williamr@2: /** williamr@2: * Set the priority of the message. williamr@2: * williamr@2: * If the priority of the message is not set, the default priority will be williamr@2: * "normal". williamr@2: * williamr@2: * @param[in] aPriority Message priority, possible values: williamr@2: * - EMmsPriorityLow: Low priority. williamr@2: * - EMmsPriorityNormal: Normal priority. williamr@2: * - EMmsPriorityHigh: High priority. williamr@2: */ williamr@2: virtual void SetMessagePriority( TMmsMessagePriority aPriority ); williamr@2: williamr@2: /** williamr@2: * Get the priority of the message. williamr@2: * williamr@2: * @return Message priority, possible values: williamr@2: * - EMmsPriorityLow: Low priority. williamr@2: * - EMmsPriorityNormal: Normal priority. williamr@2: * - EMmsPriorityHigh: High priority. williamr@2: * - 0: Priority has not been defined, treat as EMmsPriorityNormal williamr@2: */ williamr@2: virtual TInt MessagePriority() const; williamr@2: williamr@2: /** williamr@2: * Set the sender visibility setting for the message. williamr@2: * williamr@2: * Indicates whether the MMS Service Centre should hide the sender's phone williamr@2: * number from the recipient. If the value is not defined, default is williamr@2: * used. The default is to show the sender's number unless the sender williamr@2: * has a secret number. williamr@2: * williamr@2: * @param[in] aVisibility Visibility of the sender's phone number to the williamr@2: * recipient. Possible values: williamr@2: * - EMmsSenderVisibilityDefault: Use default visibility. williamr@2: * - EMmsSenderVisibilityHide: Hide the sender's number. williamr@2: * - EMmsSenderVisibilityShow: Show the sender's number even if it is a williamr@2: * secret number. williamr@2: */ williamr@2: virtual void SetSenderVisibility( williamr@2: TMmsMessageSenderVisibility aVisibility ); williamr@2: williamr@2: /** williamr@2: * Get the sender visibility setting of the message. williamr@2: * williamr@2: * Indicates whether the MMS Service Centre should hide the sender's phone williamr@2: * number from the recipient. The default is show the sender's number williamr@2: * unless the server has a secret number. williamr@2: * williamr@2: * @return visibility setting. Possible values: williamr@2: * - EMmsSenderVisibilityDefault: Default visibility. williamr@2: * - EMmsSenderVisibilityHide: Hide the sender's number. williamr@2: * - EMmsSenderVisibilityShow: Show the sender's number even if it is a williamr@2: * secret number. williamr@2: * - 0: Sender visibilty has not been defined, use default. williamr@2: */ williamr@2: virtual TInt SenderVisibility() const; williamr@2: williamr@2: /** williamr@2: * Set the delivery report request setting value for the message. williamr@2: * williamr@2: * If the value is not set, default value from MMS settings will be used. williamr@2: * williamr@2: * @param[in] aRequest tells if the user wants a delivery report for this williamr@2: * message. Possible values: williamr@2: * - EMmsYes: The user wants a delivery report. williamr@2: * - EMmsNo: The user does not want a delivery report. williamr@2: */ williamr@2: virtual void SetDeliveryReport( williamr@2: TMmsYesNo aRequest ); williamr@2: williamr@2: /** williamr@2: * Get the delivery report request setting of the message. williamr@2: * williamr@2: * If the value is not defined, default value from MMS settings is used. williamr@2: * williamr@2: * @return delivery report request setting. Possible values: williamr@2: * - EMmsYes: The user wants a delivery report. williamr@2: * - EMmsNo: The user does not want a delivery report. williamr@2: * - 0: Setting has not been defined. williamr@2: */ williamr@2: virtual TInt DeliveryReport() const; williamr@2: williamr@2: /** williamr@2: * Set the read report request setting value for the message. williamr@2: * williamr@2: * Specifies if the user wants a read report for the current message. williamr@2: * If this value is Yes, the recipient phone should send a read report williamr@2: * when the user opens the message for the first time. williamr@2: * williamr@2: * @param[in] aRequest read report request setting. Possible values: williamr@2: * - EMmsYes: The user wants a read report. williamr@2: * - EMmsNo: The user does not want a read report. williamr@2: */ williamr@2: virtual void SetReadReply( TMmsYesNo aRequest ); williamr@2: williamr@2: /** williamr@2: * Get the read report request setting of the message. williamr@2: * williamr@2: * Specifies if the sender wants a read report for current message. williamr@2: * If this value is yes and the message has been received by the phone williamr@2: * (has "KMmsMessageMobileTerminated" flag) a read report should be williamr@2: * sent to the sender of this message when the message is opened williamr@2: * for the first time. williamr@2: * williamr@2: * @return read report request setting. Possible values: williamr@2: * - EMmsYes: The user wants a read report. williamr@2: * - EMmsNo: The user does not want a read report. williamr@2: * - 0: Setting has not been defined. Do not send a read report. williamr@2: */ williamr@2: virtual TInt ReadReply() const; williamr@2: williamr@2: /** williamr@2: * Get the sending date and time of the message. williamr@2: * Valid only for messages received by the phone. williamr@2: * @return the time when MMS Service Centre has received the message williamr@2: * from sender (in UTC time). williamr@2: * If the time has not been defined, returns TTime(0). williamr@2: */ williamr@2: virtual TTime SendingDate() const; williamr@2: williamr@2: /** williamr@2: * Get the response text from the message. williamr@2: * williamr@2: * Valid only in cases a response text has been obtained from MMS Service williamr@2: * Centre. Possible cases are received messages and messages whose williamr@2: * senging has failed. The text may explain the cause of the failure. williamr@2: * williamr@2: * @return Response text string. If text is not defined, returns an empty williamr@2: * string. williamr@2: * @since 2.0 williamr@2: */ williamr@2: virtual TPtrC ResponseText() const; williamr@2: williamr@2: /** williamr@2: * Get the response status value from the message. williamr@2: * williamr@2: * This function returns the status MMS Service Centre has sent with a williamr@2: * retrieved message or as a response to a failure to send a message. williamr@2: * The status code may be used in case of permanent failures to retrieve williamr@2: * or failures to send to indicate the reason of the failure. williamr@2: * williamr@2: * @return Status code sent by MMS Service Centre. Possible values are williamr@2: * defined in OMA MMS Encapsulations specifications, and depend on williamr@2: * the version of the MMS Service Centre sending the response. williamr@2: * - Error codes 128 - 136 denote legacy errors from MMS encapsulation williamr@2: * version 1.0 williamr@2: * - Error codes 192 - 223 denote transient failures. williamr@2: * - Error codes 224 - 255 denote permanent failures. williamr@2: * - 0 means the response status has not been set. Either the operation was williamr@2: * successful or the cause of the failure was not set by MMS Service Centre. williamr@2: * @since 3.0 williamr@2: */ williamr@2: virtual TInt ResponseStatus() const; williamr@2: williamr@2: /** williamr@2: * Get number of times the message has been forwarded. williamr@2: * williamr@2: * Returns the number of previous senders in case of a message that williamr@2: * has been forwarded from one terminal to another based on the williamr@2: * MMS notification only without retrieving the actual message to williamr@2: * the terminal first. williamr@2: * williamr@2: * @return Number of times the message has been forwarded. williamr@2: * @since 3.0 williamr@2: */ williamr@2: virtual TInt NumberOfPreviousSenders() const; williamr@2: williamr@2: /** williamr@2: * Get the address of a previous sender. williamr@2: * williamr@2: * The addresses of the previous senders are defined for messages that williamr@2: * have been forwarded without fetching them to the terminal first. williamr@2: * williamr@2: * @param[in] aSequenceNumber Indicates the number of the sender in the williamr@2: * sequence. 1 is the first sender, a higher number indicates a later williamr@2: * sender. williamr@2: * @return Address of the specified previous sender. If the sequence number williamr@2: * exceeds the number of senders or is less than 1, an empty string is williamr@2: * returned. williamr@2: * @since 3.0 williamr@2: */ williamr@2: virtual TPtrC PreviousSender( TInt aSequenceNumber ) const; williamr@2: williamr@2: /** williamr@2: * Get the time when the message was previously sent (in UTC time). williamr@2: * williamr@2: * The function is valid only for messages that have been forwarded williamr@2: * without fetching them to the terminal first. williamr@2: * williamr@2: * @param[in] aSequenceNumber Indicates the number of the sender in the williamr@2: * sequence. 1 is the first sender, a higher number indicates a later williamr@2: * sender. williamr@2: * @return Time of the previous sending (in UTC time). If the sequence williamr@2: * number exceeds the number of senders or is less than 1, TTime(0) williamr@2: * is returned. williamr@2: * @since 3.0 williamr@2: */ williamr@2: virtual TTime PreviousSendingDate( TInt aSequenceNumber ) const; williamr@2: williamr@2: /** williamr@2: * Get the time when the message was received in the terminal. williamr@2: * williamr@2: * @return Time of the arrival of the message (in UTC time). williamr@2: * If the time has not been defined, TTime(0) is returned. williamr@2: * @since 3.0 williamr@2: */ williamr@2: virtual TTime MessageReceiveTime() const; williamr@2: williamr@2: /** williamr@2: * Get the incoming message size. williamr@2: * williamr@2: * This is valid only for a notification. williamr@2: * williamr@2: * @return Message size in octets as specified in MMS Notification. williamr@2: */ williamr@2: virtual TInt MessageTransferSize() const; williamr@2: williamr@2: /** williamr@2: * Get the Uri from which the message can be fetched. williamr@2: * williamr@2: * This is valid only for a nofification. williamr@2: * williamr@2: * @return Content location of the actual message, the Uri from which williamr@2: * the message is fetched from MMS Service Centre. williamr@2: */ williamr@2: virtual TPtrC8 MessageContentLocation() const; williamr@2: williamr@2: /** williamr@2: * Set id of the root part of the message. williamr@2: * williamr@2: * @param[in] aId Attachment Id of the message part which controls the williamr@2: * display of the message. Should point to the SMIL part if present. williamr@2: */ williamr@2: virtual void SetMessageRootL( const TMsvAttachmentId aId ); williamr@2: williamr@2: /** williamr@2: * Get the id of the root part of the message. williamr@2: * williamr@2: * @return Id of the attachment that starts the message display, williamr@2: * KMsvNullIndexEntryId if the root part has not been defined. williamr@2: */ williamr@2: virtual TMsvAttachmentId MessageRootAttachment() const; williamr@2: williamr@2: /** williamr@2: * Set the maximum size of the images that can be inserted in the message. williamr@2: * williamr@2: * @param[in] aHeight Image height in pixels. williamr@2: * @param[in] aWidth Image width in pixels. williamr@2: */ williamr@2: virtual void SetMaximumImage( TInt aWidth, TInt aHeight ); williamr@2: williamr@2: /** williamr@2: * Get the maximum size of the images that can be inserted in the message. williamr@2: * williamr@2: * The returned values are 0 if the maximum values have not been defined. williamr@2: * @param[out] aHeight image height in pixels williamr@2: * @param[out] aWidth image width in pixels williamr@2: */ williamr@2: virtual void GetMaximumImage( TInt& aWidth, TInt& aHeight ) const; williamr@2: williamr@2: // ------------------------------------------------------------------- williamr@2: // GENERAL MESSAGE INFORMATION METHODS williamr@2: williamr@2: /** williamr@2: * Get the message size. williamr@2: * williamr@2: * SaveMessageL and LoadMessageL updates the value. This function returns williamr@2: * the total amount of disk space the message takes. The actual message williamr@2: * size in transmission is smaller due to binary encoding of the headers. williamr@2: * williamr@2: * @return size of all message parts in bytes including both attachments williamr@2: * and internal header structures. williamr@2: */ williamr@2: virtual TInt32 MessageSize(); williamr@2: williamr@2: /** williamr@2: * Set the message description string. williamr@2: * williamr@2: * This provides a method to override the default message description. williamr@2: * The next SaveMessageL saves the description text in the williamr@2: * TMsvEntry::iDescription field. This field is shown in Message Centre williamr@2: * message lists to describe the contents of the message. Normally it is williamr@2: * the message subject, but if there is no subject in the message, the williamr@2: * caller may set some text from a text part of the message as the williamr@2: * description. williamr@2: * williamr@2: * Note that this method does not check the text length, so avoid long williamr@2: * descriptions to minimize memory usage. williamr@2: * williamr@2: * @param[in] aText Message description williamr@2: */ williamr@2: virtual void SetMessageDescriptionL( const TDesC& aText ); williamr@2: williamr@2: // --------------------------------------------------------------------- williamr@2: // FUNCTIONS TO HANDLE EXTRA MESSAGE ATTRIBUTES (FOR UI USE ONLY) williamr@2: williamr@2: /** williamr@2: * Add attribute to an attribute array (for the use of MMS UI only). williamr@2: * williamr@2: * No duplicates are allowed. If an attribute exists, its value is changed. williamr@2: * The attributes and their values can be arbitrary strings. There are no williamr@2: * restrictions. The purpose is to allow the UI to store some extra williamr@2: * information with the message. The values of the attibutes are not included williamr@2: * when the message is sent. williamr@2: * @param[in] aName Name of the attribute (case sensitive). williamr@2: * @param[in] aValue Value of the attribute. williamr@2: * williamr@2: * @leave KErrArgument if length of aName or aValue is 0. williamr@2: * @leave KErrNoMemory if memory runs out while adding the attribute. williamr@2: */ williamr@2: virtual void AddAttributeL( const TDesC& aName, const TDesC& aValue ); williamr@2: williamr@2: /** williamr@2: * Get value of an attribute (for the use of MMS UI only). williamr@2: * williamr@2: * @param[in] aName Name of the attribute (case sensitive). williamr@2: * @return Value of the attribute. williamr@2: * @leave KErrNotFound if attribute not found or the length of aName is 0. williamr@2: */ williamr@2: virtual TPtrC GetAttributeL( const TDesC& aName ); williamr@2: williamr@2: /** williamr@2: * Check if attribute is present (for the use of MMS UI only). williamr@2: * williamr@2: * @param[in] aName Name of the attribute (case sensitive). williamr@2: * @return ETrue if the attribute is found, EFalse otherwise. williamr@2: */ williamr@2: virtual TBool FindAttribute( const TDesC& aName ); williamr@2: williamr@2: /** williamr@2: * Delete named attribute from list (for the use of MMS UI only). williamr@2: * williamr@2: * @param[in] aName Name of the attribute (case sensitive). williamr@2: */ williamr@2: virtual void DeleteAttribute( const TDesC& aName ); williamr@2: williamr@2: /** williamr@2: * Reset all attributes (for the use of MMS UI only). williamr@2: * williamr@2: * Removes all attributes (names and values) from the message. williamr@2: */ williamr@2: virtual void ResetAttributes(); williamr@2: williamr@2: // ------------------------------------------------------------------- williamr@2: // FUNCTIONS TO HANDLE MESSAGE ATTACHMENTS williamr@2: williamr@2: /** williamr@2: * Create attachment entry and copy specified file to message store. williamr@2: * williamr@2: * The user should call SaveMessageL after having added all attachments williamr@2: * to update TMsvEntry of the message entry. williamr@2: * williamr@2: * @param[in] aStore An open edit store for the message entry. williamr@2: * Caller must commit and close the store when ready. (Several williamr@2: * attachments can be added before committing the store.) williamr@2: * @param[in] aFile Open file handle, source of the attachment. williamr@2: * Caller must close the file afterwards. williamr@2: * @param[in] aMimeType Mime type (content type) of the attachmet williamr@2: * in format type/subtype, for example image/jpeg. williamr@2: * @param[in] aMimeHeaders Mime headers for the attachment. If the content williamr@2: * type is not defined in aMimeHeaders, the function adds the mime type williamr@2: * and subtype from aMimeType. Suggested filename in aMimeHeaders is williamr@2: * used as attachment name. williamr@2: * @param[in] aAttachmentInfo Attachment into structure, must be williamr@2: * initialized to CMsvAttachment::EMsvFile. If mime type is added williamr@2: * into the attachment info, it must be of format type/subtype, williamr@2: * for example image/jpeg. On return AttachmentInfo contains data williamr@2: * about the attachment. Ownership of attachmentinfo is transferred williamr@2: * to attachment manager, it must not be deleted by caller. It must williamr@2: * not be put on cleanup stack either. MMS engine keeps it safe until williamr@2: * the ownership has been transferred. williamr@2: * @param[out] aAttaId Attachment id of the newly created attachment. williamr@2: * williamr@2: * @pre A message entry must exist. It may be a new entry or an old entry williamr@2: * to be edited. williamr@2: * @pre CMsvMimeHeaders structure must have been filled in advantage. williamr@2: * The following values should be set: williamr@2: * - Content type, for example image williamr@2: * - Content subtype, for example jpeg williamr@2: * - Character set IANA MIBEnum value, for example 106 (utf-8). Should be williamr@2: * defined only if the content type is text. williamr@2: * - Content-id if the presentation part refers to the attachments by williamr@2: * content-ids. williamr@2: * - Suggested filename (name only, no path), the name that should be williamr@2: * used to store the attachment and used as suggested filename williamr@2: * when sending the message. If the suggested filename is not set, the williamr@2: * name of the attachment file will be used. williamr@2: * - Content-location if the presentation part refers to the attachments by williamr@2: * using content-location. The content-location string must contain only williamr@2: * us-ascii characters. williamr@2: * - X-type parameters (if needed). These are always handled as pairs of a williamr@2: * parameter name and parameter value. A descriptor at an even idex williamr@2: * in the array (0, 2, 4, ...) represents the parameter name and a williamr@2: * descriptor at an odd index (1, 3, 5, ...) represents the parameter williamr@2: * value. If a parameter has no value, it must be indicated by an empty williamr@2: * descriptor. The X-type parameter array must always contain an even williamr@2: * number of elements. williamr@2: * williamr@2: * @code williamr@2: * // The following code shows a short example of how the attachement williamr@2: * // creation proceeds. williamr@2: * williamr@2: * // Assume that the client entry is set to the message entry. williamr@2: * // Attachments are added to the message entry one by one williamr@2: * CMsvStore* store = iMmsClient->Entry().EditStoreL(); williamr@2: * CleanupStack::PushL(store); williamr@2: * williamr@2: * CMsvAttachment* attaInfo = NULL; williamr@2: * TMsvAttachmentId attaId = 0; williamr@2: * williamr@2: * RFile attaFile; williamr@2: * // Set filename of attachment williamr@2: * TFileName name( _L("C:\\pictures\\picture123.jpg") ); williamr@2: * williamr@2: * CMsvMimeHeaders* mimeHeaders = CMsvMimeHeaders::NewL(); williamr@2: * CleanupStack::PushL( mimeHeaders ); williamr@2: * williamr@2: * // Set values to mime headers williamr@2: * mimeHeaders->SetContentTypeL( _L8( "image") ); williamr@2: * mimeHeaders->SetContentSubTypeL( _L8( "jpeg" ) ); williamr@2: * williamr@2: * _LIT8(KMimeType, "image/jpeg"); williamr@2: * // CreateAttachment2L will set the content type to attachment Info williamr@2: * williamr@2: * // Open the attachment file for reading williamr@2: * attaFile.Open( iFs, name, EFileShareReadersOnly | EFileRead ); williamr@2: * CleanupClosePushL(attaFile); williamr@2: * williamr@2: * attaInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); williamr@2: * // attaInfo ownerhip will be transferred to Attachment Manager. williamr@2: * // It must not be pushed onto the cleanupStack before calling williamr@2: * // CreateAttachment2L. williamr@2: * williamr@2: * TMsvAttachmentId attaId = 0; williamr@2: * williamr@2: * iMmsClient->CreateAttachment2L( williamr@2: * *store, // edit store williamr@2: * attaFile, // open file handle williamr@2: * KMimeType, // combination type like image/jpeg williamr@2: * *mimeHeaders, williamr@2: * attaInfo, williamr@2: * attaId); williamr@2: * // Now Attachment Manager owns the attaInfo williamr@2: * attaInfo = NULL; williamr@2: * williamr@2: * CleanupStack::PopAndDestroy(); // attaFile.Close() williamr@2: * CleanupStack::PopAndDestroy(); // mimeHeaders williamr@2: * williamr@2: * // Several attachments can be added before committing the store williamr@2: * williamr@2: * // Store must be committed before it is destroyed williamr@2: * store->CommitL(); williamr@2: * CleanupStack::PopAndDestroy(); // store williamr@2: * @endcode williamr@2: */ williamr@2: virtual void CreateAttachment2L( williamr@2: CMsvStore& aStore, williamr@2: RFile& aFile, williamr@2: TDesC8& aMimeType, williamr@2: CMsvMimeHeaders& aMimeHeaders, williamr@2: CMsvAttachment* aAttachmentInfo, williamr@2: TMsvAttachmentId& aAttaId); williamr@2: williamr@2: /** williamr@2: * Create a text/plain attachment. williamr@2: * williamr@2: * Creates a text attachment from text in a descriptor. williamr@2: * Has option to convert all unicode paragraph separator marks to williamr@2: * line feeds. williamr@2: * Converts text from unicode (ucs-2) to utf-8 before storing it. williamr@2: * williamr@2: * @param[in] aStore An open edit store. Caller must commit and close the williamr@2: * store (several attachments can be added before committing store). williamr@2: * @param[out] aAttachmentId Attachment id of the new attachment entry. williamr@2: * @param[in] aText Unicode text to be added as a text/plain attachment. williamr@2: * @param[in] aFile Suggested filename for the attachment. williamr@2: * @param[in] aConvertParagraphSeparator Flag that tells the function williamr@2: * to search for all 0x2029 characters (Unicode paragraph williamr@2: * separator) and to replace them with 0x000d 0x000a (carriage return, williamr@2: * line feed). williamr@2: * Possible values: williamr@2: * - ETrue: Convert paragraph separators (default). williamr@2: * - EFalse: Do not convert paragraph separators. williamr@2: * williamr@2: * @pre A message entry must exist. It may be a new entry or an old entry williamr@2: * to be edited. williamr@2: * williamr@2: * @code williamr@2: * williamr@2: * TFileName attachmentFile( _L("story.txt") ); williamr@2: * williamr@2: * CMsvStore* store = iMmsClient->Entry().EditStoreL(); williamr@2: * CleanupStack::PushL(store); williamr@2: * TMsvAttachmentId attaId = 0; williamr@2: * williamr@2: * TBufC<12> story = _L( "Hello world!" ); williamr@2: * williamr@2: * iMmsClient->CreateTextAttachmentL( williamr@2: * *store, williamr@2: * attaId, williamr@2: * story, williamr@2: * attachmentFile, williamr@2: * ETrue ) williamr@2: * williamr@2: * // When the call returns the id of the attachment will be strored in attaId williamr@2: * williamr@2: * // caller must commit the store as several attachments could be added berore williamr@2: * // committing the store. williamr@2: * store->CommitL(); williamr@2: * CleanupStack::PopAndDestroy(); // store williamr@2: * williamr@2: * @endcode williamr@2: */ williamr@2: virtual void CreateTextAttachmentL( williamr@2: CMsvStore& aStore, williamr@2: TMsvAttachmentId& aAttachmentId, williamr@2: const TDesC& aText, williamr@2: const TDesC& aFile, williamr@2: TBool aConvertParagraphSeparator = ETrue ); williamr@2: williamr@2: // ------------------------------------------------------------------- williamr@2: // MESSAGE HANDLING FUNCTIONS williamr@2: williamr@2: // NOTE: these are asynchronous functions williamr@2: williamr@2: /** williamr@2: * Send current message in the background. williamr@2: * williamr@2: * The message is automatically moved to Outbox folder before the williamr@2: * sending starts. williamr@2: * williamr@2: * @param[in] aCompletionStatus iStatus member of an active object. williamr@2: * It will be set as completed when the operating system has relayed williamr@2: * the request to the server side of Symbian Messaging System. williamr@2: * @param[in] aSendingTime Time at which the message is to be sent williamr@2: * given as UTC time. If aSending time is zero or in the past, the williamr@2: * message is scheduled to be sent as soon as possible. williamr@2: * @return Pointer to an operation active object. williamr@2: * The operation will complete when the sending has been successfully williamr@2: * scheduled. The actual sending will happen in the background. williamr@2: * If scheduling the send fails, the status of CMsvOperation will williamr@2: * contain the relevant error code. The operation object must not williamr@2: * be deleted before it completes. williamr@2: * williamr@2: * @leave KErrNoMemory or other Symbian error code. If the function leaves williamr@2: * the owner of aCompletionStatus must not be set active because there williamr@2: * will be no pending request. williamr@2: */ williamr@2: virtual CMsvOperation* SendL( TRequestStatus& aCompletionStatus, williamr@2: const TTime aSendingTime = TTime( 0 ) ); williamr@2: williamr@2: /** williamr@2: * Send a selection of messages in the background. williamr@2: * williamr@2: * The messages are moved to Outbox folder before the sending starts. williamr@2: * All messages must be in the same place originally williamr@2: * (all in drafts, or all in outbox, for example). williamr@2: * williamr@2: * @param[in] aSelection List of messages to be sent. williamr@2: * @param[in] aCompletionStatus iStatus member of an active object. williamr@2: * It will be set as completed when the operating system has relayed williamr@2: * the request to the server side of Symbian Messaging System. williamr@2: * @param aSendingTime Time at which the message selection is to be sent williamr@2: * given as UTC time. If aSending time is zero or in the past, the williamr@2: * message is scheduled to be sent as soon as possible. williamr@2: * @return Pointer to an operation active object. williamr@2: * The operation will complete when the sending has been successfully williamr@2: * scheduled. The actual sending will happen in the background. williamr@2: * If scheduling the send fails, the status of CMsvOperation will williamr@2: * contain the relevant error code. The operation object must not williamr@2: * be deleted before it completes. williamr@2: * williamr@2: * @leave KErrNotFound if aSelection is empty, or other Symbian error code. williamr@2: * If the function leaves the owner of aCompletionStatus must not be set williamr@2: * active because there will be no pending request. williamr@2: */ williamr@2: virtual CMsvOperation* SendL( williamr@2: CMsvEntrySelection& aSelection, williamr@2: TRequestStatus& aCompletionStatus, williamr@2: TTime aSendingTime = TTime( 0 ) ); williamr@2: williamr@2: /** williamr@2: * Fetch pending MMS messages from MMS Service Centre to inbox. williamr@2: * williamr@2: * If there are notifications in postponed state they are all fetched. williamr@2: * If there are notification in inbox, they are not touched. williamr@2: * williamr@2: * @param[in] aCompletionStatus iStatus member of an active object. williamr@2: * It will be set as completed when the operating system has relayed williamr@2: * the request to the server side of Symbian Messaging System. williamr@2: * @param[in] aForced indicates if the messages should be fetched williamr@2: * regardless of current mode settings. williamr@2: * - ETrue: User initiated fetch, use override. williamr@2: * - EFalse: Event triggered fetch, fetch only if settings allow. williamr@2: * @return Pointer to an operation active object. williamr@2: * The operation will complete when the retrieving has been successfully williamr@2: * scheduled. The actual retrieving will happen in the background. williamr@2: * If scheduling the fetch fails, the status of CMsvOperation will williamr@2: * contain the relevant error code. The operation object must not williamr@2: * be deleted before it completes. williamr@2: * williamr@2: * @leave KErrNoMemory or other Symbian error code. If the function leaves williamr@2: * the owner of aCompletionStatus must not be set active because there williamr@2: * will be no pending request. williamr@2: * williamr@2: * @deprecated Postponed fetching mode is no longer supported by UI. In most williamr@2: * cases this function would not have any effect. williamr@2: */ williamr@2: virtual CMsvOperation* FetchAllL( TRequestStatus& aCompletionStatus, williamr@2: TBool aForced = ETrue ); williamr@2: williamr@2: /** williamr@2: * Send a read report to the sender of a message. williamr@2: * williamr@2: * This function should be called when a new message is opened and the williamr@2: * sender of the message has specified that he wants a read report williamr@2: * for the message in question. This function should not be called williamr@2: * if the settings indicate that sending read reports is not allowed. williamr@2: * williamr@2: * @param[in] aReadMessageId Id of the message for which a read report williamr@2: * should be sent. The message must not be locked and the caller williamr@2: * should not have CMsvStore open for the message as MMS Client Mtm williamr@2: * must be able to read header fields from the original message. williamr@2: * @param[in] aCompletionStatus iStatus member of an active object. williamr@2: * It will be set as completed when the operating system has relayed williamr@2: * the request to the server side of Symbian Messaging System. williamr@2: * @param[in] aReadStatus indicates if the message was read williamr@2: * Possible values: williamr@2: * - EMmsReadStatusRead: The message was read. williamr@2: * - EMmsReadStatusDeletedWithoutBeingRead: The message was deleted williamr@2: * without being read. williamr@2: * @return Pointer to an operation active object. williamr@2: * The operation will complete when the sending of the read report williamr@2: * has been successfully scheduled. The actual sending will happen williamr@2: * in the background. If scheduling the send fails, the status of williamr@2: * CMsvOperation will contain the relevant error code. williamr@2: * If the sender of the message has not requested a read report or williamr@2: * read report sending is not allowed, the operation completes williamr@2: * with error code KErrGeneral. williamr@2: * The operation object must not be deleted before it completes. williamr@2: * williamr@2: * @leave KErrLocked if the message entry cannot be accessed. williamr@2: */ williamr@2: virtual CMsvOperation* SendReadReportL( TMsvId aReadMessageId, williamr@2: TRequestStatus& aCompletionStatus, williamr@2: TMmsReadStatus aReadStatus = EMmsReadStatusRead ); williamr@2: williamr@2: public: // FUNCTIONS FROM BASE CLASSES williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Return type of this Mtm. williamr@2: * @return Registered Mtm type. williamr@2: */ williamr@2: inline TUid Type() const; williamr@2: williamr@2: williamr@2: // Context specific functions williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Set current context. williamr@2: * @param[in] aEntry Pointer to entry instance. williamr@2: */ williamr@2: inline void SetCurrentEntryL( CMsvEntry* aEntry ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Switch context to entry defined by aId. williamr@2: * @param[in] aId Entry id in message store. williamr@2: */ williamr@2: inline void SwitchCurrentEntryL( TMsvId aId ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Get reference to current entry. williamr@2: * @return Reference to entry instance. williamr@2: */ williamr@2: inline CMsvEntry& Entry() const; williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Query if entry context has been set. williamr@2: * @return Status, possible values: williamr@2: * - ETrue: Context has been set. williamr@2: * - EFalse: Context has not been set. williamr@2: */ williamr@2: inline TBool HasContext() const; williamr@2: williamr@2: // Message specific functions williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Store current entry data. williamr@2: */ williamr@2: void SaveMessageL(); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Restore current entry data. williamr@2: */ williamr@2: void LoadMessageL(); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Checks that selected parts of current message are williamr@2: * legal. williamr@2: * @param[in] aPartList Flags specifying which parts to validate. williamr@2: * (defined in MTMDEF.H). Possible values: williamr@2: * - KMsvMessagePartPartBody: Ignored. MMS engine does not support williamr@2: * separate message body. williamr@2: * - KMsvMessagePartRecipient: Supported. williamr@2: * - KMsvMessagePartOriginator Supported. williamr@2: * - KMsvMessagePartDescription: Ignored. Description is always valid williamr@2: * - KMsvMessagePartDate: Ignored. Date is always valid williamr@2: * - KMsvMessagePartAttachments: Supported. williamr@2: * @return TMsvPartList bitmask identifies each invalid part. If all parts williamr@2: * are valid, returned value is 0. williamr@2: */ williamr@2: TMsvPartList ValidateMessage( TMsvPartList aPartList ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Searches for specified text in selected parts of williamr@2: * current message. williamr@2: * @param[in] aTextToFind Text to search for. williamr@2: * @param aPartList Flags specifying which parts to search. williamr@2: * (defined in MTMDEF.H). Possible values: williamr@2: * - KMsvMessagePartPartBody: Ignored. williamr@2: * - KMsvMessagePartRecipient: Supported. williamr@2: * - KMsvMessagePartOriginator: Supported. williamr@2: * - KMsvMessagePartDescription: Supported. williamr@2: * - KMsvMessagePartDate: Ignored. williamr@2: * - KMsvMessagePartAttachments: Ignored. williamr@2: * @return TMsvPartList bitmask specifies in which of the specified parts the text williamr@2: * was found. williamr@2: */ williamr@2: TMsvPartList Find( const TDesC& aTextToFind, TMsvPartList aPartList ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Send a reply to current message. williamr@2: * williamr@2: * @param[in] aDestination Id of the folder where the reply is generated. williamr@2: * @param[in] aPartlist Flags specifying which standard message parts williamr@2: * are to be included in the response (defined in MTMDEF.H). Following williamr@2: * values are possible: williamr@2: * - KMsvMessagePartPartBody: Ignored. williamr@2: * - KMsvMessagePartRecipient: Causes reply-to-all. Otherwise reply-to-sender williamr@2: * only. williamr@2: * - KMsvMessagePartOriginator: Ignored. williamr@2: * - KMsvMessagePartDescription: Subject field is copied. williamr@2: * - KMsvMessagePartDate: Ignored. williamr@2: * - KMsvMessagePartAttachments: Ignored. Attachments are never copied to a reply. williamr@2: * @param[in] aCompletionStatus Status of an active object. This status williamr@2: * will be set as completed when the operation completes. williamr@2: * @return Pointer to an operation active object. The progress information williamr@2: * provides the id of the created message when the operation is complete. williamr@2: * If there was an error while creating the message, then the message williamr@2: * will be deleted and the result will contain a null id. williamr@2: * The operation object must not be deleted before it completes. williamr@2: */ williamr@2: CMsvOperation* ReplyL( williamr@2: TMsvId aDestination, williamr@2: TMsvPartList aPartlist, williamr@2: TRequestStatus& aCompletionStatus ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Forward current message to new recipient. williamr@2: * williamr@2: * @param[in] aDestination Id of the folder where the new message williamr@2: * is generated. williamr@2: * @param[in] aPartList Flags specifying which standard message parts williamr@2: * are to be included in the response. Possible values: williamr@2: * - KMsvMessagePartPartBody: Ignored. williamr@2: * - KMsvMessagePartRecipient: Ignored. williamr@2: * - KMsvMessagePartOriginator: Ignored. williamr@2: * - KMsvMessagePartDescription: Subject field is copied. williamr@2: * - KMsvMessagePartDate: Ignored. williamr@2: * - KMsvMessagePartAttachments: Ignored. Attachments are always williamr@2: * automatically included when forwarding a message. williamr@2: * @param[in] aCompletionStatus Status of an active object. This status williamr@2: * will be set as completed when the operation completes. williamr@2: * @return Pointer to an operation active object. The progress information williamr@2: * provides the id of the created message when the operation is complete. williamr@2: * If there was an error while creating the message, then the message williamr@2: * will be deleted and the result will contain a null id. williamr@2: * The operation object must not be deleted before it completes. williamr@2: */ williamr@2: CMsvOperation* ForwardL( williamr@2: TMsvId aDestination, williamr@2: TMsvPartList aPartList, williamr@2: TRequestStatus& aCompletionStatus ); williamr@2: williamr@2: /** williamr@2: * New recipient list function is not virtual, and the base MTM williamr@2: * implementation must always be used. williamr@2: * The function is shown here for reference only: williamr@2: * williamr@2: * const CMsvRecipientList& AddresseeList() const; williamr@2: */ williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Adds an addressee, cannot distiguish To, Cc, and Bcc. williamr@2: * williamr@2: * New addresses are handled as To type of addresses. williamr@2: * @param[in] aRealAddress Recipient address without alias. williamr@2: */ williamr@2: void AddAddresseeL( const TDesC& aRealAddress ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Adds an addressee, cannot distiguish To, Cc, and Bcc. williamr@2: * williamr@2: * New addresses are handled as To type of addresses. williamr@2: * @param[in] aRealAddress Recipient address. williamr@2: * @param[in] aAlias Descriptive name for the recipient. williamr@2: */ williamr@2: void AddAddresseeL( const TDesC& aRealAddress, const TDesC& aAlias ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Adds a typed addressee (To, Cc or Bcc). williamr@2: * williamr@2: * @param[in] aType recipient type. Possible values: williamr@2: * - EMsvRecipientTo: Normal recipient. williamr@2: * - EMsvRecipientCc: Recipient of a carbon copy. williamr@2: * - EMsvRecipientBcc: Recipient of a blind carbon copy. williamr@2: * @param[in] aRealAddress Address string without alias. williamr@2: */ williamr@2: virtual void AddAddresseeL( williamr@2: TMsvRecipientType aType, williamr@2: const TDesC& aRealAddress); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Adds a typed addressee (To, Cc or Bcc). williamr@2: * williamr@2: * @param[in] aType recipient type. Possible values: williamr@2: * - EMsvRecipientTo: Normal recipient. williamr@2: * - EMsvRecipientCc: Recipient of a carbon copy. williamr@2: * - EMsvRecipientBcc: Recipient of a blind carbon copy. williamr@2: * @param[in] aRealAddress Address string without alias. williamr@2: * @param[in] aAlias Descriptive name for the recipient. williamr@2: */ williamr@2: virtual void AddAddresseeL( williamr@2: TMsvRecipientType aType, williamr@2: const TDesC& aRealAddress, williamr@2: const TDesC& aAlias); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Removes an entry from addressee list. williamr@2: * williamr@2: * Cannot distinguish To, Cc and Bcc. williamr@2: * @param[in] aIndex Index to the array of addresses from williamr@2: * AddresseeList() function. williamr@2: */ williamr@2: void RemoveAddressee( TInt aIndex ); williamr@2: williamr@2: // Note: rich text body not supported in MMS Message encapsulation. williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Get rich text body of the message. williamr@2: * williamr@2: * MMS does not support separate message body. Body is ignored. williamr@2: * All MMS message parts are attachments. williamr@2: * @return Rich text body from CBaseMtm. williamr@2: */ williamr@2: inline CRichText& Body(); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Get rich text body. williamr@2: * williamr@2: * MMS does not support separate message body. Body is ignored. williamr@2: * All MMS message parts are attachments. williamr@2: * @return Rich text body from CBaseMtm. williamr@2: */ williamr@2: inline const CRichText& Body() const; williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Set message subject. williamr@2: * @param[in] aSubject Message subject. williamr@2: */ williamr@2: void SetSubjectL( const TDesC& aSubject ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Get message subject. williamr@2: * @return Message subject. williamr@2: */ williamr@2: const TPtrC SubjectL() const; williamr@2: williamr@2: // General MTM-specific functionality williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Query capabilities of MTM. williamr@2: * williamr@2: * @param[in] aCapability UID specifying which capablity is queried. williamr@2: * For the possible Capability UIDs and types of return values williamr@2: * see mtmuids.h williamr@2: * @param[out] aResponse The value describing the capability at return. williamr@2: * @return error code, Possible values: williamr@2: * - KErrNone: Specified capability is supported and aResponse williamr@2: * contains the value of the capability if available. williamr@2: * - KErrNotSupported: Capability is not supported. williamr@2: */ williamr@2: TInt QueryCapability( TUid aCapability, TInt& aResponse ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Pass a request to MMS Server MTM. williamr@2: * williamr@2: * Pass a function code to Server MTM, wait until the williamr@2: * function returns. This function can be used to williamr@2: * invoke synchronous protocol-specific operations. williamr@2: * The supported functions are private and this function should williamr@2: * be called by MMS UI only. williamr@2: * @param[in] aFunctionId Enumeration constant defining the operation. williamr@2: * @param[in] aSelection Array of message entry ids to be operated on. williamr@2: * @param[in] aParameter A descriptor that contains any parameters williamr@2: * required by function specified by aFunctionId. williamr@2: */ williamr@2: void InvokeSyncFunctionL( williamr@2: TInt aFunctionId, williamr@2: const CMsvEntrySelection& aSelection, williamr@2: TDes8& aParameter ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Pass an asychronous request to Server MTM. williamr@2: * williamr@2: * Pass a function code to Server MTM. The operation will williamr@2: * run in the background. This function can be used to williamr@2: * invoke asynchronous protocol-specific operations. williamr@2: * The supported functions are private and this function should williamr@2: * be called by MMS UI only. williamr@2: * @param[in] aFunctionId Enumeration constant defining the operation. williamr@2: * @param[in] aSelection Array of message entry ids to be uperated on. williamr@2: * @param[in] aParameter A descriptor that contains any parameters williamr@2: * required by function specified by aFunctionId. williamr@2: * @param[in] aCompletionStatus Status of an active object. williamr@2: * This status will be set as completed when the operation completes williamr@2: * @return Pointer to a message server operation (active object). williamr@2: */ williamr@2: CMsvOperation* InvokeAsyncFunctionL( williamr@2: TInt aFunctionId, williamr@2: const CMsvEntrySelection& aSelection, williamr@2: TDes8& aParameter, williamr@2: TRequestStatus& aCompletionStatus ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Return session that was set at initialization. williamr@2: * @return Reference to Message Server session object. williamr@2: */ williamr@2: inline CMsvSession& Session(); williamr@2: williamr@2: // Functions for SendAs support williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Add a file attachment to the current message entry. williamr@2: * williamr@2: * The attachment is referenced by its file path and is copied into the williamr@2: * message store. williamr@2: * This function needs an edit store for the current entry. williamr@2: * The caller should not keep the store open. williamr@2: * The store is committed and closed after each attachment operation. williamr@2: * Only one asynchronous operation can be running at any one time. williamr@2: * williamr@2: * If the file is a plain text file with ucs-2 character set MMS Engine williamr@2: * will convert the character set to utf-8 and create a text attachment williamr@2: * using this character set. The original file is not affected. This williamr@2: * must be done because MMS text attachments should be sent using williamr@2: * utf-8 character set. williamr@2: * williamr@2: * @param[in] aFilePath Full path specification of the attachment file. williamr@2: * @param[in] aMimeType Mime type of the attachment file. williamr@2: * @param[in] aCharset IANA MIBEnum of the character set of the attachment. williamr@2: * If character set is not relevant for current attachment type, williamr@2: * aCharset should be 0. williamr@2: * @param[in] aStatus The request status to complete. williamr@2: * @leave System-wide error codes. williamr@2: * williamr@2: * @code williamr@2: * williamr@2: * TFileName attachmentFile( _L("c:\\pictures\\picture123.jpg") ); williamr@2: * TBufC8<20> mimeType = _L8( "image/jpeg" ); williamr@2: * TUint charset = 0; // no character set needed for images williamr@2: * williamr@2: * CMsvOperationActiveSchedulerWait* wait = williamr@2: * CMsvOperationActiveSchedulerWait::NewLC(); williamr@2: * williamr@2: * iMmsClient->AddAttachmentL( williamr@2: * attachmentFile, williamr@2: * mimeType, williamr@2: * charset, williamr@2: * wait->iStatus); williamr@2: * williamr@2: * wait->Start(); williamr@2: * williamr@2: * if ( wait->iStatus.Int() != KErrNone ) williamr@2: * { williamr@2: * // error handling, e.g. leave williamr@2: * } williamr@2: * williamr@2: * CleanupStack::PopAndDestroy(); // wait williamr@2: * williamr@2: * // The attachment has been added, store has been committed, and attachment data williamr@2: * // has been copied to the message store. williamr@2: * // If the original file is now modified, it does not affect the attachment file williamr@2: * // in the message store any more. williamr@2: * williamr@2: * @endcode williamr@2: */ williamr@2: void AddAttachmentL( const TDesC& aFilePath, williamr@2: const TDesC8& aMimeType, williamr@2: TUint aCharset, williamr@2: TRequestStatus& aStatus ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Add a file attachment to the current message entry. williamr@2: * williamr@2: * The attachment is referenced by an open file handle and is copied williamr@2: * into the message store. williamr@2: * This function needs an edit store for the current entry. williamr@2: * The caller should not keep the store open. williamr@2: * The store is committed and closed after each attachment operation. williamr@2: * williamr@2: * If the file is a plain text file with ucs-2 character set MMS Engine williamr@2: * will convert the character set to utf-8 and create a text attachment williamr@2: * using this character set. The original file is not affected. This williamr@2: * must be done because MMS text attachments should be sent using williamr@2: * utf-8 character set. williamr@2: * williamr@2: * Only one asynchronous operation can be running at any one time. williamr@2: * @param[in] aFile An open file handle for the file attachment. The handle williamr@2: * is closed when the function completes. williamr@2: * @param[in] aMimeType Mime type of the attachment file. williamr@2: * @param[in] aCharset IANA MIBEnum of the character set of the attachment. williamr@2: * If character set is not relevant for current attachment type, williamr@2: * aCharset should be 0. williamr@2: * @param[in] aStatus The request status to complete. williamr@2: * @leave System-wide error codes. williamr@2: * williamr@2: * The function closes the file handle when done. The caller must not attempt williamr@2: * to close the file handle afterwards. williamr@2: * williamr@2: * @code williamr@2: * williamr@2: * TFileName attachmentFile( _L("c:\\private\\privatedir\\picture123.jpg") ); williamr@2: * RFile fileHandle; williamr@2: * TBufC8<20> mimeType = _L8( "image/jpeg" ); williamr@2: * TUint charset = 0; // no character set needed for images williamr@2: * williamr@2: * fileHandle.Open( iFs, attachmentFile, EFileShareReadersOnly | EFileRead ); williamr@2: * CleanupClosePush(fileHandle); williamr@2: * williamr@2: * CMsvOperationActiveSchedulerWait* wait = williamr@2: * CMsvOperationActiveSchedulerWait::NewLC(); williamr@2: * williamr@2: * iMmsClient->AddAttachmentL( williamr@2: * fileHandle, williamr@2: * mimeType, williamr@2: * charset, williamr@2: * wait->iStatus); williamr@2: * williamr@2: * wait->Start(); williamr@2: * williamr@2: * if ( wait->iStatus.Int() != KErrNone ) williamr@2: * { williamr@2: * // error handling, e.g. leave williamr@2: * } williamr@2: * williamr@2: * CleanupStack::PopAndDestroy(); // wait williamr@2: * CleanupStack::Pop(); // file handle was closed if function did not leave williamr@2: * williamr@2: * @endcode williamr@2: */ williamr@2: void AddAttachmentL( RFile& aFile, williamr@2: const TDesC8& aMimeType, williamr@2: TUint aCharset, williamr@2: TRequestStatus& aStatus ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Add a file attachment to the current message entry williamr@2: * as a linked file. williamr@2: * williamr@2: * The attachment is referenced by its file path and is not copied williamr@2: * into the message store. The attachment file is always used from williamr@2: * its original location on disk indicated by the aFilePath williamr@2: * parameter. williamr@2: * williamr@2: * This function needs an edit store for the current entry. williamr@2: * The caller should not keep the store open. williamr@2: * The store is committed and closed after each attachment operation. williamr@2: * Only one asynchronous operation can be running at any one time. williamr@2: * williamr@2: * The file must be in some public directory so that MMS Engine can access williamr@2: * the file when it is actually sent. If the file is a plain text attachment williamr@2: * the character set cannot be converted to utf-8 as the original file cannot williamr@2: * be changed. Text files should not be sent as linked attachmets unless the williamr@2: * character set of the file is utf-8. williamr@2: * williamr@2: * @param[in] aFilePath Full path specification of the attachment file. williamr@2: * @param[in] aMimeType Mime type of the attachment file. williamr@2: * @param[in] aCharset IANA MIBEnum of the character set of the attachment. williamr@2: * If character set is not relevant for current attachment type, williamr@2: * aCharset should be 0. williamr@2: * @param[in] aStatus The request status to complete. williamr@2: * @leave System-wide error codes. williamr@2: */ williamr@2: void AddLinkedAttachmentL( const TDesC& aFilePath, williamr@2: const TDesC8& aMimeType, williamr@2: TUint aCharset, williamr@2: TRequestStatus& aStatus ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Add a message entry as an attachment to the current williamr@2: * message entry. williamr@2: * williamr@2: * Not supported. No Message attachments allowed in MMS. williamr@2: * @leave KErrNotSupported williamr@2: */ williamr@2: void AddEntryAsAttachmentL( TMsvId aAttachmentId, williamr@2: TRequestStatus& aStatus ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Create an attachment and return an open file handle for it. williamr@2: * williamr@2: * This function needs an edit store for the current entry. williamr@2: * The caller should not keep the store open. williamr@2: * The store is committed and closed after each attachment operation. williamr@2: * Only one asynchronous operation can be running at any one time. williamr@2: * williamr@2: * @param[in] aFileName Suggested filename. williamr@2: * @param[out] aAttachmentFile An open file handle for read/write williamr@2: * attachment file. The caller must close the handle. williamr@2: * @param[in] aMimeType Mime type of the attachment file. williamr@2: * @param[in] aCharset IANA MIBEnum of the character set of the attachment. williamr@2: * If character set is not relevant for current attachment type, williamr@2: * aCharset should be 0. williamr@2: * @param[in] aStatus The request status to complete. williamr@2: * @leave System-wide error codes. williamr@2: * williamr@2: * @code williamr@2: * TFileName attachmentFile( _L("picture123.jpg") ); williamr@2: * RFile fileHandle; williamr@2: * TBufC8<20> mimeType = _L8( "image/jpeg" ); williamr@2: * TUint charset = 0; // no character set needed for images williamr@2: * williamr@2: * CMsvOperationActiveSchedulerWait* wait = williamr@2: * CMsvOperationActiveSchedulerWait::NewLC(); williamr@2: * williamr@2: * iMmsClient->CreateAttachmentL( williamr@2: * attachmentFile, williamr@2: * fileHandle, williamr@2: * mimeType, williamr@2: * charset, williamr@2: * wait->iStatus); williamr@2: * williamr@2: * wait->Start(); williamr@2: * williamr@2: * // When the function returns, the store has been committed williamr@2: * williamr@2: * // The attachment file handle is now open for writing the attachment data williamr@2: * CleanupClosePush(fileHandle); williamr@2: * williamr@2: * if ( wait->iStatus.Int() != KErrNone ) williamr@2: * { williamr@2: * // error handling, e.g. leave williamr@2: * } williamr@2: * williamr@2: * // write file content to open handle williamr@2: * // ... williamr@2: * williamr@2: * CleanupStack::PopAndDestroy(); // close file handle williamr@2: * CleanupStack::PopAndDestroy(); // wait williamr@2: * williamr@2: * @endcode williamr@2: */ williamr@2: void CreateAttachmentL( const TDesC& aFileName, williamr@2: RFile& aAttachmentFile, williamr@2: const TDesC8& aMimeType, williamr@2: TUint aCharset, williamr@2: TRequestStatus& aStatus); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Cancel the current attachment operation. williamr@2: */ williamr@2: void CancelAttachmentOperation(); williamr@2: williamr@2: // End of attachment funtions to support SendAs williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Create an empty entry as the child of the current context. williamr@2: * williamr@2: * Sets the new entry as current context. williamr@2: * The entry will be invisible and under construction. williamr@2: * williamr@2: * @param[in] aServiceId Service id for the new entry. williamr@2: * williamr@2: * @code williamr@2: * // Context must be set to parent folder for CreateMessageL williamr@2: * // This example creates the message to drafts folder williamr@2: * williamr@2: * TMsvId serviceId = iMmsClient->DefaultServiceL(); williamr@2: * iMmsClient->SwitchCurrentEntryL( KMsvDraftEntryId ); williamr@2: * iMmsClient->CreateMessageL( serviceId ); williamr@2: * williamr@2: * // The message entry is invisible and in "In Preparation" state. williamr@2: * // The context of CMmsClientMtm has now been switched to the new message entry. williamr@2: * // The message entry is still completely empty. williamr@2: * // Continue by adding data to the message williamr@2: * // ... williamr@2: * @endcode williamr@2: */ williamr@2: void CreateMessageL( TMsvId aServiceId ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Inform Client MTM about bio type change. williamr@2: * williamr@2: * This function does nothing. williamr@2: */ williamr@2: void BioTypeChangedL( TUid aBioTypeUid ); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Return id of default service for this MTM type. williamr@2: * williamr@2: * Only one MMS service is supported. williamr@2: * @return default service id. williamr@2: */ williamr@2: TMsvId DefaultServiceL() const; williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Remove default service. williamr@2: * williamr@2: * Does nothing. Deletion of service not supported. williamr@2: */ williamr@2: void RemoveDefaultServiceL(); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Change default service. williamr@2: * williamr@2: * Does nothing. Changing of default service not supported. williamr@2: */ williamr@2: void ChangeDefaultServiceL(const TMsvId& aService); williamr@2: williamr@2: protected: // New functions williamr@2: williamr@2: /** williamr@2: * Lists all visible and free MMS Notifications from inbox. williamr@2: * @return selection of Notifications in inbox. williamr@2: * @since 2.8 williamr@2: */ williamr@2: CMsvEntrySelection* ListNotificationsInInboxL(); williamr@2: williamr@2: protected: // Functions from base classes williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: Called after the context of this instance williamr@2: * has been changed to another entry. williamr@2: */ williamr@2: void ContextEntrySwitched(); williamr@2: williamr@2: /** williamr@2: * From CBaseMtm: React to changes williamr@2: * @param[in] aEvent Code that tells which event has occurred. williamr@2: * Event codes defined in MSVAPI.H williamr@2: * @param[in] arg1 Depends on Event williamr@2: * @param[in] arg2 Depends on Event williamr@2: * @param[in] arg3 Depends on Event williamr@2: */ williamr@2: void HandleEntryEventL( williamr@2: TMsvEntryEvent aEvent, williamr@2: TAny* arg1, williamr@2: TAny* arg2, williamr@2: TAny* arg3 ); williamr@2: williamr@2: /** williamr@2: * By default Symbian OS constructor is private. williamr@2: * @param[in] aRegisteredMtmDll Reference to Mtm Dll registry class williamr@2: * @param[in] aSession Reference to a Message Server session. williamr@2: */ williamr@2: CMmsClientMtm( williamr@2: CRegisteredMtmDll& aRegisteredMtmDll, williamr@2: CMsvSession& aSession ); williamr@2: williamr@2: void ConstructL(); williamr@2: williamr@2: private: williamr@2: williamr@2: /** williamr@2: * Build the iAddresseeList from the iMmsHeaders data. williamr@2: */ williamr@2: void BuildAddresseeListL(); williamr@2: williamr@2: /** williamr@2: * Add entries from the the specified array to iAddresseeList. williamr@2: * @param aArray recipient array. williamr@2: * @param aValue recipient type. williamr@2: */ williamr@2: void BuildAddresseeListL( williamr@2: const CDesCArray& aArray, TMsvRecipientType aValue); williamr@2: williamr@2: /** williamr@2: * Attachments size williamr@2: * @return size of all attachments, binary data + mime headers. williamr@2: */ williamr@2: TInt32 AttachmentsSizeL(); williamr@2: williamr@2: /** williamr@2: * List notifications in MMS folder. williamr@2: * @return selection of notifications williamr@2: */ williamr@2: CMsvEntrySelection* ListMmsFolderNotificationsL(); williamr@2: williamr@2: /** williamr@2: * List notifications in inbox - only for mode switch fetch. williamr@2: * @return selection of notifications williamr@2: */ williamr@2: CMsvEntrySelection* ListInboxNotificationsL(); williamr@2: williamr@2: /** williamr@2: * Fetch messages corresponding to unhandled notifications in ibox williamr@2: * This function is needed only when the fetching mode is changed williamr@2: * @param[in] aCompletionStatus iStatus member of an active object. williamr@2: * It will be set as completed when the request has finished. williamr@2: * @aparam[in] aForced indicates if the messages should be fetched williamr@2: * regardless of current mode settings. williamr@2: * ETrue = user initiated fetch, use override williamr@2: * EFalse = event triggered fetch, fetch only if settings allow. williamr@2: * @return pointer to an operation active object. williamr@2: * If successful, this is an asynchronously completing operation. williamr@2: * If failed, this is a completed operation, with status set to williamr@2: * the relevant error code. williamr@2: */ williamr@2: CMsvOperation* FetchAllFromInboxL( TRequestStatus& aCompletionStatus, williamr@2: TBool aForced = ETrue ); williamr@2: williamr@2: /** williamr@2: * Convert date time from UTC to local time. williamr@2: * @param aDate UTC date time williamr@2: * @return local time williamr@2: */ williamr@2: // all times expressed in global time zone - no conversions williamr@2: /* williamr@2: TInt64 ConvertUTCDateToLocal( TInt64 aDate ) const; williamr@2: */ williamr@2: williamr@2: /** williamr@2: * Find text from the given recipient list. williamr@2: * @param[in] aTextToFind a text to be searched williamr@2: * @param[in] aPartList message part list williamr@2: * @param[in] aRecipients the recipient list williamr@2: * @param[in] aFindText CMsvFindText object to help in the find williamr@2: * @return ETrue if match found. williamr@2: */ williamr@2: TBool FindInRecipientL( williamr@2: const TDesC& aTextToFind, williamr@2: TMsvPartList aPartlist, williamr@2: const CDesCArray& aRecipients, williamr@2: CMsvFindText& aFindText ); williamr@2: williamr@2: /** williamr@2: * Add an attachment from public location either as copied file or williamr@2: * linked file. williamr@2: * @param[in] aFilePath The full path specification of the attachment file. williamr@2: * @param[in] aMimeType The mime type of the attachment file. williamr@2: * @param[in] aType CMsvAttachment::EMsvFile or williamr@2: * CMsvAttachment::EMsvLinkedFile williamr@2: * @param[in] aStatus The request status to complete when request has williamr@2: * completed. williamr@2: * @param[in] aCharacter set IANA MIBEnum of the character set for the williamr@2: * attachment if needed. williamr@2: */ williamr@2: void AddFilePathAttachmentL(const TDesC& aFilePath, williamr@2: const TDesC8& aMimeType, williamr@2: CMsvAttachment::TMsvAttachmentType aType, williamr@2: TRequestStatus& aStatus, williamr@2: const TUint aCharacterSet = 0 ); williamr@2: williamr@2: /** williamr@2: * Store attribures to attribute stream in message entry williamr@2: * @param[in] aStore message store williamr@2: */ williamr@2: void StoreAttributesL( CMsvStore& aStore ); williamr@2: williamr@2: /** williamr@2: * Restore attribures from attribute stream in message entry williamr@2: * @param[in] aStore message store williamr@2: */ williamr@2: void RestoreAttributesL( CMsvStore& aStore ); williamr@2: williamr@2: /** williamr@2: * Checks whether given sample is UTF16 text. williamr@2: * @since 3.0 williamr@2: * @param[in] aSample text sample williamr@2: * @return 1015 if the sample starts with unicode BOM williamr@2: * (unicode with explicit byte mark) williamr@2: * 0 otherwise williamr@2: */ williamr@2: TUint GetUnicodeCharacterSet( TDesC8& aSample ); williamr@2: williamr@2: /** williamr@2: * Reads bytes from so that sample is full or if file is shorter than williamr@2: * sample then read whole file. williamr@2: * @since 3.0 williamr@2: * @param[in] aFile open file handle to read bytes from williamr@2: * @param[out] aSample sample buffer filled with data williamr@2: */ williamr@2: void ReadBytesFromFileL( const RFile aFile, TDes8& aSample ); williamr@2: williamr@2: /** williamr@2: * Tries to recognize character set from given sample. williamr@2: * @since 3.0 williamr@2: * @param[in] aFile File to be recognized williamr@2: * @return CharConv UID of the character set williamr@2: */ williamr@2: TUint RecognizeCharSetL( RFile& aFile ); williamr@2: williamr@2: williamr@2: public: // Data williamr@2: williamr@2: protected: // Data williamr@2: CMmsSettings* iMmsSettings; // MMSC settings (access point etc.) williamr@2: williamr@2: CMmsHeaders* iMmsHeaders; // MMS message headers williamr@2: TMsvId iServiceId; // last selected service williamr@2: TBool iFetchAll; // All the messages are fetched when williamr@2: // settings are saved after certain fetch williamr@2: // mode change. williamr@2: TBool iFetchOverride; // force fetching all messages. williamr@2: TInt iMessageDrive; // messages are on C: drive by default, williamr@2: // may be moved to other drive williamr@2: TInt32 iHomeMode; // receiving mode in the home network williamr@2: TInt32 iRoamingMode; // receiving mode when roaming williamr@2: TInt iAccessPointCount; // number of access points williamr@2: CDesCArrayFlat* iAttributes; // zero or more attributes for UI. williamr@2: // Name, value pairs williamr@2: CMsvSession& iOwnSession; // copy of session because base class session is private williamr@2: williamr@2: williamr@2: private: // Data williamr@2: // active object that commits the store when attachment operation williamr@2: // is complete williamr@2: CMmsAttachmentWaiter* iAttaWaiter; williamr@2: williamr@2: public: // Friend classes williamr@2: williamr@2: protected: // Friend classes williamr@2: williamr@2: private: // Friend classes williamr@2: williamr@2: }; williamr@2: williamr@2: // panic function williamr@2: GLREF_C void gPanic( TMmsPanic aPanic ); williamr@2: williamr@2: #include "mmsclient.inl" williamr@2: williamr@2: #endif // MMSCLIENT_H williamr@2: williamr@2: // End of File williamr@2: