knotes Library API Documentation

knoteedit.h

00001 /*******************************************************************
00002  KNotes -- Notes for the KDE project
00003 
00004  Copyright (c) 1997-2004, The KNotes Developers
00005 
00006  This program is free software; you can redistribute it and/or
00007  modify it under the terms of the GNU General Public License
00008  as published by the Free Software Foundation; either version 2
00009  of the License, or (at your option) any later version.
00010 
00011  This program is distributed in the hope that it will be useful,
00012  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  GNU General Public License for more details.
00015 
00016  You should have received a copy of the GNU General Public License
00017  along with this program; if not, write to the Free Software
00018  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
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     //void textIncreaseIndent();
00068     //void textDecreaseIndent();
00069 
00070 protected:
00071     virtual void contentsDragEnterEvent( QDragEnterEvent *e );
00072     virtual void contentsDragMoveEvent( QDragMoveEvent *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     //KAction       *m_textIncreaseIndent;
00112     //KAction       *m_textDecreaseIndent;
00113 
00114     KAction         *m_textColor;
00115     KFontAction     *m_textFont;
00116     KFontSizeAction *m_textSize;
00117 
00118     bool m_autoIndentMode;
00119 };
00120 
00121 #endif
KDE Logo
This file is part of the documentation for knotes Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:55 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003