knotes Library API Documentation

knoteedit.h

00001 /*******************************************************************
00002  KNotes -- Notes for the KDE project
00003 
00004  Copyright (c) 1997-2002, 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., 675 Mass Ave, Cambridge, MA 02139, 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 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 //    void textStyleSelected( int );
00053 //    void textSizeSelected( int );
00054 //    void textFontSelected( const QString & );
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
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:46:58 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001