emailservices/emailcommon/inc/CFSMailMessageBase.h
changeset 20 ecc8def7944a
parent 18 578830873419
child 49 00c7ae862740
equal deleted inserted replaced
18:578830873419 20:ecc8def7944a
     1 /*
     1 /*
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    19 #ifndef __CFSMAILMESSAGEBASE_H
    19 #ifndef __CFSMAILMESSAGEBASE_H
    20 #define __CFSMAILMESSAGEBASE_H
    20 #define __CFSMAILMESSAGEBASE_H
    21 
    21 
    22 #include <e32std.h>
    22 #include <e32std.h>
    23 #include <e32base.h>
    23 #include <e32base.h>
    24 
       
    25 
       
    26 #include "CFSMailAddress.h"
    24 #include "CFSMailAddress.h"
       
    25 #include "cemailextensionbase.h"
    27 
    26 
    28 //<qmail>
    27 //<qmail>
    29 #include <QExplicitlySharedDataPointer>
    28 #include <QExplicitlySharedDataPointer>
    30 class NmMessageEnvelopePrivate;
    29 class NmMessageEnvelopePrivate;
    31 class NmMessageEnvelope;
    30 class NmMessageEnvelope;
    32 //</qmail>
    31 //</qmail>
       
    32 
       
    33 class CFSMailRequestHandler;
    33 
    34 
    34 /**
    35 /**
    35  *  email handling base class
    36  *  email handling base class
    36  *
    37  *
    37  *  @lib FSFWCommonLib
    38  *  @lib FSFWCommonLib
    38  *  @since S60 v3.1
    39  *  @since S60 v3.1
    39  */
    40  */
    40 NONSHARABLE_CLASS ( CFSMailMessageBase ) : public CBase
    41 NONSHARABLE_CLASS ( CFSMailMessageBase ) : public CExtendableEmail
    41 {
    42 {
    42  public:
    43  public:
    43 
    44 
    44     /**
    45     /**
    45      * Two-phased constructor.
    46      * Two-phased constructor.
    46      *
    47      *
    47      * @param aMessageId id of the email to be created
    48      * @param aMessageId id of the email to be created
    48      */
    49      */
    49      IMPORT_C static CFSMailMessageBase* NewL( const TFSMailMsgId aMessageId );
    50      IMPORT_C static CFSMailMessageBase* NewL(const TFSMailMsgId aMessageId);
    50     
    51     
    51     /**
    52     /**
    52      * Two-phased constructor.
    53      * Two-phased constructor.
    53      *
    54      *
    54      * @param aMessageId id of the email to be created
    55      * @param aMessageId id of the email to be created
    55      */
    56      */
    56      IMPORT_C static CFSMailMessageBase* NewLC( const TFSMailMsgId aMessageId );
    57      IMPORT_C static CFSMailMessageBase* NewLC(const TFSMailMsgId aMessageId);
    57  
    58  
    58     /**
    59     /**
    59      * Destructor.
    60      * Destructor.
    60      */  
    61      */  
    61      IMPORT_C virtual ~CFSMailMessageBase();
    62      IMPORT_C virtual ~CFSMailMessageBase();
    65      *
    66      *
    66      * @return message id
    67      * @return message id
    67      */
    68      */
    68      IMPORT_C TFSMailMsgId GetMessageId() const;
    69      IMPORT_C TFSMailMsgId GetMessageId() const;
    69      
    70      
    70      /**
    71     /**
    71      * if email is related to another email, for example due reply / forward,
    72      * if email is related to another email, for example due reply / forward,
    72      * related email id is returned
    73      * related email id is returned
    73      *
    74      *
    74      * @return related email id
    75      * @return related email id
    75      */
    76      */
    76      IMPORT_C TFSMailMsgId IsRelatedTo() const;
    77      IMPORT_C TFSMailMsgId IsRelatedTo() const;
    77 
    78 
    78      /**
    79     /**
    79      * set email related to another email, for example due reply / forward
    80      * set email related to another email, for example due reply / forward
    80      *
    81      *
    81      * @param aMessageId related email id
    82      * @param aMessageId related email id
    82      */
    83      */
    83      IMPORT_C void SetRelatedTo( const TFSMailMsgId aMessageId );
    84      IMPORT_C void SetRelatedTo( const TFSMailMsgId aMessageId );
   120     /**
   121     /**
   121      * email sender address mutator
   122      * email sender address mutator
   122      *
   123      *
   123      * @param aSender email sender address, ownership transferred from user
   124      * @param aSender email sender address, ownership transferred from user
   124      */
   125      */
   125      IMPORT_C void SetSender( CFSMailAddress* aSender );
   126      IMPORT_C void SetSender(CFSMailAddress* aSender);
   126 
   127 
       
   128 // <qmail>
   127     /**
   129     /**
   128      * returns TO-recipients list of email
   130      * returns TO-recipients list of email
   129      *
   131      *
   130      * @return to-recipients list, ownership not transferred user
   132      * @return to-recipients list, ownership not transferred user
   131      */
   133      */
   142      * returns BCC-recipients list of email
   144      * returns BCC-recipients list of email
   143      *
   145      *
   144      * @return bcc-recipients list, ownership not transferred user
   146      * @return bcc-recipients list, ownership not transferred user
   145      */
   147      */
   146      IMPORT_C RPointerArray<CFSMailAddress> GetBCCRecipients( );
   148      IMPORT_C RPointerArray<CFSMailAddress> GetBCCRecipients( );
       
   149 // </qmail>
   147 
   150 
   148     /**
   151     /**
   149      * appends one recipient to email TO-field, ownership transferred from user
   152      * appends one recipient to email TO-field, ownership transferred from user
   150      *
   153      *
   151      * @param aRecipient new recipient email address
   154      * @param aRecipient new recipient email address
   152      */
   155      */
   153      IMPORT_C void AppendToRecipient( CFSMailAddress* aRecipient );
   156      IMPORT_C void AppendToRecipient( CFSMailAddress* aRecipient);
   154 
   157 
   155     /**
   158     /**
   156      * appends one recipient to email CC-field, ownership transferred from user
   159      * appends one recipient to email CC-field, ownership transferred from user
   157      *
   160      *
   158      * @param aRecipient new recipient email address 
   161      * @param aRecipient new recipient email address 
   168 
   171 
   169     /**
   172     /**
   170      * clears email TO-recipients list
   173      * clears email TO-recipients list
   171      *
   174      *
   172      */
   175      */
   173      IMPORT_C void ClearToRecipients();
   176      IMPORT_C void ClearToRecipients( );
   174 
   177 
   175     /**
   178     /**
   176      * clears email CC-recipients list
   179      * clears email CC-recipients list
   177      *
   180      *
   178      */
   181      */
   179      IMPORT_C void ClearCcRecipients();
   182      IMPORT_C void ClearCcRecipients( );
   180 
   183 
   181     /**
   184     /**
   182      * clears email BCC-recipients list
   185      * clears email BCC-recipients list
   183      *
   186      *
   184      */
   187      */
   185      IMPORT_C void ClearBccRecipients();
   188      IMPORT_C void ClearBccRecipients( );
   186 
   189 
   187     /**
   190     /**
   188      * email subject accessor
   191      * email subject accessor
   189      *
   192      *
   190      * @return email subject, ownership not transferred user
   193      * @return email subject, ownership not transferred user
   194     /**
   197     /**
   195      * email subject mutator
   198      * email subject mutator
   196      *
   199      *
   197      * @param aSubject new email subject
   200      * @param aSubject new email subject
   198      */
   201      */
   199      IMPORT_C void SetSubject( const TDesC& aSubject );
   202      IMPORT_C void SetSubject(const TDesC& aSubject);
   200 
   203 
   201     /**
   204     /**
   202      * email date accessor
   205      * email date accessor
   203      *
   206      *
   204      * @return email date
   207      * @return email date
   208     /**
   211     /**
   209      * email date mutator
   212      * email date mutator
   210      *
   213      *
   211      * @param aDate new email date
   214      * @param aDate new email date
   212      */
   215      */
   213      IMPORT_C void SetDate( const TTime aDate );
   216      IMPORT_C void SetDate(const TTime aDate);
   214 
   217 
   215     /**
   218     /**
   216      * email flags accessor
   219      * email flags accessor
   217      *
   220      *
   218      * @return email flags
   221      * @return email flags
   219      */
   222      */
   220      IMPORT_C TInt GetFlags() const;
   223      IMPORT_C TInt GetFlags( ) const;
   221 
   224 
   222     /**
   225     /**
   223      * email flag set
   226      * email flag set
   224      *
   227      *
   225      * @aFlag email flag to be set
   228      * @aFlag email flag to be set
   226      */
   229      */
   227      IMPORT_C void SetFlag( const TInt aFlag );
   230      IMPORT_C void SetFlag(const TInt aFlag);
   228 
   231 
   229     /**
   232     /**
   230      * email flag reset
   233      * email flag reset
   231      *
   234      *
   232      * @aFlag email flag to be reset
   235      * @aFlag email flag to be reset
   233      */
   236      */
   234      IMPORT_C void ResetFlag( const TInt aFlag );
   237      IMPORT_C void ResetFlag(const TInt aFlag);
   235 
   238 
   236     /**
   239     /**
   237      * test email flag is set
   240      * test email flag is set
   238      *
   241      *
   239      * @aFlag email flag to be tested
   242      * @aFlag email flag to be tested
   240      * @return email flag status (set/reset)
   243      * @return email flag status (set/reset)
   241      */
   244      */
   242      IMPORT_C TBool IsFlagSet( const TInt aFlag ) const;
   245      IMPORT_C TBool IsFlagSet(const TInt aFlag) const;
   243 
   246 
   244     /**
   247     /**
   245      * Email reply-to address accessor ; defines optional email address
   248      * Email reply-to address accessor ; defines optional email address
   246      * that clients should use to send replies. Returns NULL pointer
   249      * that clients should use to send replies. Returns NULL pointer
   247      * if address is not set, ownership not transferred to user.
   250      * if address is not set, ownership not transferred to user.
   253     /**
   256     /**
   254      * email reply-to address mutator, ownership transferred from user
   257      * email reply-to address mutator, ownership transferred from user
   255      *
   258      *
   256      * @param aReplyToAddress email reply-to address
   259      * @param aReplyToAddress email reply-to address
   257      */
   260      */
   258      IMPORT_C void SetReplyToAddress( CFSMailAddress* aReplyToAddress );
   261      IMPORT_C void SetReplyToAddress(CFSMailAddress* aReplyToAddress);
   259 
   262 
   260     // <qmail>
   263      /**
       
   264       * plugin request handler accessor
       
   265       * 
       
   266       * @return request handler
       
   267       */
       
   268      IMPORT_C CFSMailRequestHandler& RequestHandler( );
       
   269 	 
       
   270 // <qmail>
   261     /**
   271     /**
   262      * gets the new NmMessageEnvelope object
   272      * gets the new NmMessageEnvelope object
   263      *
   273      *
   264      * @return NmMessageEnvelope object
   274      * @return NmMessageEnvelope object
   265      */
   275      */
   266      IMPORT_C NmMessageEnvelope* GetNmMessageEnvelope();
   276      IMPORT_C NmMessageEnvelope* GetNmMessageEnvelope();
   267     // </qmail>
   277 // </qmail>
       
   278           
       
   279 public: // from  CExtendableEmail
       
   280 
       
   281      /**
       
   282      * @see CExtendableEmail::ReleaseExtension
       
   283      */                                        
       
   284      IMPORT_C void ReleaseExtension( CEmailExtension* aExtension );
       
   285      
       
   286      /**
       
   287       * Returns extension by uid, leaves KErrNotSupported if extension is
       
   288       * not available.
       
   289       * @param aInterfaceUid extension interface uid
       
   290       * @return extension pointer. Ownership depends on extension.
       
   291       */
       
   292      IMPORT_C CEmailExtension* ExtensionL( const TUid& aInterfaceUid );
   268 
   293 
   269  protected:
   294  protected:
   270 
   295 
   271     /**
   296     /**
   272      * C++ default constructor.
   297      * C++ default constructor.
   273      */
   298      */
   274      CFSMailMessageBase();
   299      CFSMailMessageBase();
   275 
   300 
       
   301 // <qmail>
   276     /**
   302     /**
   277      * ConstructL
   303      * ConstructL
   278      */
   304      */
   279     IMPORT_C void ConstructL( const TFSMailMsgId aMessageId );      
   305     IMPORT_C void ConstructL( const TFSMailMsgId aMessageId );      
   280 
   306 
   281     void ConstructL( const NmMessageEnvelope &aMessageEnvelope );
   307     IMPORT_C void ConstructL( const NmMessageEnvelope &aMessageEnvelope );
   282     
   308     
   283     /**
   309     /**
   284      * email message id mutator
   310      * email message id mutator
   285      *
   311      *
   286      * @param aMessageId message id to be set
   312      * @param aMessageId message id to be set
   287      */
   313      */
   288     IMPORT_C void SetMessageId( const TFSMailMsgId aMessageId );
   314     IMPORT_C void SetMessageId( const TFSMailMsgId aMessageId );
   289    
   315 // </qmail>
   290     // <qmail>
   316  
       
   317 protected:	// data
       
   318     // Request handler from tls 
       
   319     CFSMailRequestHandler*          iRequestHandler;
       
   320 	
       
   321 //<qmail>
   291     /**
   322     /**
   292      * Reference to QT side of the message meta data object.
   323      * Reference to QT side of the message meta data object.
   293      */
   324      */
   294      QExplicitlySharedDataPointer<NmMessageEnvelopePrivate> iNmPrivateMessageEnvelope;
   325      QExplicitlySharedDataPointer<NmMessageEnvelopePrivate> iNmPrivateMessageEnvelope;
   295     // </qmail>
   326 //</qmail>
   296 
   327 
   297  private: // data
   328  private: // data
   298 
   329 
   299     /**
   330     /**
   300      * id of another email or part this object is related to
   331      * id of another email or part this object is related to
   310      /**
   341      /**
   311      * email parent folder id
   342      * email parent folder id
   312      */
   343      */
   313      TFSMailMsgId    iFolderId;
   344      TFSMailMsgId    iFolderId;
   314 
   345 
       
   346 // <qmail>
   315      /**
   347      /**
   316      * email sender address
   348      * email sender address
   317      * do not use it directly!
   349      * do not use it directly!
   318      */
   350      */
   319      CFSMailAddress*    iSender;
   351      CFSMailAddress*    iSender;
       
   352 // </qmail>
   320 
   353 
   321      /**
   354      /**
   322      * email reply-to address
   355      * email reply-to address
   323      */
   356      */
   324      CFSMailAddress*    iReplyTo;
   357      CFSMailAddress*    iReplyTo;
   325 
   358 
       
   359 // <qmail>
       
   360 // Unnecessary members removed: iToRecipients, iCcRecipients, iBccRecipients, iFlags, iDate
       
   361 // </qmail>
       
   362 
       
   363 // <qmail>
   326     /**
   364     /**
   327      * email subject
   365      * email subject
   328      */
   366      */
   329      mutable TPtrC    iSubjectPtr;
   367      mutable TPtrC    iSubjectPtr;
       
   368 // </qmail>
   330      
   369      
   331 };
   370 };
   332 
   371 
   333 
   372 
   334 #endif // __CFSMAILMESSAGEBASE_H
   373 #endif // __CFSMAILMESSAGEBASE_H