messagingfw/senduiservices/src/CMessageData.cpp
branchRCL_3
changeset 22 d2c4c66342f3
parent 21 e5b3a2155e1a
child 23 d51193d814ea
equal deleted inserted replaced
21:e5b3a2155e1a 22:d2c4c66342f3
     1 /*
       
     2 * Copyright (c) 2002-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:   Encapsulates the message data for sending services.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <e32std.h>
       
    22 #include <SendUiConsts.h>
       
    23 #include <CMessageData.h>
       
    24 #include "CMessageDataImpl.h"
       
    25 #include "CSendUiAttachment.h"
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // ============================ MEMBER FUNCTIONS ===============================
       
    30 
       
    31 // -----------------------------------------------------------------------------
       
    32 // CMessageData::CMessageData
       
    33 // C++ default constructor can NOT contain any code, that
       
    34 // might leave.
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 EXPORT_C CMessageData::CMessageData()
       
    38     : iDataType(KSenduiMsgDataBase)
       
    39     {
       
    40     }
       
    41 
       
    42 // -----------------------------------------------------------------------------
       
    43 // CMessageData::ConstructL
       
    44 // Symbian 2nd phase constructor can leave.
       
    45 // -----------------------------------------------------------------------------
       
    46 //
       
    47 EXPORT_C void CMessageData::ConstructL()
       
    48     {
       
    49     iMessageDataImpl = CMessageDataImpl::NewL();
       
    50     }
       
    51 
       
    52 // -----------------------------------------------------------------------------
       
    53 // CMessageData::NewL
       
    54 // Two-phased constructor.
       
    55 // -----------------------------------------------------------------------------
       
    56 //
       
    57 EXPORT_C CMessageData* CMessageData::NewL()
       
    58     {
       
    59     CMessageData* self = CMessageData::NewLC();
       
    60     
       
    61     CleanupStack::Pop( self );
       
    62 
       
    63     return self;
       
    64     }
       
    65 
       
    66 // ---------------------------------------------------------
       
    67 // CMessageData::NewLC
       
    68 // Two-phased constructor.
       
    69 // ---------------------------------------------------------
       
    70 //
       
    71 EXPORT_C CMessageData* CMessageData::NewLC()
       
    72     {
       
    73     CMessageData* self = new (ELeave) CMessageData;
       
    74 
       
    75     CleanupStack::PushL( self );
       
    76     self->ConstructL();
       
    77 
       
    78     return self;
       
    79     }
       
    80 
       
    81 
       
    82 // Destructor
       
    83 EXPORT_C CMessageData::~CMessageData()
       
    84     {
       
    85     delete iMessageDataImpl;
       
    86     }
       
    87 
       
    88 // -----------------------------------------------------------------------------
       
    89 // CMessageData::SetSubjectL
       
    90 // Set message subject.
       
    91 // (other items were commented in a header).
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 EXPORT_C void CMessageData::SetSubjectL( const TDesC* aSubject )
       
    95     {
       
    96     iMessageDataImpl->SetSubjectL( aSubject );
       
    97     }
       
    98 
       
    99 // -----------------------------------------------------------------------------
       
   100 // CMessageData::Subject
       
   101 // Returns message subject.
       
   102 // (other items were commented in a header).
       
   103 // -----------------------------------------------------------------------------
       
   104 //
       
   105 EXPORT_C const TPtrC CMessageData::Subject() const
       
   106     {
       
   107     return iMessageDataImpl->Subject();
       
   108     }    
       
   109 
       
   110 // -----------------------------------------------------------------------------
       
   111 // CMessageData::AppendAttachmentL
       
   112 // Appends attachment file path to the array of attachment file paths.
       
   113 // (other items were commented in a header).
       
   114 // -----------------------------------------------------------------------------
       
   115 //
       
   116 EXPORT_C void CMessageData::AppendAttachmentL( const TDesC& aFileName )
       
   117     {
       
   118     iMessageDataImpl->AppendAttachmentL( aFileName );
       
   119     }
       
   120     
       
   121 // -----------------------------------------------------------------------------
       
   122 // CMessageData::AttachmentArray
       
   123 // Returns array of attachment file paths.
       
   124 // (other items were commented in a header).
       
   125 // -----------------------------------------------------------------------------
       
   126 //
       
   127 EXPORT_C const CDesCArray& CMessageData::AttachmentArray() const
       
   128     {
       
   129     return iMessageDataImpl->AttachmentArray();
       
   130     }
       
   131 
       
   132 // -----------------------------------------------------------------------------
       
   133 // CMessageData::ClearAttachmentArray
       
   134 // Clears the array of attachment file paths.
       
   135 // (other items were commented in a header).
       
   136 // -----------------------------------------------------------------------------
       
   137 //
       
   138 EXPORT_C void CMessageData::ClearAttachmentArray()
       
   139     {
       
   140     iMessageDataImpl->ClearAttachmentArray();
       
   141     }    
       
   142 
       
   143 // -----------------------------------------------------------------------------
       
   144 // CMessageData::AppendToAddressL
       
   145 // Encapsulates address and alias to CMessageAddress and adds to array.
       
   146 // (other items were commented in a header).
       
   147 // -----------------------------------------------------------------------------
       
   148 //
       
   149 EXPORT_C void CMessageData::AppendToAddressL(
       
   150     const TDesC& aAddress,
       
   151     const TDesC& aAlias)
       
   152     {
       
   153     iMessageDataImpl->AppendToAddressL( aAddress, aAlias );
       
   154     }
       
   155 
       
   156 // -----------------------------------------------------------------------------
       
   157 // CMessageData::ToAddressArray
       
   158 // Returns array of addresses and aliases.
       
   159 // (other items were commented in a header).
       
   160 // -----------------------------------------------------------------------------
       
   161 //
       
   162 EXPORT_C const CMessageAddressArray& CMessageData::ToAddressArray() const
       
   163     {
       
   164     return iMessageDataImpl->ToAddressArray();
       
   165     }
       
   166 
       
   167 // -----------------------------------------------------------------------------
       
   168 // CMessageData::AppendCcAddressL
       
   169 // Encapsulates CC address and alias to CMessageAddress and adds to array.
       
   170 // (other items were commented in a header).
       
   171 // -----------------------------------------------------------------------------
       
   172 //
       
   173 EXPORT_C void CMessageData::AppendCcAddressL(
       
   174     const TDesC& aCcAddress,
       
   175     const TDesC& aCcAlias)
       
   176     {
       
   177     iMessageDataImpl->AppendCcAddressL( aCcAddress, aCcAlias );
       
   178     }
       
   179 
       
   180 // -----------------------------------------------------------------------------
       
   181 // CMessageData::CcAddressArray
       
   182 // Returns array of CC addresses and aliases.
       
   183 // (other items were commented in a header).
       
   184 // -----------------------------------------------------------------------------
       
   185 //
       
   186 EXPORT_C const CMessageAddressArray& CMessageData::CcAddressArray() const
       
   187     {
       
   188     return iMessageDataImpl->CcAddressArray();
       
   189     }
       
   190 
       
   191 // -----------------------------------------------------------------------------
       
   192 // CMessageData::AppendBccAddressL
       
   193 // Encapsulates Bcc address and alias to CMessageAddress and adds to array.
       
   194 // (other items were commented in a header).
       
   195 // -----------------------------------------------------------------------------
       
   196 //
       
   197 EXPORT_C void CMessageData::AppendBccAddressL(
       
   198     const TDesC& aBccAddress,
       
   199     const TDesC& aBccAlias)
       
   200     {
       
   201     iMessageDataImpl->AppendBccAddressL( aBccAddress, aBccAlias );
       
   202     }
       
   203 
       
   204 // -----------------------------------------------------------------------------
       
   205 // CMessageData::BccAddressArray
       
   206 // Returns array of Bcc addresses and aliases.
       
   207 // (other items were commented in a header).
       
   208 // -----------------------------------------------------------------------------
       
   209 //
       
   210 EXPORT_C const CMessageAddressArray& CMessageData::BccAddressArray() const
       
   211     {
       
   212     return iMessageDataImpl->BccAddressArray();
       
   213     }
       
   214 
       
   215 // -----------------------------------------------------------------------------
       
   216 // CMessageData::SetBodyTextL
       
   217 // Set message body text.
       
   218 // (other items were commented in a header).
       
   219 // -----------------------------------------------------------------------------
       
   220 //
       
   221 EXPORT_C void CMessageData::SetBodyTextL( const CRichText* aBodyText )
       
   222     {
       
   223     iMessageDataImpl->SetBodyTextL( aBodyText );
       
   224     }
       
   225 
       
   226 // -----------------------------------------------------------------------------
       
   227 // CMessageData::BodyText
       
   228 // Returns message body text.
       
   229 // (other items were commented in a header).
       
   230 // -----------------------------------------------------------------------------
       
   231 //
       
   232 EXPORT_C const CRichText* CMessageData::BodyText() const
       
   233     {
       
   234     return iMessageDataImpl->BodyText();
       
   235     }
       
   236     
       
   237 // -----------------------------------------------------------------------------
       
   238 // CMessageData::AppendAttachmentHandleL
       
   239 // Appends attachment handle to the array of attachment handles.
       
   240 // (other items were commented in a header).
       
   241 // -----------------------------------------------------------------------------
       
   242 //
       
   243 EXPORT_C void CMessageData::AppendAttachmentHandleL( const RFile& aFileHandle )
       
   244     {
       
   245     iMessageDataImpl->AppendAttachmentHandleL( aFileHandle );
       
   246     }
       
   247 
       
   248 // -----------------------------------------------------------------------------
       
   249 // CMessageData::AttachmentHandleArray
       
   250 // Returns array of attachment handles.
       
   251 // (other items were commented in a header).
       
   252 // -----------------------------------------------------------------------------
       
   253 //
       
   254 EXPORT_C const RArray<RFile>& CMessageData::AttachmentHandleArray() const
       
   255     {
       
   256     return iMessageDataImpl->AttachmentHandleArray();
       
   257     }
       
   258 
       
   259 // -----------------------------------------------------------------------------
       
   260 // CMessageData::DataType
       
   261 // Returns data type id.
       
   262 // (other items were commented in a header).
       
   263 // -----------------------------------------------------------------------------
       
   264 //
       
   265 EXPORT_C TUid CMessageData::DataType() const
       
   266     {
       
   267     return iDataType;
       
   268     }
       
   269 
       
   270 // -----------------------------------------------------------------------------
       
   271 // CMessageData::ClearAddresses
       
   272 // Clears all addressee arrays.
       
   273 // (other items were commented in a header).
       
   274 // -----------------------------------------------------------------------------
       
   275 //
       
   276 EXPORT_C void CMessageData::ClearAddresses()
       
   277     {
       
   278     iMessageDataImpl->ClearAddresses();
       
   279     }
       
   280 
       
   281 // ---------------------------------------------------------
       
   282 // CMessageData::ExternalizeL
       
   283 //
       
   284 // ---------------------------------------------------------
       
   285 //  
       
   286 EXPORT_C void CMessageData::ExternalizeL( RWriteStream& aStream ) const
       
   287     {
       
   288     iMessageDataImpl->ExternalizeL( aStream );
       
   289     }
       
   290 
       
   291 // ---------------------------------------------------------
       
   292 // CMessageData::InternalizeL
       
   293 //
       
   294 // ---------------------------------------------------------
       
   295 //    
       
   296 EXPORT_C void CMessageData::InternalizeL( RReadStream& aStream )
       
   297     {
       
   298     iMessageDataImpl->InternalizeL( aStream );
       
   299     }
       
   300 
       
   301 // ---------------------------------------------------------
       
   302 // CMessageData::SetOpaqueDataL
       
   303 //
       
   304 // ---------------------------------------------------------
       
   305 //  
       
   306 EXPORT_C void CMessageData::SetOpaqueDataL( const TDesC8* aData, TUid aDataType )
       
   307     {
       
   308     iMessageDataImpl->SetOpaqueDataL( aData );
       
   309     iDataType = aDataType;
       
   310     }
       
   311     
       
   312 // ---------------------------------------------------------
       
   313 // CMessageData::OpaqueData
       
   314 //
       
   315 // ---------------------------------------------------------
       
   316 //  
       
   317 EXPORT_C const TPtrC8 CMessageData::OpaqueData() const
       
   318     {
       
   319     return iMessageDataImpl->OpaqueData();
       
   320     }
       
   321 
       
   322 
       
   323 //  End of File