|
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 contents widget |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef NMEDITORCONTENT_H_ |
|
19 #define NMEDITORCONTENT_H_ |
|
20 |
|
21 #include <hbwidget.h> |
|
22 #include "nmuiviewids.h" |
|
23 |
|
24 class HbAnchorLayout; |
|
25 class HbTextEdit; |
|
26 class HbDocumentLoader; |
|
27 class NmBaseViewScrollArea; |
|
28 class NmMessage; |
|
29 class NmMessageEnvelope; |
|
30 class NmEditorHeader; |
|
31 class NmEditorTextEdit; |
|
32 class QNetworkAccessManager; |
|
33 class NmApplication; |
|
34 |
|
35 class NmEditorContent : public QObject |
|
36 { |
|
37 Q_OBJECT |
|
38 |
|
39 public: |
|
40 NmEditorContent(QObject *parent, |
|
41 HbDocumentLoader *documentLoader, |
|
42 QNetworkAccessManager &manager, |
|
43 NmApplication &application); |
|
44 |
|
45 virtual ~NmEditorContent(); |
|
46 |
|
47 void setBodyContent(NmUiEditorStartMode editorStartMode, |
|
48 const NmMessage *originalMessage, |
|
49 const QString *signature); |
|
50 |
|
51 NmEditorTextEdit* editor() const; |
|
52 |
|
53 NmEditorHeader* header() const; |
|
54 |
|
55 private: |
|
56 void createConnections(); |
|
57 void removeEmbeddedImages(QString &bodyContent); |
|
58 |
|
59 signals: |
|
60 void setPlainText(const QString&); |
|
61 |
|
62 void setHtml(const QString&); |
|
63 |
|
64 public slots: |
|
65 void setEditorContentHeight(); |
|
66 void setEditorContentWidth(); |
|
67 void ensureCursorVisibility(); |
|
68 void repositHeader(const QPointF &scrollPosition); |
|
69 |
|
70 private: |
|
71 NmEditorHeader *mHeader; // Not owned |
|
72 NmEditorTextEdit *mEditorWidget; // Not owned |
|
73 NmBaseViewScrollArea *mScrollArea; // Not owned |
|
74 HbWidget *mScrollAreaContents; // Not owned |
|
75 QPointF mScrollPosition; |
|
76 NmApplication &mApplication; |
|
77 bool mNeedForWidthAdjustment; |
|
78 }; |
|
79 |
|
80 #endif /* NMEDITORCONTENT_H_ */ |