imstutils/imconversationview/imcvuiengine/inc/imcvenginemessageutils.h
branchRCL_3
changeset 22 3104fc151679
parent 21 2b7283837edb
child 23 9a48e301e94b
equal deleted inserted replaced
21:2b7283837edb 22:3104fc151679
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  message utils class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef IMCVENGINEMESSAGEUTILS_H
       
    20 #define IMCVENGINEMESSAGEUTILS_H
       
    21 #include <e32base.h>
       
    22 // FORWARD DECLARATIONS
       
    23 class TTime;
       
    24 class MIMCVEngineMessage;
       
    25 class MIMCVEngineMessageCreator;
       
    26 class MIMCVEngineMessageWriteInterface;
       
    27 
       
    28 /**
       
    29  *  General message handling methods.
       
    30  *
       
    31  *  General message handling methods which are to be used in both 
       
    32  *  messagehandler and chatgroupmanager, to avoid duplicate code.
       
    33  *
       
    34  *  @lib imcvengine.dll
       
    35  *  @since S60 v5.0
       
    36  */
       
    37 class IMCVEngineMessageUtils 
       
    38     {
       
    39 public:
       
    40 
       
    41     /**
       
    42      * Appends a datestamp to writeinterface if needed.
       
    43      * New time is compared to the previous message in the interface.
       
    44      * If the time values are from different date then datestamp is created
       
    45      * Otherwise this does nothing.
       
    46      *
       
    47      * @since S60 v5.
       
    48      * @param aNewTime Time of the new message
       
    49      * @param aWriteInterface Interface to write the date message
       
    50      * @param aMessageCreator for creating the date message
       
    51      * @param aSettingsAPI Settings interface to determine if datestamps
       
    52      *                     are required.
       
    53      */
       
    54     static void AppendDateStampL( TTime aNewTime,
       
    55                                   MIMCVEngineMessageWriteInterface& aWriteInterface,
       
    56                                   MIMCVEngineMessageCreator& aMessageCreator );
       
    57 
       
    58 
       
    59     /**
       
    60      * Appends a datestamp and message to interface. Datestamp is added only 
       
    61      * if the date has changed between previous and current message.
       
    62      * Ownership of the message is transferred or shared, so it doesn't 
       
    63      * need to be in cleanupstack.
       
    64      *
       
    65      * @since S60 v5.0
       
    66      * @param aNewMessage New message
       
    67      * @param aWriteInterface Interface to write the date message
       
    68      * @param aMessageCreator for creating the date message
       
    69      * @param aSettingsAPI Settings interface to determine if datestamps
       
    70      *                     are required.
       
    71      * @param aSharedOwnership EFalse - ownership is transferred
       
    72      *                         ETrue - ownership is shared
       
    73      */
       
    74     static void AppendMessageWithDateStampL( 
       
    75                               MIMCVEngineMessage& aNewMessage,
       
    76                               MIMCVEngineMessageWriteInterface& aWriteInterface,
       
    77                               MIMCVEngineMessageCreator& aMessageCreator,
       
    78                               TBool aSharedOwnership = EFalse );
       
    79                               
       
    80 	/**
       
    81 	 * used to load the resource
       
    82 	 * @param aResourceId The id to read
       
    83 	 * @return The string for given resource id 
       
    84 	 */
       
    85      static HBufC* LoadResourceL( TInt aResourceId ,  const TDesC& aText );     
       
    86     };
       
    87 
       
    88 
       
    89 #endif // IMCVENGINEMESSAGEUTILS_H