libkdepim

defaulteditor.h

00001 /*
00002  * defaulteditor.h
00003  *
00004  * Copyright (C)  2004  Zack Rusin <zack@kde.org>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library 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 GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019  * 02110-1301  USA
00020  */
00021 
00022 #ifndef DEFAULTEDITOR_H
00023 #define DEFAULTEDITOR_H
00024 
00025 #include "editor.h"
00026 
00027 class QTextEdit;
00028 class KFontAction;
00029 class KFontSizeAction;
00030 class KToggleAction;
00031 class KActionCollection;
00032 
00033 
00034 class DefaultEditor : public Komposer::Editor
00035 {
00036   Q_OBJECT
00037 public:
00038   DefaultEditor( QObject *parent, const char *name, const QStringList &args );
00039   ~DefaultEditor();
00040 
00041   virtual QWidget *widget();
00042   virtual QString  text() const;
00043 public slots:
00044   virtual void setText( const QString &txt );
00045   virtual void changeSignature( const QString &txt );
00046 
00050   bool open();
00051 
00055   bool saveAs();
00056 
00060   bool print();
00061 
00065   void formatColor();
00066 
00067   void checkSpelling();
00068 
00072   void setAlignLeft( bool yes );
00073 
00077   void setAlignRight( bool yes );
00078 
00082   void setAlignCenter( bool yes );
00083 
00087   void setAlignJustify( bool yes );
00088 
00089 protected slots:
00093   void createActions( KActionCollection *ac );
00094 
00095   void updateActions();
00096 
00097   void updateFont();
00098   void updateCharFmt();
00099   void updateAligment();
00100 
00101 private:
00102   QTextEdit *m_textEdit;
00103 
00104   KToggleAction *m_actionBold;
00105   KToggleAction *m_actionItalic;
00106   KToggleAction *m_actionUnderline;
00107 
00108   KFontAction *m_actionFont;
00109   KFontSizeAction *m_actionFontSize;
00110 
00111   KToggleAction *m_actionAlignLeft;
00112   KToggleAction *m_actionAlignRight;
00113   KToggleAction *m_actionAlignCenter;
00114   KToggleAction *m_actionAlignJustify;
00115 };
00116 
00117 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys