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