|
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: Message editor header widget |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef NMEDITORHEADER_H_ |
|
19 #define NMEDITORHEADER_H_ |
|
20 |
|
21 #include <hbwidget.h> |
|
22 #include "nmactionresponse.h" |
|
23 |
|
24 class HbGroupBox; |
|
25 class HbLabel; |
|
26 class HbDocumentLoader; |
|
27 class NmHtmlLineEdit; |
|
28 class NmRecipientLineEdit; |
|
29 class QGraphicsLinearLayout; |
|
30 class NmRecipientField; |
|
31 class NmAttachmentList; |
|
32 class NmAttachmentListWidget; |
|
33 class NmApplication; |
|
34 |
|
35 class NmEditorHeader : public QObject |
|
36 { |
|
37 Q_OBJECT |
|
38 |
|
39 public: |
|
40 NmEditorHeader(QObject *parent, NmApplication &application, HbDocumentLoader *documentLoader); |
|
41 virtual ~NmEditorHeader(); |
|
42 qreal headerHeight() const; |
|
43 NmHtmlLineEdit *subjectEdit() const; |
|
44 NmRecipientLineEdit *toEdit() const; |
|
45 NmRecipientLineEdit *ccEdit() const; |
|
46 NmRecipientLineEdit *bccEdit() const; |
|
47 void setPriority(NmMessagePriority priority=NmMessagePriorityNormal); |
|
48 void setPriority(NmActionResponseCommand prio=NmActionResponseCommandNone); |
|
49 void addAttachment(const QString &fileName, const QString &fileSize, const NmId &nmid); |
|
50 void removeAttachment(const QString &fileName); |
|
51 void removeAttachment(const NmId &nmid); |
|
52 void setAttachmentParameters( |
|
53 const QString &fileName, |
|
54 const NmId &msgPartId, |
|
55 const QString &fileSize, |
|
56 int result); |
|
57 void setFieldVisibility(bool isVisible); |
|
58 void adjustHeaderWidth(); |
|
59 void repositHeader(const QTransform &transform); |
|
60 |
|
61 private: |
|
62 void loadWidgets(); |
|
63 void createConnections(); |
|
64 |
|
65 signals: |
|
66 void headerHeightChanged(int); |
|
67 void recipientFieldsHaveContent(bool recipientFieldsHaveContent); |
|
68 void attachmentLongPressed(NmId attachmentPartId, QPointF point); |
|
69 void attachmentShortPressed(NmId attachmentId); |
|
70 |
|
71 public slots: |
|
72 void sendDelayedHeaderHeightChanged(); |
|
73 void sendHeaderHeightChanged(); |
|
74 void editorContentChanged(); |
|
75 void attachmentActivated(int arrayIndex); |
|
76 void attachmentLongPressed(int arrayIndex, QPointF point); |
|
77 |
|
78 private: |
|
79 NmApplication &mApplication; |
|
80 HbDocumentLoader* mDocumentLoader; // Not owned |
|
81 qreal mHeaderHeight; |
|
82 HbLabel *mPriorityIcon; // Not owned |
|
83 HbLabel *mFollowUpIcon; // Not owned |
|
84 bool mIconVisible; |
|
85 NmRecipientLineEdit *mToEdit; // Not owned |
|
86 NmRecipientLineEdit *mCcEdit; // Not owned |
|
87 NmRecipientLineEdit *mBccEdit; // Not owned |
|
88 NmHtmlLineEdit *mSubjectEdit; // Not owned |
|
89 bool mRecipientFieldsEmpty; |
|
90 QGraphicsLinearLayout *mLayout; // Not owned |
|
91 NmAttachmentList *mAttachmentList; // Not owned |
|
92 NmAttachmentListWidget *mAttachmentListWidget; // Not owned |
|
93 NmRecipientField *mToField; // Not owned |
|
94 HbWidget *mToWidget; // Not owned |
|
95 NmRecipientField *mCcField; // Not owned |
|
96 HbWidget *mCcWidget; // Not owned |
|
97 NmRecipientField *mBccField; // Not owned |
|
98 HbWidget *mBccWidget; // Not owned |
|
99 HbWidget *mSubjectWidget; // Not owned |
|
100 QGraphicsLinearLayout *mSubjectLayout; // Not owned |
|
101 bool mCcBccFieldVisible; |
|
102 }; |
|
103 |
|
104 #endif /* NMEDITORHEADER_H_ */ |