meetingrequest/mrtasks/mrtaskplugin/inc/cesmrmailplaitextformatter.h
branchRCL_3
changeset 12 4ce476e64c59
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
       
     1 /*
       
     2 * Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Plain text formatter for ES MR entries
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_ESMRMAILPLAINTEXTFORMATTER_H
       
    20 #define C_ESMRMAILPLAINTEXTFORMATTER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class CCalEntry;
       
    25 class CMRMailboxUtils;
       
    26 
       
    27 /**
       
    28  * CESMRMailPlainTextFormatter is responsible for constructing
       
    29  * plain text part for meeting request email messages.
       
    30  *
       
    31  * CESMRMailPlainTextFormatter is ised internally by esmrtasks
       
    32  * module.
       
    33  *
       
    34  * @lib esmrtasks.lib
       
    35  */
       
    36 NONSHARABLE_CLASS(CESMRMailPlainTextFormatter) : public CBase
       
    37     {
       
    38 public: // Construction and destruction
       
    39     
       
    40     /**
       
    41      * Creates and initialzes new CESMRMailPlainTextFormatter object.
       
    42      * Ownership is transferred to caller. 
       
    43      * @param aMailboxUtils Reference to MR mailbox utilities.
       
    44      * @return Pointer to CESMRMailPlainTextFormatter object.
       
    45      */
       
    46     static CESMRMailPlainTextFormatter* NewL(
       
    47             CMRMailboxUtils& aMailboxUtils );
       
    48 
       
    49     /**
       
    50      * Creates and initialzes new CESMRMailPlainTextFormatter object.
       
    51      * Ownership is transferred to caller. Created object is left to
       
    52      * cleanup stack.
       
    53      * @param aMailboxUtils Reference to MR mailbox utilities.
       
    54      * @return Pointer to CESMRMailPlainTextFormatter object.
       
    55      */
       
    56     static CESMRMailPlainTextFormatter* NewLC(
       
    57             CMRMailboxUtils& aMailboxUtils );    
       
    58     
       
    59     /**
       
    60      * C++ destructor
       
    61      */
       
    62     ~CESMRMailPlainTextFormatter();
       
    63 
       
    64     /**
       
    65      * Formats plain text part body from ES calendar entry. Ownership of the 
       
    66      * created descriptor is transferred to caller. Created object is also
       
    67      * left to cleanup stack.
       
    68      * @param aEntry Reference to calendar entry.
       
    69      * @return Plain text buffer.
       
    70      */
       
    71     HBufC* Body16LC(
       
    72             CCalEntry& aEntry );
       
    73     
       
    74     /**
       
    75      * Formats plain text body part from ES calendar entry. Ownership of the 
       
    76      * created descriptor is transferred to caller. Created object is also
       
    77      * left to cleanup stack.
       
    78      * @param aEntry Reference to calendar entry.
       
    79      * @return Plain text buffer.
       
    80      */    
       
    81     HBufC8* Body8LC(
       
    82             CCalEntry& aEntry );
       
    83 
       
    84     /**
       
    85      * Formats the subject line for meeting request email.O wnership of the 
       
    86      * created descriptor is transferred to caller. Created object is also
       
    87      * left to cleanup stack.
       
    88      * @param aEntry Reference to calendar entry.
       
    89      * @param aIsForwarded ETrue if entry is forwarded
       
    90      * @param aIsUpdate ETrue if entry is update to existing entry
       
    91      * @return Subject line buffer.
       
    92      */
       
    93     HBufC* Subject16LC(
       
    94             CCalEntry& aEntry,
       
    95             TBool aIsForwarded,
       
    96             TBool aIsUpdate );
       
    97             
       
    98     /**
       
    99      * Formats the subject line for meeting request email.O wnership of the 
       
   100      * created descriptor is transferred to caller. Created object is also
       
   101      * left to cleanup stack.
       
   102      * @param aEntry Reference to calendar entry.
       
   103      * @param aIsForwarded ETrue if entry is forwarded
       
   104      * @param aIsUpdate ETrue if entry is update to existing entry
       
   105      * @return Subject line buffer.
       
   106      */
       
   107      HBufC8* Subject8LC(
       
   108             CCalEntry& aEntry,
       
   109             TBool aIsForwarded,
       
   110             TBool aIsUpdate );
       
   111      
       
   112      /**
       
   113       * Fetches the localized updated string for entry
       
   114       * @rerurn Localized updated string
       
   115       */
       
   116      HBufC* UpdatedStringLC();
       
   117 
       
   118      /**
       
   119       * Fetches the localized canceled string for entry
       
   120       * @rerurn Localized updated string
       
   121       */
       
   122      HBufC* CanceledStringLC();
       
   123      
       
   124      /**
       
   125       * Fetches the localized Reply string for entry
       
   126       * @param aEntry Reference to entry
       
   127       * @rerurn Localized reply string
       
   128       */
       
   129      HBufC* ReplyStringLC( CCalEntry& aEntry );     
       
   130      
       
   131 private: // Implementation
       
   132 
       
   133     CESMRMailPlainTextFormatter(
       
   134             CMRMailboxUtils& aMailboxUtils );
       
   135     void ConstructL();
       
   136     
       
   137     HBufC* SubjectLinePrefix16LC( 
       
   138     		CCalEntry& aEntry,
       
   139             TBool aIsForwarded,
       
   140             TBool aIsSToredToDB );
       
   141     
       
   142 private: // data
       
   143     /**
       
   144     * Reference to MR mailbox utilities.
       
   145     * Not own.
       
   146     */
       
   147     CMRMailboxUtils& iMailboxUtils;
       
   148     
       
   149     /**
       
   150     * Resource file offset
       
   151     */
       
   152     TInt iResourceOffset;
       
   153     };
       
   154     
       
   155 #endif  // C_ESMRMAILPLAINTEXTFORMATTER_H