1 /*******************************************************************
2 KNotes -- Notes for the KDE project
4 Copyright (c) 1997-2005, The KNotes Developers
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 *******************************************************************/
24 #include <QDragEnterEvent>
26 #include <QTextCharFormat>
29 #include <ktextedit.h>
34 class KActionCollection
;
36 class KFontSizeAction
;
45 KNoteEdit( KActionCollection
*actions
, QWidget
*parent
= 0 );
48 void setNote( KNote
*_note
) {
51 void setText( const QString
&text
);
54 void setTextFont( const QFont
&font
);
55 void setTabStop( int tabs
);
56 void setAutoIndentMode( bool newmode
);
59 void setRichText( bool );
61 void textBold( bool );
62 void textStrikeOut( bool );
67 void textAlignCenter();
68 void textAlignRight();
69 void textAlignBlock();
73 void textSuperScript();
76 void textIncreaseIndent();
77 void textDecreaseIndent();
78 void setTextFontSize( int );
80 void slotTextBackgroundColor();
83 virtual void dragEnterEvent( QDragEnterEvent
* );
84 virtual void dropEvent( QDropEvent
* );
85 virtual void keyPressEvent( QKeyEvent
* );
86 virtual void focusInEvent( QFocusEvent
* );
87 virtual void focusOutEvent( QFocusEvent
* );
90 void slotCurrentCharFormatChanged( const QTextCharFormat
& );
91 void slotCursorPositionChanged();
95 void setTextFormat( const QTextCharFormat
& );
97 void enableRichTextActions();
98 void disableRichTextActions();
102 KToggleAction
*m_textBold
;
103 KToggleAction
*m_textItalic
;
104 KToggleAction
*m_textUnderline
;
105 KToggleAction
*m_textStrikeOut
;
107 KToggleAction
*m_textAlignLeft
;
108 KToggleAction
*m_textAlignCenter
;
109 KToggleAction
*m_textAlignRight
;
110 KToggleAction
*m_textAlignBlock
;
112 KToggleAction
*m_textList
;
113 KToggleAction
*m_textSuper
;
114 KToggleAction
*m_textSub
;
116 KAction
*m_textIncreaseIndent
;
117 KAction
*m_textDecreaseIndent
;
119 KAction
*m_textColor
;
120 KFontAction
*m_textFont
;
121 KFontSizeAction
*m_textSize
;
123 bool m_autoIndentMode
;