knotes
knoteedit.h00001
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 KActionCollection;
00033 class KToggleAction;
00034 class KFontAction;
00035 class KFontSizeAction;
00036
00037
00038 class KNoteEdit : public KTextEdit
00039 {
00040 Q_OBJECT
00041 public:
00042 KNoteEdit( KActionCollection *actions, QWidget *parent=0, const char *name=0 );
00043 ~KNoteEdit();
00044
00045 void setText( const QString& text );
00046 void setTextFont( const QFont& font );
00047 void setTextColor( const QColor& color );
00048 void setTabStop( int tabs );
00049 void setAutoIndentMode( bool newmode );
00050
00051 public slots:
00052 virtual void setTextFormat( TextFormat f );
00053
00054 void textStrikeOut( bool );
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
00069
00070
00071 protected:
00072 virtual void contentsDragEnterEvent( QDragEnterEvent *e );
00073 virtual void contentsDropEvent( QDropEvent *e );
00074
00075 private slots:
00076 void slotReturnPressed();
00077
00078 void fontChanged( const QFont &f );
00079 void colorChanged( const QColor &c );
00080 void alignmentChanged( int a );
00081 void verticalAlignmentChanged( VerticalAlignment a );
00082
00083 private:
00084 void autoIndent();
00085
00086 virtual bool linksEnabled() const { return true; }
00087 virtual void emitLinkClicked( const QString &s );
00088
00089 void enableRichTextActions();
00090 void disableRichTextActions();
00091
00092 private:
00093 KAction *m_cut;
00094 KAction *m_copy;
00095 KAction *m_paste;
00096
00097 KToggleAction *m_textBold;
00098 KToggleAction *m_textItalic;
00099 KToggleAction *m_textUnderline;
00100 KToggleAction *m_textStrikeOut;
00101
00102 KToggleAction *m_textAlignLeft;
00103 KToggleAction *m_textAlignCenter;
00104 KToggleAction *m_textAlignRight;
00105 KToggleAction *m_textAlignBlock;
00106
00107 KToggleAction *m_textList;
00108 KToggleAction *m_textSuper;
00109 KToggleAction *m_textSub;
00110
00111
00112
00113
00114 KAction *m_textColor;
00115 KFontAction *m_textFont;
00116 KFontSizeAction *m_textSize;
00117
00118 bool m_autoIndentMode;
00119 };
00120
00121 #endif
|