mobilemessaging/unieditor/utils/inc/UniObjectsModel.h
changeset 79 2981cb3aa489
parent 0 72b543305e3a
equal deleted inserted replaced
25:84d9eb65b26f 79:2981cb3aa489
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:   Unified Message Editor objects model.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_UNIOBJECTSMODEL_H
       
    20 #define C_UNIOBJECTSMODEL_H
       
    21 
       
    22 // ========== INCLUDE FILES ================================
       
    23 
       
    24 #include <MsgAttachmentModel.h>
       
    25 #include <MsgAttachmentUtils.h>
       
    26 #include <unimodelconst.h>
       
    27 
       
    28 // ========== CONSTANTS ====================================
       
    29 
       
    30 // ========== MACROS =======================================
       
    31 
       
    32 // ========== FUNCTION PROTOTYPES ==========================
       
    33 
       
    34 // ========== FORWARD DECLARATIONS =========================
       
    35 
       
    36 class CUniDataUtils;
       
    37 class CUniObject;
       
    38 class CUniObjectsInfo;
       
    39 
       
    40 // ========== DATA TYPES ===================================
       
    41 
       
    42 // ========== CLASS DECLARATION ============================
       
    43 
       
    44 /**
       
    45 * Unified Editor objects model derived from attachment model.
       
    46 *
       
    47 * @lib UniUtils.lib
       
    48 *
       
    49 * @since S60 3.2
       
    50 */
       
    51 NONSHARABLE_CLASS( CUniObjectsModel ) : public CMsgAttachmentModel
       
    52     {
       
    53 
       
    54     public:
       
    55 
       
    56         /**
       
    57          * Factory method that creates this object.
       
    58          *
       
    59          * @since S60 3.2
       
    60          *
       
    61          * @param aReadOnly - Boolean flag.
       
    62          */
       
    63         IMPORT_C static CMsgAttachmentModel* NewL( TBool aReadOnly );
       
    64 
       
    65         /**
       
    66          * Destructor
       
    67          *
       
    68          * @since S60 3.2
       
    69          */
       
    70         virtual ~CUniObjectsModel();
       
    71 
       
    72         /**
       
    73          * Adds object to the internal array. Notifies attachment model
       
    74          * observer with EMsgAttachmentAdded parameter.
       
    75          * Overrides CMsgAttachmentModel::AddAttachmentL.
       
    76          *
       
    77          * @since S60 3.2
       
    78          *
       
    79          * @param aObject Object to be added.       
       
    80          * @param aDRMType DRM type of the object.               
       
    81          * @param aAttachmentObject ETrue is object is attachment. Otherwise EFalse. 
       
    82          * @param aSlideNumber Slide number where object is located.          
       
    83          * @param aIndex Index of the object.
       
    84          *             
       
    85          * @return Pointer to the added object's attachment info.
       
    86          */
       
    87         CUniObjectsInfo* AddObjectL(
       
    88             CUniObject& aObject,
       
    89             TInt aDRMType,
       
    90             TBool aAttachmentObject,
       
    91             TInt aSlideNumber,
       
    92             TInt aIndex = KErrNotFound );
       
    93         
       
    94         /**
       
    95          * Adds empty slide to the internal array. Notifies attachment model
       
    96          * observer with EMsgAttachmentAdded parameter.
       
    97          *
       
    98          * @since S60 3.2
       
    99          *
       
   100          * @param aEmptySlideName Empty slide name string.
       
   101          * @param aIndex Index of the object.
       
   102          *             
       
   103          * @return Pointer to the added object's attachment info.
       
   104          */
       
   105         CUniObjectsInfo* AddEmptySlideL(
       
   106             const TDesC& aEmptySlideName,
       
   107             TInt aIndex = KErrNotFound );
       
   108 
       
   109         /**
       
   110          * Deletes attachment from internal array. Notifies attachment model
       
   111          * observer with EMsgAttachmentRemoved parameter if aNotifyObserver flag is set.
       
   112          *
       
   113          * @since S60 3.2
       
   114          *
       
   115          * @param aIndex - index of the object to be deleted.
       
   116          * @param aNotifyObserver - Boolean flag to determine whether 
       
   117          *                          observer is notified about model change.
       
   118          */
       
   119         void DeleteObjectL( TInt aIndex, TBool aNotifyObserver );
       
   120 
       
   121         /**
       
   122          * Change order of attachment.
       
   123          *
       
   124          * @since S60 3.2
       
   125          *
       
   126          * @param aIndex - Index of the attachment
       
   127          * @param aNewPosition - Index of the new position of the attachment.
       
   128          */
       
   129         void ChangeOrderL (TInt aIndex, TInt aNewPosition);
       
   130 
       
   131         /**
       
   132          * Notify observer about the order change.
       
   133          *
       
   134          * @since S60 3.2
       
   135          *
       
   136          * @param aLayout - New layout of the message.
       
   137          */
       
   138         void NotifyChangeOrderL ( TUniLayout aLayout );
       
   139 
       
   140         /**
       
   141          * Loads mms slide bitmap.
       
   142          *
       
   143          * @since S60 3.2
       
   144          *
       
   145          * @return bitmap.
       
   146          */
       
   147         CGulIcon* BitmapForMmsSlideL();
       
   148 
       
   149     protected:
       
   150 
       
   151         /**
       
   152          * Constructor.
       
   153          *
       
   154          * @since S60 3.2
       
   155          *
       
   156          * @param aReadOnly 
       
   157          */
       
   158         CUniObjectsModel( TBool aReadOnly );
       
   159 
       
   160     private:
       
   161 
       
   162         /**
       
   163          * Creates new attachment (object) info object.
       
   164          *
       
   165          * @param aFileName            
       
   166          * @param aSize                
       
   167          * @param aFetched             
       
   168          * @param aAttachedThisSession 
       
   169          * @param aDataType
       
   170          * @param aDRMDataType
       
   171          */
       
   172         virtual CMsgAttachmentInfo* CreateNewInfoL(
       
   173             const TDesC&    aFileName,
       
   174             TInt            aSize,
       
   175             TBool           aFetched,
       
   176             TBool           aAttachedThisSession,
       
   177             TMsvAttachmentId aAttachmentId,
       
   178             const TDataType& aDataType,
       
   179             CMsgAttachmentInfo::TDRMDataType aDRMDataType );
       
   180 
       
   181     private:
       
   182 
       
   183         CGulIcon* iMmsSlideIcon;
       
   184     };
       
   185 
       
   186 #endif // C_UNIOBJECTSMODEL_H
       
   187 
       
   188 // End of File