19 |
19 |
20 #include <HbWidget> |
20 #include <HbWidget> |
21 #include "msgunieditorattachment.h" |
21 #include "msgunieditorattachment.h" |
22 |
22 |
23 class QGraphicsLinearLayout; |
23 class QGraphicsLinearLayout; |
24 class MmsInsertCheckOperation; |
24 class MmsConformanceCheck; |
25 |
25 |
26 class MsgAttachmentContainer : public HbWidget |
26 class MsgAttachmentContainer : public HbWidget |
27 { |
27 { |
28 Q_OBJECT |
28 Q_OBJECT |
29 |
29 |
30 public: |
30 public: |
|
31 /** |
|
32 * Add Attachment success/failure states |
|
33 */ |
|
34 enum AddAttachmentStatus |
|
35 { |
|
36 EAddSuccess = 0, EAddNotSupported, EAddSizeExceed |
|
37 }; |
31 |
38 |
32 /** |
39 /** |
33 * Constructor |
40 * Constructor |
34 */ |
41 */ |
35 MsgAttachmentContainer(const QString& pluginPath, QGraphicsItem *parent = 0); |
42 MsgAttachmentContainer(const QString& pluginPath, QGraphicsItem *parent = 0); |
40 ~MsgAttachmentContainer(); |
47 ~MsgAttachmentContainer(); |
41 |
48 |
42 /** |
49 /** |
43 * add attachment to the container |
50 * add attachment to the container |
44 * @param filepath of the attachment |
51 * @param filepath of the attachment |
|
52 * @return add operation status |
45 */ |
53 */ |
46 void addAttachment(const QString& filepath); |
54 MsgAttachmentContainer::AddAttachmentStatus addAttachment( |
|
55 const QString& filepath); |
47 |
56 |
48 /** |
57 /** |
49 * count of attachments in the container |
58 * count of attachments in the container |
50 * @return count |
59 * @return count |
51 */ |
60 */ |
54 /** |
63 /** |
55 * List of attachments in the container |
64 * List of attachments in the container |
56 * @return attachments list |
65 * @return attachments list |
57 */ |
66 */ |
58 MsgUnifiedEditorAttachmentList attachmentList(); |
67 MsgUnifiedEditorAttachmentList attachmentList(); |
|
68 |
|
69 /** |
|
70 * Check if the container hold multimedia content |
|
71 * @return true, if multimedia content is present |
|
72 * false, otherwise. |
|
73 */ |
|
74 bool hasMMContent(); |
|
75 |
|
76 /** |
|
77 * Size of the attachment container |
|
78 * @return size |
|
79 */ |
|
80 int containerSize(); |
59 |
81 |
60 signals: |
82 signals: |
61 /** |
83 /** |
62 * emit when container holds MM content |
84 * emit when container content changes |
63 */ |
85 */ |
64 void mmContentAdded(bool isAdded); |
86 void contentChanged(); |
65 |
87 |
66 /** |
88 /** |
67 * emit to indicate view that container is now empty |
89 * emit to indicate view that container is now empty |
68 * View deletes the container if it becomes empty |
90 * View deletes the container if it becomes empty |
69 */ |
91 */ |
70 void emptyAttachmentContainer(); |
92 void emptyAttachmentContainer(); |
71 |
93 |
72 /** |
|
73 * Emitted when msg's attachment container size changes |
|
74 */ |
|
75 void sizeChanged(int aSize); |
|
76 |
|
77 private slots: |
94 private slots: |
78 /** |
95 /** |
79 * delete attachment from the container |
96 * delete attachment from the container |
80 */ |
97 */ |
81 void deleteAttachment(MsgUnifiedEditorAttachment* attachment); |
98 void deleteAttachment(MsgUnifiedEditorAttachment* attachment); |
82 |
99 |
83 private: |
100 private: |
84 /** |
|
85 * Size of the attachment container |
|
86 * @return size |
|
87 */ |
|
88 int containerSize(); |
|
89 |
|
90 /** |
101 /** |
91 * size of the msg |
102 * size of the msg |
92 */ |
103 */ |
93 int messageSize(); |
104 int messageSize(); |
94 |
105 |