messagingapp/msgui/unifiededitor/inc/msgattachmentcontainer.h
changeset 23 238255e8b033
child 25 84d9eb65b26f
equal deleted inserted replaced
5:4697dfb2d7ad 23:238255e8b033
       
     1 /*
       
     2  * Copyright (c) 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: Container class for msg attachments
       
    15  *
       
    16  */
       
    17 #ifndef MSGATTACHMENTCONTAINER_H
       
    18 #define MSGATTACHMENTCONTAINER_H
       
    19 
       
    20 #include <HbWidget>
       
    21 #include "msgunieditorattachment.h"
       
    22 
       
    23 class QGraphicsLinearLayout;
       
    24 class MmsInsertCheckOperation;
       
    25 
       
    26 class MsgAttachmentContainer : public HbWidget
       
    27     {
       
    28     Q_OBJECT
       
    29 
       
    30 public:
       
    31 
       
    32     /**
       
    33      * Constructor
       
    34      */
       
    35     MsgAttachmentContainer(const QString& pluginPath, QGraphicsItem *parent = 0);
       
    36 
       
    37     /**
       
    38      * Destructor
       
    39      */
       
    40     ~MsgAttachmentContainer();
       
    41 
       
    42     /**
       
    43      * add attachment to the container
       
    44 	 * @param filepath of the attachment
       
    45      */
       
    46     void addAttachment(const QString& filepath);
       
    47 
       
    48     /**
       
    49      * count of attachments in the container
       
    50 	 * @return count
       
    51      */
       
    52     int count();
       
    53     
       
    54     /**
       
    55      * List of attachments in the container
       
    56      * @return attachments list
       
    57      */
       
    58     MsgUnifiedEditorAttachmentList attachmentList();
       
    59 
       
    60 signals:
       
    61     /**
       
    62      * emit when container holds MM content
       
    63      */
       
    64     void mmContentAdded(bool isAdded);
       
    65 
       
    66     /**
       
    67      * emit to indicate view that container is now empty
       
    68 	 * View deletes the container if it becomes empty
       
    69      */
       
    70     void emptyAttachmentContainer();
       
    71     
       
    72     /**
       
    73      * Emitted when msg's attachment container size changes
       
    74      */
       
    75     void sizeChanged(int aSize);
       
    76 
       
    77 private slots:
       
    78     /**
       
    79      * delete attachment from the container
       
    80      */
       
    81     void deleteAttachment(MsgUnifiedEditorAttachment* attachment);
       
    82     
       
    83 private:
       
    84     /**
       
    85      * Size of the attachment container
       
    86      * @return size
       
    87      */
       
    88     int containerSize();
       
    89 
       
    90     /**
       
    91      * size of the msg
       
    92      */
       
    93     int messageSize();
       
    94     
       
    95 private:
       
    96     /**
       
    97      * style plugin's path
       
    98      */
       
    99     QString mPluginPath;
       
   100 
       
   101     /**
       
   102      * container's layout
       
   103      */
       
   104     QGraphicsLinearLayout* mLayout;
       
   105     
       
   106     /**
       
   107      * MMs insert check utility class
       
   108      */
       
   109     MmsInsertCheckOperation* mMmsInsertCheckOp;
       
   110 
       
   111     /**
       
   112      * attachment list
       
   113      */
       
   114     MsgUnifiedEditorAttachmentList mAttachmentList;
       
   115 
       
   116     /**
       
   117      * flag to tell, if container is holding MM content
       
   118      */
       
   119     bool mIsMMContent;
       
   120     };
       
   121 
       
   122 #endif // MSGATTACHMENTCONTAINER_H