19 #define NMEDITORTEXTEDIT_H_ |
19 #define NMEDITORTEXTEDIT_H_ |
20 |
20 |
21 #include <hbtextedit.h> |
21 #include <hbtextedit.h> |
22 #include "nmailuiwidgetsdef.h" |
22 #include "nmailuiwidgetsdef.h" |
23 |
23 |
24 class NmBaseViewScrollArea; |
|
25 class HbScrollArea; |
|
26 |
|
27 |
|
28 class NMAILUIWIDGETS_EXPORT NmEditorTextEdit : public HbTextEdit |
24 class NMAILUIWIDGETS_EXPORT NmEditorTextEdit : public HbTextEdit |
29 { |
25 { |
30 Q_OBJECT |
26 Q_OBJECT |
31 |
27 |
32 public: |
28 public: |
33 NmEditorTextEdit(QGraphicsItem *parent = 0); |
29 NmEditorTextEdit(QGraphicsItem *parent = 0); |
34 virtual ~NmEditorTextEdit(); |
30 virtual ~NmEditorTextEdit(); |
35 |
31 |
36 void init(NmBaseViewScrollArea *bgScrollArea); |
|
37 qreal contentHeight() const; |
|
38 |
|
39 void setCustomTextColor(const QPair<bool, QColor> &customColor); |
32 void setCustomTextColor(const QPair<bool, QColor> &customColor); |
40 void setCustomTextColor(bool useCustom, const QColor& color = Qt::black); |
33 void setCustomTextColor(bool useCustom, const QColor& color = Qt::black); |
41 QPair<bool, QColor> customTextColor() const; |
34 QPair<bool, QColor> customTextColor() const; |
42 |
35 |
43 signals: |
36 QRectF rectForPosition(int position); |
44 void editorContentHeightChanged(); |
|
45 |
37 |
46 public slots: |
38 public slots: |
47 void updateEditorHeight(); |
|
48 void setHeaderHeight(int); |
|
49 void setScrollPosition(int oldPos, int newPos); |
|
50 void updateScrollPosition(const QPointF &newPosition); |
|
51 void updateCustomTextColor(); |
39 void updateCustomTextColor(); |
52 |
40 |
53 private: |
41 private: |
54 HbScrollArea *mScrollArea; |
|
55 NmBaseViewScrollArea *mBackgroundScrollArea; |
|
56 qreal mPreviousContentsHeight; |
|
57 int mHeaderHeight; |
|
58 QPointF mBgScrollPosition; |
|
59 bool mFirstTime; |
|
60 bool mFirstTimeToScrollPosUpdate; |
|
61 |
|
62 QPair<bool, QColor> mCustomTextColor;//!<This property keeps info about using customTextColor and color to use. |
42 QPair<bool, QColor> mCustomTextColor;//!<This property keeps info about using customTextColor and color to use. |
63 }; |
43 }; |
64 |
44 |
65 #endif /* NMEDITORTEXTEDIT_H_ */ |
45 #endif /* NMEDITORTEXTEDIT_H_ */ |