37
|
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 MSG_UNIFIED_EDITOR_ATTACHMENT_CONTAINER_H
|
|
18 |
#define MSG_UNIFIED_EDITOR_ATTACHMENT_CONTAINER_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( 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 |
|
56
|
94 |
public slots:
|
37
|
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 |
/**
|
|
109 |
* container's layout
|
|
110 |
*/
|
|
111 |
QGraphicsLinearLayout* mLayout;
|
|
112 |
|
|
113 |
/**
|
|
114 |
* MMS conformance check utility class
|
|
115 |
*/
|
|
116 |
MmsConformanceCheck* mMmsConformanceCheck;
|
|
117 |
|
|
118 |
/**
|
|
119 |
* attachment list
|
|
120 |
*/
|
|
121 |
MsgUnifiedEditorAttachmentList mAttachmentList;
|
|
122 |
|
|
123 |
/**
|
|
124 |
* flag to tell, if container is holding MM content
|
|
125 |
*/
|
|
126 |
bool mIsMMContent;
|
|
127 |
};
|
|
128 |
|
|
129 |
#endif // MSG_UNIFIED_EDITOR_ATTACHMENT_CONTAINER_H
|