• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

knotes

knoteedit.h

Go to the documentation of this file.
00001 /*******************************************************************
00002  KNotes -- Notes for the KDE project
00003 
00004  Copyright (c) 1997-2005, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 *******************************************************************/
00020 
00021 #ifndef KNOTEEDIT_H
00022 #define KNOTEEDIT_H
00023 
00024 #include <QDragEnterEvent>
00025 #include <QDropEvent>
00026 #include <QTextCharFormat>
00027 #include <QWidget>
00028 
00029 #include <ktextedit.h>
00030 
00031 class QColor;
00032 class QFont;
00033 
00034 class KAction;
00035 class KActionCollection;
00036 class KFontAction;
00037 class KFontSizeAction;
00038 class KMenu;
00039 class KToggleAction;
00040 
00041 
00042 class KNoteEdit
00043   : public KTextEdit
00044 {
00045   Q_OBJECT
00046   public:
00047     KNoteEdit( KActionCollection *actions, QWidget *parent = 0 );
00048     ~KNoteEdit();
00049     
00050     void setText( const QString &text );
00051     QString text() const;
00052     
00053     void setTextFont( const QFont &font );
00054     void setTextColor( const QColor &color );
00055     void setTabStop( int tabs );
00056     void setAutoIndentMode( bool newmode );
00057     
00058     void setContextMenu( KMenu *menu )
00059     {
00060         m_editMenu = menu;
00061     }
00062     
00063   public slots:
00064     void setRichText( bool );
00065     
00066     void textBold( bool );
00067     void textStrikeOut( bool );
00068     
00069     void slotTextColor();
00070     
00071     void textAlignLeft();
00072     void textAlignCenter();
00073     void textAlignRight();
00074     void textAlignBlock();
00075     
00076     void textList();
00077     
00078     void textSuperScript();
00079     void textSubScript();
00080     
00081     void textIncreaseIndent();
00082     void textDecreaseIndent();
00083     
00084   protected:
00085     virtual void contextMenuEvent( QContextMenuEvent * );
00086     virtual void dragEnterEvent( QDragEnterEvent * );
00087     virtual void dropEvent( QDropEvent * );
00088     virtual void keyPressEvent( QKeyEvent * );
00089     virtual void focusInEvent( QFocusEvent * );
00090     virtual void focusOutEvent( QFocusEvent * );
00091     
00092   private slots:
00093     void slotCurrentCharFormatChanged( const QTextCharFormat & );
00094     
00095   private:
00096     void autoIndent();
00097     
00098     void setTextFormat( const QTextCharFormat & );
00099     
00100     void enableRichTextActions();
00101     void disableRichTextActions();
00102     
00103   private:
00104     KAction *m_cut;
00105     KAction *m_copy;
00106     KAction *m_paste;
00107     
00108     KMenu   *m_editMenu;
00109     
00110     KToggleAction *m_textBold;
00111     KToggleAction *m_textItalic;
00112     KToggleAction *m_textUnderline;
00113     KToggleAction *m_textStrikeOut;
00114     
00115     KToggleAction *m_textAlignLeft;
00116     KToggleAction *m_textAlignCenter;
00117     KToggleAction *m_textAlignRight;
00118     KToggleAction *m_textAlignBlock;
00119     
00120     KToggleAction *m_textList;
00121     KToggleAction *m_textSuper;
00122     KToggleAction *m_textSub;
00123     
00124     KAction       *m_textIncreaseIndent;
00125     KAction       *m_textDecreaseIndent;
00126     
00127     KAction         *m_textColor;
00128     KFontAction     *m_textFont;
00129     KFontSizeAction *m_textSize;
00130     
00131     bool m_autoIndentMode;
00132 };
00133 
00134 #endif

knotes

Skip menu "knotes"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal