meetingrequest/mrservices/inc/cesmrattachment.h
branchRCL_3
changeset 12 4ce476e64c59
parent 11 0396474f30f5
child 13 8592a65ad3fb
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
     1 /*
       
     2 * Copyright (c) 2007-2009 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:  MRUI attachmen definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CESMRATTACHMENT_H
       
    20 #define CESMRATTACHMENT_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 /**
       
    25  * CESMRAttachment encapsulates MR attachment.
       
    26  *
       
    27  * @lib esmrservices.lib
       
    28  */
       
    29 NONSHARABLE_CLASS( CESMRAttachment ) : public CBase
       
    30     {
       
    31 public:
       
    32     /**
       
    33      * Attachment state information
       
    34      */
       
    35     enum TESMRAttachmentState
       
    36         {
       
    37         /** Unknown attachment state */
       
    38         EAttachmentStateUnknown,
       
    39         /** Attachment is now downlaoded to device */
       
    40         EAttachmentStateNotDownloaded,
       
    41         /** Attachment is downloaded to device */
       
    42         EAttachmentStateDownloaded
       
    43         };
       
    44 
       
    45 public: // Construction and destruction
       
    46     /**
       
    47      * Two-phased constructor. Creates and initializes
       
    48      * CESMRAttachment object. Ownership transferred to caller.
       
    49      *
       
    50      * @return Pointer to esmr CESMRAttachment handler object.
       
    51      */
       
    52      IMPORT_C static CESMRAttachment* NewL();
       
    53 
       
    54      /**
       
    55       * Two-phased constructor. Creates and initializes
       
    56       * CESMRAttachment object. Ownership transferred to caller and
       
    57       * created object is left to cleanup stack.
       
    58       * 
       
    59       * @param aAttachmentName File name of attachment
       
    60       * @param aSizeInBytes size of attachment
       
    61       * @param aAttachmentState state of attachment download
       
    62       * @return Pointer to esmr CESMRAttachment handler object.
       
    63       */
       
    64      IMPORT_C static CESMRAttachment* NewL(
       
    65              const TDesC& aAttachmentName,
       
    66              TInt aSizeInBytes,
       
    67              TESMRAttachmentState aAttachmentState );
       
    68 
       
    69      /**
       
    70       * C++ Destructor.
       
    71       */
       
    72       IMPORT_C ~CESMRAttachment();
       
    73 
       
    74 public: // Interface
       
    75     /**
       
    76      * Sets name of attachment
       
    77      *
       
    78      * @param aAttachmentName File name of attachment
       
    79      */
       
    80     IMPORT_C void SetAttachmentNameL(
       
    81             const TDes& aAttachmentName );
       
    82 
       
    83     /**
       
    84      * Gets name of attachment
       
    85      *
       
    86      * @return File name of attachment
       
    87      */
       
    88     IMPORT_C const TDesC& AttachmentName() const;
       
    89 
       
    90     /**
       
    91      * Sets size of attachment
       
    92      *
       
    93      * @param aAttachmentSizeInBytes size of attachment in bytes
       
    94      */
       
    95     IMPORT_C void SetAttachmentSize(
       
    96             TInt aAttachmentSizeInBytes );
       
    97 
       
    98     /**
       
    99      * return size of attachment in bytes
       
   100      *
       
   101      * @return size of attachment
       
   102      */
       
   103     IMPORT_C TInt AttachmentSizeInBytes() const;
       
   104 
       
   105     /**
       
   106      * Sets download state of attachment
       
   107      *
       
   108      * @param aAttachmentState download state of attachment
       
   109      */
       
   110     IMPORT_C void SetAttachmentState(
       
   111             TESMRAttachmentState aAttachmentState );
       
   112 
       
   113     /**
       
   114      * Gets download state of attachment
       
   115      *
       
   116      * @return download state of attachment
       
   117      */
       
   118     IMPORT_C TESMRAttachmentState AttachmenState() const;
       
   119 
       
   120 
       
   121 private: // Implementation
       
   122     CESMRAttachment(
       
   123              TInt aSizeInBytes,
       
   124              TESMRAttachmentState aAttachmentState );
       
   125     void ConstructL(
       
   126              const TDesC& aAttachmentName );
       
   127 
       
   128 private: // data
       
   129     /// Own: Attachment name
       
   130     HBufC* iAttachmentName;
       
   131     /// Own: Attachment size in bytes.
       
   132     TInt iSizeInBytes;
       
   133     /// Own: AttachmenSize
       
   134     TESMRAttachmentState iState;
       
   135     };
       
   136 
       
   137 #endif // CESMRATTACHMENT_H
       
   138 
       
   139 // EOF