|
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 body text field |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef NMEDITORTEXTEDIT_H_ |
|
19 #define NMEDITORTEXTEDIT_H_ |
|
20 |
|
21 #include <hbtextedit.h> |
|
22 #include"nmailuiwidgetsdef.h" |
|
23 |
|
24 class NmEditorContent; |
|
25 class NmBaseViewScrollArea; |
|
26 class HbScrollArea; |
|
27 |
|
28 |
|
29 class NMAILUIWIDGETS_EXPORT NmEditorTextEdit : public HbTextEdit |
|
30 { |
|
31 Q_OBJECT |
|
32 |
|
33 public: |
|
34 NmEditorTextEdit(QGraphicsItem *parent = 0); |
|
35 virtual ~NmEditorTextEdit(); |
|
36 |
|
37 void init(NmEditorContent *parent, NmBaseViewScrollArea *bgScrollArea); |
|
38 qreal contentHeight() const; |
|
39 |
|
40 void sendMousePressEvent(QGraphicsSceneMouseEvent *event); |
|
41 void sendMouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
42 void sendMouseMoveEvent(QGraphicsSceneMouseEvent *event); |
|
43 void sendLongPressEvent(const QPointF &point); |
|
44 void setCustomTextColor(const QPair<bool, QColor> &customColor); |
|
45 void setCustomTextColor(bool useCustom, const QColor& color = Qt::black); |
|
46 QPair<bool, QColor> customTextColor() const; |
|
47 |
|
48 signals: |
|
49 void setEditorContentHeight(); |
|
50 |
|
51 public slots: |
|
52 void updateEditorHeight(); |
|
53 void setHeaderHeight(int); |
|
54 void setScrollPosition(int oldPos, int newPos); |
|
55 void updateScrollPosition(const QPointF &newPosition); |
|
56 void updateCustomTextColor(); |
|
57 |
|
58 private: |
|
59 NmEditorContent *mParent; |
|
60 HbScrollArea *mScrollArea; |
|
61 NmBaseViewScrollArea *mBackgroundScrollArea; |
|
62 qreal mPreviousContentsHeight; |
|
63 int mHeaderHeight; |
|
64 QPointF mBgScrollPosition; |
|
65 bool mFirstTime; |
|
66 |
|
67 QPair<bool, QColor> mCustomTextColor;//!<This property keeps info about using customTextColor and color to use. |
|
68 }; |
|
69 |
|
70 #endif /* NMEDITORTEXTEDIT_H_ */ |