emailservices/emailclientapi/src/emailmultipart.cpp
author hgs
Thu, 14 Oct 2010 17:33:43 +0300
changeset 76 38bf5461e270
parent 47 f83bd4ae1fe3
permissions -rw-r--r--
201041
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description: This file implements class CEmailAttachment.
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#include "emailcontent.h"
hgs
parents:
diff changeset
    19
#include "emailtextcontent.h"
hgs
parents:
diff changeset
    20
#include "emailattachment.h"
hgs
parents:
diff changeset
    21
#include "emailmultipart.h"
hgs
parents:
diff changeset
    22
#include "emailmessage.h"
hgs
parents:
diff changeset
    23
#include "emailclientapi.hrh"
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    26
// 
hgs
parents:
diff changeset
    27
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    28
CEmailMultipart* CEmailMultipart::NewL( 
hgs
parents:
diff changeset
    29
        CPluginData& aPluginData,
hgs
parents:
diff changeset
    30
        const TMessageContentId& aMsgContentId,
hgs
parents:
diff changeset
    31
        CFSMailMessagePart* aPart,
hgs
parents:
diff changeset
    32
        const TDataOwner aOwner ) 
hgs
parents:
diff changeset
    33
    {
hgs
parents:
diff changeset
    34
    CEmailMultipart* self = new ( ELeave ) CEmailMultipart( aOwner );
hgs
parents:
diff changeset
    35
    CleanupStack::PushL( self );
hgs
parents:
diff changeset
    36
    self->ConstructL( aPluginData, aMsgContentId, aPart );
hgs
parents:
diff changeset
    37
    CleanupStack::Pop( self );
hgs
parents:
diff changeset
    38
    return self;
hgs
parents:
diff changeset
    39
    }
hgs
parents:
diff changeset
    40
hgs
parents:
diff changeset
    41
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    42
// 
hgs
parents:
diff changeset
    43
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    44
void CEmailMultipart::ConstructL(
hgs
parents:
diff changeset
    45
        CPluginData& aPluginData,
hgs
parents:
diff changeset
    46
        const TMessageContentId& aMsgContentId,
hgs
parents:
diff changeset
    47
        CFSMailMessagePart* aPart )
hgs
parents:
diff changeset
    48
    {
hgs
parents:
diff changeset
    49
    iEmailMsgContent = CEmailMessageContent::NewL( aPluginData, aMsgContentId, aPart );
hgs
parents:
diff changeset
    50
    }
hgs
parents:
diff changeset
    51
hgs
parents:
diff changeset
    52
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    53
// 
hgs
parents:
diff changeset
    54
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    55
CEmailMultipart::~CEmailMultipart()
hgs
parents:
diff changeset
    56
    {
hgs
parents:
diff changeset
    57
    delete iEmailMsgContent;
hgs
parents:
diff changeset
    58
    iChildParts.Reset();
hgs
parents:
diff changeset
    59
    }
hgs
parents:
diff changeset
    60
hgs
parents:
diff changeset
    61
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    62
// 
hgs
parents:
diff changeset
    63
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    64
CEmailMultipart::CEmailMultipart( const TDataOwner aOwner ) : iOwner( aOwner )
hgs
parents:
diff changeset
    65
    {
hgs
parents:
diff changeset
    66
    }
hgs
parents:
diff changeset
    67
hgs
parents:
diff changeset
    68
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    69
// 
hgs
parents:
diff changeset
    70
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    71
TInt CEmailMultipart::PartCountL()
hgs
parents:
diff changeset
    72
    {
hgs
parents:
diff changeset
    73
    iChildParts.Reset();
hgs
parents:
diff changeset
    74
    RPointerArray<CFSMailMessagePart> childParts;
hgs
parents:
diff changeset
    75
    CleanupResetAndDestroyPushL( childParts );
hgs
parents:
diff changeset
    76
    iEmailMsgContent->Part().ChildPartsL( childParts );
hgs
parents:
diff changeset
    77
    iChildPartCount = childParts.Count();
hgs
parents:
diff changeset
    78
hgs
parents:
diff changeset
    79
    for ( TInt i = 0; i < iChildPartCount; i++ )
hgs
parents:
diff changeset
    80
        {
hgs
parents:
diff changeset
    81
        TFSMailMsgId id = childParts[i]->GetPartId();
hgs
parents:
diff changeset
    82
        iChildParts.AppendL( id );
hgs
parents:
diff changeset
    83
        }
hgs
parents:
diff changeset
    84
    CleanupStack::PopAndDestroy( &childParts );
hgs
parents:
diff changeset
    85
    return iChildPartCount;
hgs
parents:
diff changeset
    86
    }
hgs
parents:
diff changeset
    87
hgs
parents:
diff changeset
    88
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    89
// 
hgs
parents:
diff changeset
    90
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    91
MEmailMessageContent* CEmailMultipart::PartByIndexL( const TUint aIndex ) const
hgs
parents:
diff changeset
    92
    {
hgs
parents:
diff changeset
    93
    if ( aIndex >= iChildPartCount )
hgs
parents:
diff changeset
    94
        {
hgs
parents:
diff changeset
    95
        User::Leave( KErrArgument );
hgs
parents:
diff changeset
    96
        }
hgs
parents:
diff changeset
    97
    MEmailMessageContent* content = NULL;
hgs
parents:
diff changeset
    98
    TFSMailMsgId partId = iChildParts[aIndex];
hgs
parents:
diff changeset
    99
    CFSMailMessagePart* copy = iEmailMsgContent->Part().ChildPartL( partId );
hgs
parents:
diff changeset
   100
    if ( !copy )
hgs
parents:
diff changeset
   101
        return content;
hgs
parents:
diff changeset
   102
hgs
parents:
diff changeset
   103
    TContentType contentType( copy->GetContentType() );
hgs
parents:
diff changeset
   104
    TMessageContentId msgContentId = TMessageContentId( 
hgs
parents:
diff changeset
   105
            copy->GetPartId().Id(),
hgs
parents:
diff changeset
   106
            Id().iMessageId.iId,
hgs
parents:
diff changeset
   107
            Id().iMessageId.iFolderId.iId,
hgs
parents:
diff changeset
   108
            Id().iMessageId.iFolderId.iMailboxId );
hgs
parents:
diff changeset
   109
hgs
parents:
diff changeset
   110
    if ( contentType.Equals( KFSMailContentTypeTextPlain ) || 
hgs
parents:
diff changeset
   111
         contentType.Equals( KFSMailContentTypeTextHtml ) )
hgs
parents:
diff changeset
   112
        {
hgs
parents:
diff changeset
   113
        content = CEmailTextContent::NewL( 
hgs
parents:
diff changeset
   114
            iEmailMsgContent->PluginData(), msgContentId, copy, EClientOwns );
hgs
parents:
diff changeset
   115
        }
hgs
parents:
diff changeset
   116
    else if ( contentType.Equals( KFSMailContentTypeMultipartMixed ) ||
hgs
parents:
diff changeset
   117
              contentType.Equals( KFSMailContentTypeMultipartAlternative ) ||
hgs
parents:
diff changeset
   118
              contentType.Equals( KFSMailContentTypeMultipartDigest ) ||
hgs
parents:
diff changeset
   119
              contentType.Equals( KFSMailContentTypeMultipartRelated ) ||
hgs
parents:
diff changeset
   120
              contentType.Equals( KFSMailContentTypeMultipartParallel ) )
hgs
parents:
diff changeset
   121
        {
hgs
parents:
diff changeset
   122
        content = CEmailMultipart::NewL( 
hgs
parents:
diff changeset
   123
            iEmailMsgContent->PluginData(), msgContentId, copy, EClientOwns );
hgs
parents:
diff changeset
   124
        }
hgs
parents:
diff changeset
   125
    else 
hgs
parents:
diff changeset
   126
        {
hgs
parents:
diff changeset
   127
        content = CEmailAttachment::NewL( 
hgs
parents:
diff changeset
   128
            iEmailMsgContent->PluginData(), msgContentId, copy, EClientOwns );
hgs
parents:
diff changeset
   129
        } 
hgs
parents:
diff changeset
   130
    return content;
hgs
parents:
diff changeset
   131
    }
hgs
parents:
diff changeset
   132
hgs
parents:
diff changeset
   133
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   134
// 
hgs
parents:
diff changeset
   135
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   136
void CEmailMultipart::DeletePartL( const TUint aIndex )
hgs
parents:
diff changeset
   137
    {
hgs
parents:
diff changeset
   138
    if ( aIndex >= iChildPartCount )
hgs
parents:
diff changeset
   139
        {
hgs
parents:
diff changeset
   140
        User::Leave( KErrArgument );
hgs
parents:
diff changeset
   141
        }
hgs
parents:
diff changeset
   142
    
hgs
parents:
diff changeset
   143
    TFSMailMsgId partId = iChildParts[aIndex];
hgs
parents:
diff changeset
   144
    iEmailMsgContent->Part().RemoveChildPartL( partId );
hgs
parents:
diff changeset
   145
    iChildParts.Remove( aIndex );
hgs
parents:
diff changeset
   146
    iChildPartCount--;
hgs
parents:
diff changeset
   147
    }
hgs
parents:
diff changeset
   148
hgs
parents:
diff changeset
   149
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   150
// 
hgs
parents:
diff changeset
   151
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   152
void CEmailMultipart::AddPartL(
hgs
parents:
diff changeset
   153
        const MEmailMessageContent& aPart,
hgs
parents:
diff changeset
   154
        const TUint aPos )
hgs
parents:
diff changeset
   155
    {
hgs
parents:
diff changeset
   156
    if ( aPos > iChildPartCount )
hgs
parents:
diff changeset
   157
        {
hgs
parents:
diff changeset
   158
        User::Leave( KErrArgument );
hgs
parents:
diff changeset
   159
        }
hgs
parents:
diff changeset
   160
hgs
parents:
diff changeset
   161
    TFSMailMsgId insertBefore = TFSMailMsgId();
hgs
parents:
diff changeset
   162
    if ( aPos <  iChildPartCount )
hgs
parents:
diff changeset
   163
        {
hgs
parents:
diff changeset
   164
        insertBefore = iChildParts[aPos];
hgs
parents:
diff changeset
   165
        }
hgs
parents:
diff changeset
   166
    const TDesC& contentType = aPart.ContentType();
hgs
parents:
diff changeset
   167
hgs
parents:
diff changeset
   168
    CFSMailMessagePart* newPart = 
hgs
parents:
diff changeset
   169
        iEmailMsgContent->Part().NewChildPartL( insertBefore, contentType );
hgs
parents:
diff changeset
   170
    CleanupStack::PushL( newPart );
hgs
parents:
diff changeset
   171
    TFSMailMsgId newPartId = newPart->GetPartId(); 
hgs
parents:
diff changeset
   172
    iChildParts.InsertL( newPartId, aPos );
hgs
parents:
diff changeset
   173
    iChildPartCount = iChildParts.Count();
hgs
parents:
diff changeset
   174
    CleanupStack::Pop( newPart );
hgs
parents:
diff changeset
   175
    
hgs
parents:
diff changeset
   176
hgs
parents:
diff changeset
   177
hgs
parents:
diff changeset
   178
    return;
hgs
parents:
diff changeset
   179
    }
hgs
parents:
diff changeset
   180
hgs
parents:
diff changeset
   181
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   182
// 
hgs
parents:
diff changeset
   183
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   184
TEmailTypeId CEmailMultipart::InterfaceId() const
hgs
parents:
diff changeset
   185
    {
hgs
parents:
diff changeset
   186
    return KEmailIFUidMultipart;
hgs
parents:
diff changeset
   187
    }
hgs
parents:
diff changeset
   188
hgs
parents:
diff changeset
   189
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   190
// 
hgs
parents:
diff changeset
   191
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   192
void CEmailMultipart::Release()
hgs
parents:
diff changeset
   193
    {
hgs
parents:
diff changeset
   194
    if ( iOwner == EClientOwns )
hgs
parents:
diff changeset
   195
        {
hgs
parents:
diff changeset
   196
        delete this;
hgs
parents:
diff changeset
   197
        }
hgs
parents:
diff changeset
   198
    }
hgs
parents:
diff changeset
   199
hgs
parents:
diff changeset
   200
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   201
// 
hgs
parents:
diff changeset
   202
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   203
TMessageContentId CEmailMultipart::Id() const
hgs
parents:
diff changeset
   204
    {
hgs
parents:
diff changeset
   205
    return iEmailMsgContent->Id(); 
hgs
parents:
diff changeset
   206
    }
hgs
parents:
diff changeset
   207
hgs
parents:
diff changeset
   208
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   209
// 
hgs
parents:
diff changeset
   210
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   211
TPtrC CEmailMultipart::ContentType() const
hgs
parents:
diff changeset
   212
    {
hgs
parents:
diff changeset
   213
    return iEmailMsgContent->ContentType();
hgs
parents:
diff changeset
   214
    }
hgs
parents:
diff changeset
   215
hgs
parents:
diff changeset
   216
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   217
// 
hgs
parents:
diff changeset
   218
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   219
void CEmailMultipart::SetContentType( const TDesC& aContentType )
hgs
parents:
diff changeset
   220
    {
hgs
parents:
diff changeset
   221
    iEmailMsgContent->SetContentType( aContentType );
hgs
parents:
diff changeset
   222
    }
hgs
parents:
diff changeset
   223
hgs
parents:
diff changeset
   224
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   225
// 
hgs
parents:
diff changeset
   226
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   227
TPtrC CEmailMultipart::ContentId() const
hgs
parents:
diff changeset
   228
    {
hgs
parents:
diff changeset
   229
    return iEmailMsgContent->ContentId();
hgs
parents:
diff changeset
   230
    }
hgs
parents:
diff changeset
   231
hgs
parents:
diff changeset
   232
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   233
// 
hgs
parents:
diff changeset
   234
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   235
void CEmailMultipart::SetContentId( const TDesC& aContentId )
hgs
parents:
diff changeset
   236
    {
hgs
parents:
diff changeset
   237
    iEmailMsgContent->SetContentId( aContentId );
hgs
parents:
diff changeset
   238
    }
hgs
parents:
diff changeset
   239
hgs
parents:
diff changeset
   240
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   241
// 
hgs
parents:
diff changeset
   242
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   243
TPtrC CEmailMultipart::ContentDescription() const
hgs
parents:
diff changeset
   244
    {
hgs
parents:
diff changeset
   245
    return iEmailMsgContent->ContentDescription();
hgs
parents:
diff changeset
   246
    }
hgs
parents:
diff changeset
   247
hgs
parents:
diff changeset
   248
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   249
// 
hgs
parents:
diff changeset
   250
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   251
void CEmailMultipart::SetContentDescription( const TDesC& aContentDescription )
hgs
parents:
diff changeset
   252
    {
hgs
parents:
diff changeset
   253
    iEmailMsgContent->SetContentDescription( aContentDescription );
hgs
parents:
diff changeset
   254
    }
hgs
parents:
diff changeset
   255
hgs
parents:
diff changeset
   256
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   257
// 
hgs
parents:
diff changeset
   258
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   259
TPtrC CEmailMultipart::ContentDisposition() const
hgs
parents:
diff changeset
   260
    {
hgs
parents:
diff changeset
   261
    return iEmailMsgContent->ContentDisposition();
hgs
parents:
diff changeset
   262
    }
hgs
parents:
diff changeset
   263
hgs
parents:
diff changeset
   264
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   265
// 
hgs
parents:
diff changeset
   266
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   267
void CEmailMultipart::SetContentDisposition( const TDesC& aContentDisposition )
hgs
parents:
diff changeset
   268
    {
hgs
parents:
diff changeset
   269
    iEmailMsgContent->SetContentDisposition( aContentDisposition );
hgs
parents:
diff changeset
   270
    }
hgs
parents:
diff changeset
   271
hgs
parents:
diff changeset
   272
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   273
// 
hgs
parents:
diff changeset
   274
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   275
TPtrC CEmailMultipart::ContentClass() const
hgs
parents:
diff changeset
   276
    {
hgs
parents:
diff changeset
   277
    return iEmailMsgContent->ContentClass();
hgs
parents:
diff changeset
   278
    }
hgs
parents:
diff changeset
   279
hgs
parents:
diff changeset
   280
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   281
// 
hgs
parents:
diff changeset
   282
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   283
void CEmailMultipart::SetContentClass( const TDesC& aContentClass )
hgs
parents:
diff changeset
   284
    {
hgs
parents:
diff changeset
   285
    iEmailMsgContent->SetContentClass( aContentClass );
hgs
parents:
diff changeset
   286
    }
hgs
parents:
diff changeset
   287
hgs
parents:
diff changeset
   288
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   289
// 
hgs
parents:
diff changeset
   290
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   291
TInt CEmailMultipart::AvailableSize() const
hgs
parents:
diff changeset
   292
    {
hgs
parents:
diff changeset
   293
    return iEmailMsgContent->AvailableSize();
hgs
parents:
diff changeset
   294
    }
hgs
parents:
diff changeset
   295
hgs
parents:
diff changeset
   296
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   297
// 
hgs
parents:
diff changeset
   298
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   299
TInt CEmailMultipart::TotalSize() const
hgs
parents:
diff changeset
   300
    {
hgs
parents:
diff changeset
   301
    return iEmailMsgContent->TotalSize();
hgs
parents:
diff changeset
   302
    }
hgs
parents:
diff changeset
   303
hgs
parents:
diff changeset
   304
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   305
// 
hgs
parents:
diff changeset
   306
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   307
TPtrC CEmailMultipart::ContentL() const
hgs
parents:
diff changeset
   308
    {
hgs
parents:
diff changeset
   309
    User::Leave(KErrNotSupported);
hgs
parents:
diff changeset
   310
    return iEmailMsgContent->ContentL();
hgs
parents:
diff changeset
   311
    }
hgs
parents:
diff changeset
   312
hgs
parents:
diff changeset
   313
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   314
// 
hgs
parents:
diff changeset
   315
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   316
void CEmailMultipart::SetContentL( const TDesC& aContent )
hgs
parents:
diff changeset
   317
    {
hgs
parents:
diff changeset
   318
    iEmailMsgContent->SetContentL( aContent );
hgs
parents:
diff changeset
   319
    }
hgs
parents:
diff changeset
   320
hgs
parents:
diff changeset
   321
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   322
// 
hgs
parents:
diff changeset
   323
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   324
void CEmailMultipart::FetchL( MEmailFetchObserver& aObserver )
hgs
parents:
diff changeset
   325
    {
hgs
parents:
diff changeset
   326
    iEmailMsgContent->FetchL( aObserver );
hgs
parents:
diff changeset
   327
    }
hgs
parents:
diff changeset
   328
hgs
parents:
diff changeset
   329
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   330
// 
hgs
parents:
diff changeset
   331
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   332
void CEmailMultipart::CancelFetch()
hgs
parents:
diff changeset
   333
    {
hgs
parents:
diff changeset
   334
    iEmailMsgContent->CancelFetch();
hgs
parents:
diff changeset
   335
    }
hgs
parents:
diff changeset
   336
hgs
parents:
diff changeset
   337
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   338
// 
hgs
parents:
diff changeset
   339
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   340
void CEmailMultipart::SaveToFileL( const TDesC& aPath )
hgs
parents:
diff changeset
   341
    {
hgs
parents:
diff changeset
   342
    iEmailMsgContent->SaveToFileL( aPath );
hgs
parents:
diff changeset
   343
    }
hgs
parents:
diff changeset
   344
hgs
parents:
diff changeset
   345
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   346
// 
hgs
parents:
diff changeset
   347
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   348
MEmailMultipart* CEmailMultipart::AsMultipartOrNull() const
hgs
parents:
diff changeset
   349
    {
hgs
parents:
diff changeset
   350
    const MEmailMultipart* ptr = this;
hgs
parents:
diff changeset
   351
    return const_cast<MEmailMultipart*>( ptr );
hgs
parents:
diff changeset
   352
    }
hgs
parents:
diff changeset
   353
hgs
parents:
diff changeset
   354
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   355
// 
hgs
parents:
diff changeset
   356
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   357
MEmailTextContent* CEmailMultipart::AsTextContentOrNull() const
hgs
parents:
diff changeset
   358
    {
hgs
parents:
diff changeset
   359
    return NULL;
hgs
parents:
diff changeset
   360
    }
hgs
parents:
diff changeset
   361
hgs
parents:
diff changeset
   362
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   363
// 
hgs
parents:
diff changeset
   364
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   365
MEmailAttachment* CEmailMultipart::AsAttachmentOrNull() const
hgs
parents:
diff changeset
   366
    {
hgs
parents:
diff changeset
   367
    return NULL;
hgs
parents:
diff changeset
   368
    }
hgs
parents:
diff changeset
   369
hgs
parents:
diff changeset
   370
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   371
// 
hgs
parents:
diff changeset
   372
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   373
void CEmailMultipart::SetOwner( const TDataOwner aOwner )
hgs
parents:
diff changeset
   374
    {
hgs
parents:
diff changeset
   375
    iOwner = aOwner;
hgs
parents:
diff changeset
   376
    }
hgs
parents:
diff changeset
   377
hgs
parents:
diff changeset
   378
// End of file