epoc32/include/mw/cmessagedata.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/cmessagedata.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/cmessagedata.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,312 @@
     1.4 -cmessagedata.h
     1.5 +/*
     1.6 +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:   Encapsulates the message data for sending services.
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#ifndef C_MESSAGEDATA_H
    1.24 +#define C_MESSAGEDATA_H
    1.25 +
    1.26 +#include <e32Base.h>
    1.27 +#include <badesca.h>
    1.28 +#include <f32file.h>
    1.29 +#include <msvstd.h>
    1.30 +#include "CMessageAddress.h"
    1.31 +
    1.32 +class MDesC16Array;
    1.33 +class CRichText;
    1.34 +class CMessageDataImpl;
    1.35 +
    1.36 +/**
    1.37 + *  Encapsulates the message data for sending services.
    1.38 + *
    1.39 + *  Encapsulates the message data for sending services. Class supports
    1.40 + *  externalazation and internalization, which are used to relay message 
    1.41 + *  to SendUI server application.
    1.42 + *
    1.43 + *  @lib sendui
    1.44 + *  @since S60 v3.0
    1.45 + */ 
    1.46 +class CMessageData : public CBase
    1.47 +{
    1.48 +public:  // Constructors and destructor
    1.49 +
    1.50 +   /**
    1.51 +    * Two-phased constructor.
    1.52 +    *
    1.53 +    * @return Pointer to object of CMessageData.
    1.54 +    */
    1.55 +    IMPORT_C static CMessageData* NewL();
    1.56 +    
    1.57 +   /**
    1.58 +    * Two-phased constructor.
    1.59 +    *
    1.60 +    * @return Pointer to object of CMessageData.
    1.61 +    */
    1.62 +    IMPORT_C static CMessageData* NewLC();
    1.63 +
    1.64 +   /**
    1.65 +    * Destructor.
    1.66 +    */
    1.67 +    IMPORT_C virtual ~CMessageData();
    1.68 +
    1.69 +public: // New functions
    1.70 +
    1.71 +   /**
    1.72 +    * Set message subject.
    1.73 +    *
    1.74 +    * @since Series 60 3.0
    1.75 +    * @param aSubject Sets message subject. Does not take ownership.
    1.76 +    * @return None.
    1.77 +    */
    1.78 +    IMPORT_C void SetSubjectL( const TDesC* aSubject );
    1.79 +
    1.80 +   /**
    1.81 +    * Returns message subject.
    1.82 +    *
    1.83 +    * @since Series 60 3.0
    1.84 +    * @return Message subject.
    1.85 +    */
    1.86 +    IMPORT_C const TPtrC Subject() const;
    1.87 +
    1.88 +   /**
    1.89 +    * Appends attachment file path to the array of attachment file paths. Only a link 
    1.90 +    * to the attachment is stored and compared to AppendAttachmentHandleL less resources 
    1.91 +    * is used during the send operation.
    1.92 +    * 
    1.93 +    * NOTE: Do not add any temporary files as an attachment. Always use 
    1.94 +    * AppendAttachmentHandleL for temporary files.
    1.95 +    *
    1.96 +    * @since Series 60 3.0
    1.97 +    * @param aFilePath File path of the attachment. 
    1.98 +    *                  
    1.99 +    * @return None.
   1.100 +    */
   1.101 +    IMPORT_C void AppendAttachmentL( const TDesC& aFilePath );
   1.102 +
   1.103 +   /**
   1.104 +    * Returns the array of attachment file paths.
   1.105 +    *
   1.106 +    * @since Series 60 3.0
   1.107 +    * @return Array of attachment file paths.
   1.108 +    */
   1.109 +    IMPORT_C const CDesCArray& AttachmentArray() const;
   1.110 +    
   1.111 +    /**
   1.112 +    * Clears the array of attachment file paths.
   1.113 +    *
   1.114 +    * @since Series 60 3.0
   1.115 +    * @return Array of attachment file paths.
   1.116 +    */        
   1.117 +    IMPORT_C void ClearAttachmentArray();
   1.118 +
   1.119 +   /**
   1.120 +    * Encapsulates address and alias to CMessageAddress and adds to array.
   1.121 +    *
   1.122 +    * @since Series 60 3.0
   1.123 +    * @param aAddress Real address.
   1.124 +    * @param aAlias Alias for the real address.
   1.125 +    * @return None.
   1.126 +    */
   1.127 +    IMPORT_C void AppendToAddressL(
   1.128 +        const TDesC& aAddress,
   1.129 +        const TDesC& aAlias = KNullDesC);
   1.130 +
   1.131 +   /**
   1.132 +    * Returns array of addresses and aliases.
   1.133 +    *
   1.134 +    * @since Series 60 3.0
   1.135 +    * @return Array of addresses and aliases.
   1.136 +    */
   1.137 +    IMPORT_C const CMessageAddressArray& ToAddressArray() const;
   1.138 +
   1.139 +   /**
   1.140 +    * Encapsulates CC address and alias to CMessageAddress and adds to 
   1.141 +    * array.
   1.142 +    *
   1.143 +    * @since Series 60 3.0
   1.144 +    * @param aCcAddress Real CC-address.
   1.145 +    * @param aCcAlias Alias for the real CC-address.
   1.146 +    * @return None.
   1.147 +    */
   1.148 +    IMPORT_C void AppendCcAddressL(
   1.149 +        const TDesC& aCcAddress,
   1.150 +        const TDesC& aCcAlias = KNullDesC);
   1.151 +
   1.152 +   /**
   1.153 +    * Returns array of CC addresses and aliases.
   1.154 +    *
   1.155 +    * @since Series 60 3.0
   1.156 +    * @return Array of cc addresses and aliases.
   1.157 +    */
   1.158 +    IMPORT_C const CMessageAddressArray& CcAddressArray() const;
   1.159 +
   1.160 +   /**
   1.161 +    * Encapsulates Bcc address and alias to CMessageAddress and adds to
   1.162 +    * array.
   1.163 +    *
   1.164 +    * @since Series 60 3.0
   1.165 +    * @param aBccAddress Real Bcc-address.
   1.166 +    * @param aBccAlias Alias for the real Bcc-address.
   1.167 +    * @return None.
   1.168 +    */
   1.169 +    IMPORT_C void AppendBccAddressL(
   1.170 +        const TDesC& aBccAddress,
   1.171 +        const TDesC& aBccAlias = KNullDesC);
   1.172 +
   1.173 +   /**
   1.174 +    * Returns array of Bcc addresses and aliases.
   1.175 +    *
   1.176 +    * @since Series 60 3.0
   1.177 +    * @return Array of Bcc addresses and aliases.
   1.178 +    */
   1.179 +    IMPORT_C const CMessageAddressArray& BccAddressArray() const;
   1.180 +
   1.181 +   /**
   1.182 +    * Set message body text.
   1.183 +    *
   1.184 +    * @since Series 60 3.0
   1.185 +    * @param aBodyText Message body text.
   1.186 +    * @return None.
   1.187 +    */
   1.188 +    IMPORT_C void SetBodyTextL( const CRichText* aBodyText );
   1.189 +
   1.190 +   /**
   1.191 +    * Returns message body text.
   1.192 +    *
   1.193 +    * @since Series 60 3.0
   1.194 +    * @return Message body text.
   1.195 +    */
   1.196 +    IMPORT_C const CRichText* BodyText() const;
   1.197 +    
   1.198 +   /**
   1.199 +    * Appends attachment handle to the array of attachment handles. 
   1.200 +    *
   1.201 +    * NOTE: Attachment handles should be opened using ShareProtected()
   1.202 +    * file session, otherwise handles can not be transfered through
   1.203 +    * client-server interface.
   1.204 +    *
   1.205 +    * NOTE: When adding a temporary file as an attachment, always use this method,
   1.206 +    *
   1.207 +    * @since Series 60 3.0
   1.208 +    * @param aFileHandle File handle of the attachment.
   1.209 +    * @return None.
   1.210 +    */
   1.211 +    IMPORT_C void AppendAttachmentHandleL( const RFile& aFileHandle );
   1.212 +
   1.213 +    /**
   1.214 +    * Returns the array of attachment handles.
   1.215 +    *
   1.216 +    * @since Series 60 3.0
   1.217 +    * @return Array of attachment handles.
   1.218 +    */
   1.219 +    IMPORT_C const RArray<RFile>& AttachmentHandleArray() const;
   1.220 +
   1.221 +   /**
   1.222 +    * Returns data type id.
   1.223 +    *
   1.224 +    * This can be used for interpreting the opaque data.
   1.225 +    * @since Series 60 3.0
   1.226 +    * @return Data type id.
   1.227 +    */
   1.228 +    IMPORT_C TUid DataType() const;
   1.229 +
   1.230 +   /**
   1.231 +    * Clears all addressee arrays.
   1.232 +    *
   1.233 +    * @since Series 60 3.0
   1.234 +    * @return None.
   1.235 +    */ 
   1.236 +    IMPORT_C void ClearAddresses();
   1.237 +
   1.238 +   /**
   1.239 +    * Externalizes message data to a stream
   1.240 +    *
   1.241 +    * @since Series 60 3.2
   1.242 +    * @return None.
   1.243 +    */ 
   1.244 +   
   1.245 +   IMPORT_C void ExternalizeL( RWriteStream& aStream ) const;
   1.246 +    
   1.247 +   /**
   1.248 +    * Internalizes message data to from a stream
   1.249 +    *
   1.250 +    * @since Series 60 3.2
   1.251 +    * @return None.
   1.252 +    */ 
   1.253 +    IMPORT_C void InternalizeL( RReadStream& aStream );
   1.254 +
   1.255 +   /**
   1.256 +    * Set opaque data
   1.257 +    *
   1.258 +    * @since Series 60 3.2
   1.259 +    * @param aData Opaque data.
   1.260 +    * @param aDataType, Identifier for the opaque data.
   1.261 +    * @return None.
   1.262 +    */
   1.263 +    IMPORT_C void SetOpaqueDataL( const TDesC8* aData, TUid aDataType );
   1.264 +    
   1.265 +   /**
   1.266 +    * Get opaque data
   1.267 +    *
   1.268 +    * @since Series 60 3.2
   1.269 +    * @return aData Opaque data.
   1.270 +    */
   1.271 +    IMPORT_C const TPtrC8 OpaqueData() const;
   1.272 +
   1.273 + protected:
   1.274 +
   1.275 +   /**
   1.276 +    * C++ default constructor.
   1.277 +    */
   1.278 +    IMPORT_C CMessageData();
   1.279 +
   1.280 +   /**
   1.281 +    * By default Symbian 2nd phase constructor is private.
   1.282 +    */
   1.283 +    IMPORT_C void ConstructL();
   1.284 +
   1.285 +protected:  // Data
   1.286 +
   1.287 +    /**
   1.288 +     * Data type of this message. Normally this is KSenduiMsgDataBase
   1.289 +     * This can be used for interpreting the opaque data.
   1.290 +     */
   1.291 +    TUid iDataType;
   1.292 +
   1.293 +private:  // Data
   1.294 +
   1.295 +    /**
   1.296 +     *  Message data implementation.
   1.297 +     *  Owned.
   1.298 +     */
   1.299 +    CMessageDataImpl* iMessageDataImpl;
   1.300 +
   1.301 +    /**
   1.302 +     *  Reserved.
   1.303 +     */
   1.304 +    TAny* iReserved1;
   1.305 +    TAny* iReserved2;
   1.306 +    TAny* iReserved3;
   1.307 +    TAny* iReserved4;
   1.308 +    TAny* iReserved5;
   1.309 +    RArray<TAny*> iReserved6;
   1.310 +
   1.311 +};
   1.312 +
   1.313 +#endif      // C_MESSAGEDATA_H
   1.314 +
   1.315 +// End of File
   1.316 +