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 <tqwidget.h>
00025
00026 #include <ktextedit.h>
00027 class KNote;
00028 class TQFont;
00029 class TQColor;
00030 class TQPushButton;
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 TQ_OBJECT
00042 public:
00043 KNoteEdit( KActionCollection *actions, TQWidget *parent=0, const char *name=0 );
00044 ~KNoteEdit();
00045 void setNote( KNote *_note ) {
00046 m_note = _note;
00047 }
00048 void setText( const TQString& text );
00049 void setTextFont( const TQFont& font );
00050 void setTextColor( const TQColor& color );
00051 void setTabStop( int tabs );
00052 void setAutoIndentMode( bool newmode );
00053
00054 public slots:
00055 virtual void setTextFormat( TextFormat f );
00056
00057 void textStrikeOut( bool );
00058
00059 void textColor();
00060
00061 void textAlignLeft();
00062 void textAlignCenter();
00063 void textAlignRight();
00064 void textAlignBlock();
00065
00066 void textList();
00067
00068 void textSuperScript();
00069 void textSubScript();
00070
00071
00072
00073 void slotCutEnabled( bool );
00074
00075 protected:
00076 virtual void contentsDragEnterEvent( TQDragEnterEvent *e );
00077 virtual void contentsDropEvent( TQDropEvent *e );
00078 virtual TQPopupMenu *createPopupMenu( const TQPoint &pos );
00079
00080 private slots:
00081 void slotReturnPressed();
00082
00083 void fontChanged( const TQFont &f );
00084 void colorChanged( const TQColor &c );
00085 void alignmentChanged( int a );
00086 void verticalAlignmentChanged( VerticalAlignment a );
00087 void slotAllowTab();
00088
00089 void setEnabledRedo( bool b );
00090 void setEnabledUndo( bool b );
00091
00092 private:
00093 void autoIndent();
00094
00095 virtual bool linksEnabled() const { return true; }
00096 virtual void emitLinkClicked( const TQString &s );
00097
00098 void enableRichTextActions();
00099 void disableRichTextActions();
00100
00101 private:
00102 KAction *m_cut;
00103 KAction *m_copy;
00104 KAction *m_paste;
00105
00106 KToggleAction *m_textBold;
00107 KToggleAction *m_textItalic;
00108 KToggleAction *m_textUnderline;
00109 KToggleAction *m_textStrikeOut;
00110
00111 KToggleAction *m_textAlignLeft;
00112 KToggleAction *m_textAlignCenter;
00113 KToggleAction *m_textAlignRight;
00114 KToggleAction *m_textAlignBlock;
00115
00116 KToggleAction *m_textList;
00117 KToggleAction *m_textSuper;
00118 KToggleAction *m_textSub;
00119
00120
00121
00122
00123 KAction *m_textColor;
00124 KFontAction *m_textFont;
00125 KFontSizeAction *m_textSize;
00126 KAction* undo;
00127 KAction* redo;
00128 bool m_autoIndentMode;
00129 KNote *m_note;
00130 };
00131
00132 #endif
|