imstutils/imconversationview/imcvuiapp/inc/cimcvappmessagewrapper.h
changeset 0 5e5d6b214f4f
equal deleted inserted replaced
-1:000000000000 0:5e5d6b214f4f
       
     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 wrapper for MIMCVEngineMessage
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CIMCVAPPMESSAGEWRAPPER_H
       
    22 #define CIMCVAPPMESSAGEWRAPPER_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <frmtlay.h> // TCursorSelection
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MIMCVEngineMessage;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 *  Message wrapper for MIMCVEngineMessage
       
    35 *  stores information about highlight items inside this message etc
       
    36 *
       
    37 *  @imcvuiapp.exe
       
    38 *  @since Series 60 3.0
       
    39 */
       
    40 class CIMCVAppMessageWrapper : public CBase 
       
    41     {   
       
    42     public:  // Constructors and destructor
       
    43 
       
    44         /**
       
    45          * Two-phased constructor.
       
    46          * @param aWrappedMessage Wrapped message
       
    47          * @param aContainer Message container interface 
       
    48          *                   (for informing about changed message)
       
    49          */
       
    50         static CIMCVAppMessageWrapper* NewL( MIMCVEngineMessage& aWrappedMessage );
       
    51 
       
    52         /**
       
    53          * Destructor.
       
    54          */
       
    55         virtual ~CIMCVAppMessageWrapper();
       
    56 
       
    57     public: // New functions
       
    58     
       
    59         /**
       
    60          * @return Modifiable position for thumbnail 
       
    61          *         of this message in rich text
       
    62          *
       
    63          * Note that these are not used within this class, 
       
    64          * so it's safe to return non-const reference.
       
    65          */
       
    66         TCursorSelection& ThumbPos();
       
    67 
       
    68         /**
       
    69          * @return Modifiable selection for this message in rich text 
       
    70          *         (for highlighting)
       
    71          *
       
    72          * Note that these are not used within this class, 
       
    73          * so it's safe to return non-const reference.
       
    74          */
       
    75         TCursorSelection& Selection();
       
    76         
       
    77         /**
       
    78          * @return Modifiable whole selection for this message in rich text.
       
    79          * use this to remove message from rich text 
       
    80          * as this contains the whole text.
       
    81          *
       
    82          * Note that these are not used within this class, 
       
    83          * so it's safe to return non-const reference.
       
    84          */
       
    85         TCursorSelection& WholeSelection();
       
    86 
       
    87          /**
       
    88          * @return Modifiable message selection for this message in rich text.
       
    89          * use this to identify the message part from the nick part
       
    90          *
       
    91          * Note that these are not used within this class, 
       
    92          * so it's safe to return non-const reference.
       
    93          */
       
    94         TCursorSelection& MessageSelection();
       
    95        
       
    96         /**
       
    97          * @return Modifiable array of highlights for this message
       
    98          *
       
    99          * Note that these are not used within this class, 
       
   100          * so it's safe to return non-const reference.
       
   101          */
       
   102         RArray<TCursorSelection>& Highlights();
       
   103         
       
   104         /**
       
   105          * @return Modifiable array of highlight types for this message
       
   106          *
       
   107          * Note that these are not used within this class, 
       
   108          * so it's safe to return non-const reference.
       
   109          */
       
   110         RArray<TInt>& HighlightTypes();
       
   111         
       
   112         /**
       
   113          * @return Wrapped message
       
   114          *
       
   115          * Note that these are not used within this class, 
       
   116          * so it's safe to return non-const reference.
       
   117          */
       
   118         MIMCVEngineMessage& Message();
       
   119 
       
   120         /**
       
   121          * Sets wrapper to be inserted or added.
       
   122          * @since S60 v3.2
       
   123          * @param aInserted ETrue to set wrapper inserted,
       
   124          *                  EFalse to set added.
       
   125          */
       
   126         void SetInserted( TBool aInserted );
       
   127         
       
   128         /**
       
   129          * Is wrapper inserted or added.
       
   130          * @since S60 v3.2
       
   131          * @return ETrue if this wrapper is inserted,
       
   132          *         EFalse otherwise.
       
   133          */
       
   134         TBool IsInserted() const;
       
   135         
       
   136     protected:  // Functions from MIMCVAPPImageLoaderObserver
       
   137 
       
   138         /**
       
   139          * @see MIMCVAPPImageLoaderObserver
       
   140          */
       
   141         //void Handleplaaplaplaa
       
   142 
       
   143     private:
       
   144 
       
   145         /**
       
   146          * C++ default constructor.
       
   147          */
       
   148         CIMCVAppMessageWrapper( MIMCVEngineMessage& aWrappedMessage);
       
   149 
       
   150     private:    // Data
       
   151     
       
   152         // Note that these shouldn't be used within this class,
       
   153         // these are only contained in this wrapper class
       
   154         
       
   155         // Position of thumbnail in rich text
       
   156         TCursorSelection iThumbPosition;
       
   157         
       
   158         // doesn't own. reference to wrapped message
       
   159         MIMCVEngineMessage& iMessage;
       
   160                 
       
   161         // Highlight selection for this text
       
   162         TCursorSelection iSelection;
       
   163         
       
   164         // Whole selection for this text
       
   165         TCursorSelection iWholeSelection;
       
   166 
       
   167         // Message part selection for this text
       
   168         TCursorSelection iMessageSelection;
       
   169         
       
   170         // Selections inside this message
       
   171         RArray<TCursorSelection> iHighlights;
       
   172         
       
   173         // Selection types inside this message
       
   174         RArray<TInt> iTypes;
       
   175         
       
   176          // Is this wrapper inserted (ETrue) or added (EFalse)
       
   177         TBool iInserted;
       
   178     };
       
   179 
       
   180 #endif      // CIMCVAPPMESSAGEWRAPPER_H
       
   181 
       
   182 // End of File