knoteedit.h
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 KAction;
00031 class KToggleAction;
00032
00033
00034 class KNoteEdit : public KTextEdit
00035 {
00036 Q_OBJECT
00037 public:
00038 KNoteEdit( QWidget *parent=0, const char *name=0 );
00039 ~KNoteEdit();
00040
00041 void readFile( const QString& filename );
00042 void dumpToFile( const QString& filename ) const;
00043
00044 void setTextFont( const QFont& font );
00045 void setTextColor( const QColor& color );
00046 void setTabStop( int tabs );
00047 void setAutoIndentMode( bool newmode );
00048
00049 public slots:
00050 virtual void setTextFormat( TextFormat f );
00051
00052
00053
00054
00055
00056 void textColor();
00057
00058 void textAlignLeft();
00059 void textAlignCenter();
00060 void textAlignRight();
00061 void textAlignBlock();
00062
00063 void textList();
00064
00065 void textSuperScript();
00066 void textSubScript();
00067
00068 void textIncreaseIndent();
00069 void textDecreaseIndent();
00070
00071 signals:
00072 void gotUrlDrop( const QString& url );
00073
00074 protected:
00075 virtual void contentsDragEnterEvent( QDragEnterEvent *e );
00076 virtual void contentsDragMoveEvent( QDragMoveEvent *e );
00077 virtual void contentsDropEvent( QDropEvent *e );
00078
00079 private slots:
00080 void slotReturnPressed();
00081
00082 void fontChanged( const QFont &f );
00083 void colorChanged( const QColor &c );
00084 void alignmentChanged( int a );
00085 void verticalAlignmentChanged( VerticalAlignment a );
00086
00087 private:
00088 void autoIndent();
00089
00090 void enableRichTextActions();
00091 void disableRichTextActions();
00092
00093
00094 KAction *m_cut;
00095 KAction *m_copy;
00096 KAction *m_paste;
00097
00098 KAction *m_textColor;
00099
00100 KToggleAction *m_textBold;
00101 KToggleAction *m_textItalic;
00102 KToggleAction *m_textUnderline;
00103
00104 KToggleAction *m_textAlignLeft;
00105 KToggleAction *m_textAlignCenter;
00106 KToggleAction *m_textAlignRight;
00107 KToggleAction *m_textAlignBlock;
00108
00109 KToggleAction *m_textList;
00110 KToggleAction *m_textSuper;
00111 KToggleAction *m_textSub;
00112
00113 KAction *m_textIncreaseIndent;
00114 KAction *m_textDecreaseIndent;
00115
00116 bool m_autoIndentMode;
00117 };
00118
00119 #endif
This file is part of the documentation for kdelibs Version 3.1.4.