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 MmsConformanceCheck; |
|
25 |
|
26 class MsgAttachmentContainer : public HbWidget |
|
27 { |
|
28 Q_OBJECT |
|
29 |
|
30 public: |
|
31 /** |
|
32 * Add Attachment success/failure states |
|
33 */ |
|
34 enum AddAttachmentStatus |
|
35 { |
|
36 EAddSuccess = 0, EAddNotSupported, EAddSizeExceed |
|
37 }; |
|
38 |
|
39 /** |
|
40 * Constructor |
|
41 */ |
|
42 MsgAttachmentContainer(const QString& pluginPath, QGraphicsItem *parent = 0); |
|
43 |
|
44 /** |
|
45 * Destructor |
|
46 */ |
|
47 ~MsgAttachmentContainer(); |
|
48 |
|
49 /** |
|
50 * add attachment to the container |
|
51 * @param filepath of the attachment |
|
52 * @return add operation status |
|
53 */ |
|
54 MsgAttachmentContainer::AddAttachmentStatus addAttachment( |
|
55 const QString& filepath); |
|
56 |
|
57 /** |
|
58 * count of attachments in the container |
|
59 * @return count |
|
60 */ |
|
61 int count(); |
|
62 |
|
63 /** |
|
64 * List of attachments in the container |
|
65 * @return attachments list |
|
66 */ |
|
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(); |
|
81 |
|
82 signals: |
|
83 /** |
|
84 * emit when container content changes |
|
85 */ |
|
86 void contentChanged(); |
|
87 |
|
88 /** |
|
89 * emit to indicate view that container is now empty |
|
90 * View deletes the container if it becomes empty |
|
91 */ |
|
92 void emptyAttachmentContainer(); |
|
93 |
|
94 private slots: |
|
95 /** |
|
96 * delete attachment from the container |
|
97 */ |
|
98 void deleteAttachment(MsgUnifiedEditorAttachment* attachment); |
|
99 |
|
100 private: |
|
101 /** |
|
102 * size of the msg |
|
103 */ |
|
104 int messageSize(); |
|
105 |
|
106 private: |
|
107 /** |
|
108 * style plugin's path |
|
109 */ |
|
110 QString mPluginPath; |
|
111 |
|
112 /** |
|
113 * container's layout |
|
114 */ |
|
115 QGraphicsLinearLayout* mLayout; |
|
116 |
|
117 /** |
|
118 * MMS conformance check utility class |
|
119 */ |
|
120 MmsConformanceCheck* mMmsConformanceCheck; |
|
121 |
|
122 /** |
|
123 * attachment list |
|
124 */ |
|
125 MsgUnifiedEditorAttachmentList mAttachmentList; |
|
126 |
|
127 /** |
|
128 * flag to tell, if container is holding MM content |
|
129 */ |
|
130 bool mIsMMContent; |
|
131 }; |
|
132 |
|
133 #endif // MSGATTACHMENTCONTAINER_H |
|