|
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:attachment field to show attachment details. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef UNIFIED_EDITOR_ATTACHMENT_H |
|
19 #define UNIFIED_EDITOR_ATTACHMENT_H |
|
20 |
|
21 #include <hbwidget.h> |
|
22 #include <QList> |
|
23 |
|
24 class HbTextItem; |
|
25 class HbIconItem; |
|
26 class HbPushButton; |
|
27 |
|
28 class MsgUnifiedEditorAttachment : public HbWidget |
|
29 { |
|
30 Q_OBJECT |
|
31 |
|
32 public: |
|
33 |
|
34 /** |
|
35 * Constructor |
|
36 */ |
|
37 MsgUnifiedEditorAttachment( const QString& pluginPath, |
|
38 const QString& attachmentpath, |
|
39 const int filesize, |
|
40 QGraphicsItem *parent = 0 ); |
|
41 |
|
42 /** |
|
43 * Destructor |
|
44 */ |
|
45 ~MsgUnifiedEditorAttachment(); |
|
46 |
|
47 /** |
|
48 * Seeker method to get the path of the attachment |
|
49 * @return path of the attachment |
|
50 */ |
|
51 const QString& path(); |
|
52 |
|
53 /** |
|
54 * Seeker method to get the size of the attachment |
|
55 * @return size in bytes |
|
56 */ |
|
57 qreal size(); |
|
58 |
|
59 /** |
|
60 * Seeker method to get mimetype of the attachment |
|
61 * @return mimetype |
|
62 */ |
|
63 const QString& mimeType(); |
|
64 |
|
65 /** |
|
66 * Check if the attachment content is MM content |
|
67 * @return true/false |
|
68 */ |
|
69 bool isMultimediaContent(); |
|
70 |
|
71 signals: |
|
72 /** |
|
73 * emit when short-tap happens on the attachment |
|
74 */ |
|
75 void clicked(); |
|
76 |
|
77 /** |
|
78 * emit when 'remove' option is selected from longpress menu |
|
79 */ |
|
80 void deleteMe(MsgUnifiedEditorAttachment* attachment); |
|
81 |
|
82 private slots: |
|
83 /** |
|
84 * show longpress menu for attachment object |
|
85 */ |
|
86 void longPressed(QPointF position); |
|
87 |
|
88 /** |
|
89 * slot to remove attachment from msg editor |
|
90 */ |
|
91 void removeAttachment(); |
|
92 |
|
93 /** |
|
94 * slot to open attachment |
|
95 */ |
|
96 void openAttachment(); |
|
97 |
|
98 /** |
|
99 * slot to view details of the attachment file |
|
100 */ |
|
101 void viewDetails(); |
|
102 |
|
103 private: |
|
104 /** |
|
105 * style plugin path |
|
106 */ |
|
107 QString mPluginPath; |
|
108 |
|
109 /** |
|
110 * attachment file's path |
|
111 */ |
|
112 QString mPath; |
|
113 |
|
114 /** |
|
115 * attachment's size in bytes |
|
116 */ |
|
117 qreal mSize; |
|
118 |
|
119 /** |
|
120 * attachment file's mimetype |
|
121 */ |
|
122 QString mMimeType; |
|
123 |
|
124 /** |
|
125 * layout icon to indicate attachment |
|
126 */ |
|
127 HbIconItem* mAttachmentIcon; |
|
128 |
|
129 /** |
|
130 * layout item to hold attachment's name |
|
131 */ |
|
132 HbTextItem* mAttachmentName; |
|
133 |
|
134 /** |
|
135 * layout item to hold attachment's details e.g. size |
|
136 */ |
|
137 HbTextItem* mAttachmentDetails; |
|
138 |
|
139 /** |
|
140 * layout item for background |
|
141 */ |
|
142 HbPushButton *mFrameItem; |
|
143 |
|
144 }; |
|
145 |
|
146 typedef QList<MsgUnifiedEditorAttachment*> MsgUnifiedEditorAttachmentList; |
|
147 |
|
148 #endif //UNIFIED_EDITOR_ATTACHMENT_H |