wvuing/wvuiave/AppSrc/CCAMessageWrapper.cpp
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2006 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 MCAConversationMessage
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include    "CCAMessageWrapper.h"
       
    22 #include    "MCAConversationMessage.h"
       
    23 #include    "MCAMessageContainer.h"
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CCAMessageWrapper::CCAMessageWrapper
       
    29 // C++ default constructor can NOT contain any code, that
       
    30 // might leave.
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 CCAMessageWrapper::CCAMessageWrapper( MCAConversationMessage& aWrappedMessage,
       
    34                                       MCAMessageContainer& aContainer )
       
    35         : iMessage( &aWrappedMessage ),
       
    36         iContainer( aContainer ),
       
    37         iInserted( EFalse )
       
    38     {
       
    39     }
       
    40 
       
    41 // -----------------------------------------------------------------------------
       
    42 // CCAMessageWrapper::NewL
       
    43 // Two-phased constructor.
       
    44 // -----------------------------------------------------------------------------
       
    45 //
       
    46 CCAMessageWrapper* CCAMessageWrapper::NewL( MCAConversationMessage& aWrappedMessage,
       
    47                                             MCAMessageContainer& aContainer )
       
    48     {
       
    49     CCAMessageWrapper* self =
       
    50         new( ELeave ) CCAMessageWrapper( aWrappedMessage, aContainer );
       
    51 
       
    52     return self;
       
    53     }
       
    54 
       
    55 
       
    56 // Destructor
       
    57 CCAMessageWrapper::~CCAMessageWrapper()
       
    58     {
       
    59     //remove thumbnail from message
       
    60     if ( !iContainer.IsDeleted() && iMessage )
       
    61         {
       
    62         iMessage->ReleaseTemporaryContentData();
       
    63         }
       
    64 
       
    65     delete iMessage;
       
    66 
       
    67     iHighlights.Reset();
       
    68     iTypes.Reset();
       
    69     }
       
    70 
       
    71 
       
    72 
       
    73 // -----------------------------------------------------------------------------
       
    74 // CCAMessageWrapper::ThumbPos
       
    75 // (other items were commented in a header).
       
    76 // -----------------------------------------------------------------------------
       
    77 //
       
    78 TCursorSelection& CCAMessageWrapper::ThumbPos()
       
    79     {
       
    80     return iThumbPosition;
       
    81     }
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // CCAMessageWrapper::Selection
       
    85 // (other items were commented in a header).
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 TCursorSelection& CCAMessageWrapper::Selection()
       
    89     {
       
    90     return iSelection;
       
    91     }
       
    92 
       
    93 // -----------------------------------------------------------------------------
       
    94 // CCAMessageWrapper::WholeSelection
       
    95 // (other items were commented in a header).
       
    96 // -----------------------------------------------------------------------------
       
    97 //
       
    98 TCursorSelection& CCAMessageWrapper::WholeSelection()
       
    99     {
       
   100     return iWholeSelection;
       
   101     }
       
   102 
       
   103 // -----------------------------------------------------------------------------
       
   104 // CCAMessageWrapper::WholeSelection
       
   105 // (other items were commented in a header).
       
   106 // -----------------------------------------------------------------------------
       
   107 //
       
   108 TCursorSelection& CCAMessageWrapper::MessageSelection()
       
   109     {
       
   110     return iMessageSelection;
       
   111     }
       
   112 
       
   113 // -----------------------------------------------------------------------------
       
   114 // CCAMessageWrapper::Highlights
       
   115 // (other items were commented in a header).
       
   116 // -----------------------------------------------------------------------------
       
   117 //
       
   118 RArray<TCursorSelection>& CCAMessageWrapper::Highlights()
       
   119     {
       
   120     return iHighlights;
       
   121     }
       
   122 
       
   123 // -----------------------------------------------------------------------------
       
   124 // CCAMessageWrapper::HighlightTypes
       
   125 // (other items were commented in a header).
       
   126 // -----------------------------------------------------------------------------
       
   127 //
       
   128 RArray<TInt>& CCAMessageWrapper::HighlightTypes()
       
   129     {
       
   130     return iTypes;
       
   131     }
       
   132 
       
   133 // -----------------------------------------------------------------------------
       
   134 // CCAMessageWrapper::Message
       
   135 // (other items were commented in a header).
       
   136 // -----------------------------------------------------------------------------
       
   137 //
       
   138 MCAConversationMessage& CCAMessageWrapper::Message()
       
   139     {
       
   140     return *iMessage;
       
   141     }
       
   142 
       
   143 // -----------------------------------------------------------------------------
       
   144 // CCAMessageWrapper::SetInserted
       
   145 // (other items were commented in a header).
       
   146 // -----------------------------------------------------------------------------
       
   147 //
       
   148 void CCAMessageWrapper::SetInserted( TBool aInserted )
       
   149     {
       
   150     iInserted = aInserted;
       
   151     }
       
   152 
       
   153 // -----------------------------------------------------------------------------
       
   154 // CCAMessageWrapper::IsInserted
       
   155 // (other items were commented in a header).
       
   156 // -----------------------------------------------------------------------------
       
   157 //
       
   158 TBool CCAMessageWrapper::IsInserted() const
       
   159     {
       
   160     return iInserted;
       
   161     }
       
   162 
       
   163 //  End of File