00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef KNOTEEDIT_H
00022
#define KNOTEEDIT_H
00023
00024
#include <qwidget.h>
00025
00026
#include <ktextedit.h>
00027
00028
class QFont;
00029
class QColor;
00030
class QPushButton;
00031
class KAction;
00032
class KToggleAction;
00033
class KFontAction;
00034
class KFontSizeAction;
00035
00036
00037
class KNoteEdit :
public KTextEdit
00038 {
00039 Q_OBJECT
00040
public:
00041 KNoteEdit(
QWidget *parent=0,
const char *name=0 );
00042 ~KNoteEdit();
00043
00044
void setText(
const QString& text );
00045
void setTextFont(
const QFont& font );
00046
void setTextColor(
const QColor& color );
00047
void setTabStop(
int tabs );
00048
void setAutoIndentMode(
bool newmode );
00049
00050
public slots:
00051
virtual void setTextFormat( TextFormat f );
00052
00053
void textStrikeOut(
bool );
00054
00055
void textColor();
00056
00057
void textAlignLeft();
00058
void textAlignCenter();
00059
void textAlignRight();
00060
void textAlignBlock();
00061
00062
void textList();
00063
00064
void textSuperScript();
00065
void textSubScript();
00066
00067
00068
00069
00070
protected:
00071
virtual void contentsDragEnterEvent(
QDragEnterEvent *e );
00072
virtual void contentsDropEvent(
QDropEvent *e );
00073
00074
private slots:
00075
void slotReturnPressed();
00076
00077
void fontChanged(
const QFont &f );
00078
void colorChanged(
const QColor &c );
00079
void alignmentChanged(
int a );
00080
void verticalAlignmentChanged( VerticalAlignment a );
00081
00082
private:
00083
void autoIndent();
00084
00085
virtual bool linksEnabled()
const {
return true; }
00086
virtual void emitLinkClicked(
const QString &s );
00087
00088
void enableRichTextActions();
00089
void disableRichTextActions();
00090
00091
private:
00092 KAction *m_cut;
00093 KAction *m_copy;
00094 KAction *m_paste;
00095
00096 KToggleAction *m_textBold;
00097 KToggleAction *m_textItalic;
00098 KToggleAction *m_textUnderline;
00099 KToggleAction *m_textStrikeOut;
00100
00101 KToggleAction *m_textAlignLeft;
00102 KToggleAction *m_textAlignCenter;
00103 KToggleAction *m_textAlignRight;
00104 KToggleAction *m_textAlignBlock;
00105
00106 KToggleAction *m_textList;
00107 KToggleAction *m_textSuper;
00108 KToggleAction *m_textSub;
00109
00110
00111
00112
00113 KAction *m_textColor;
00114 KFontAction *m_textFont;
00115 KFontSizeAction *m_textSize;
00116
00117
bool m_autoIndentMode;
00118 };
00119
00120
#endif