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 TQTextEdit; 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 TQ_OBJECT 00038 public: 00039 DefaultEditor( TQObject *parent, const char *name, const TQStringList &args ); 00040 ~DefaultEditor(); 00041 00042 virtual TQWidget *widget(); 00043 virtual TQString text() const; 00044 public slots: 00045 virtual void setText( const TQString &txt ); 00046 virtual void changeSignature( const TQString &txt ); 00047 00051 bool open(); 00052 00056 bool saveAs(); 00057 00061 bool print(); 00062 00066 void formatColor(); 00067 00068 void checkSpelling(); 00069 00073 void setAlignLeft( bool yes ); 00074 00078 void setAlignRight( bool yes ); 00079 00083 void setAlignCenter( bool yes ); 00084 00088 void setAlignJustify( bool yes ); 00089 00090 protected slots: 00094 void createActions( KActionCollection *ac ); 00095 00096 void updateActions(); 00097 00098 void updateFont(); 00099 void updateCharFmt(); 00100 void updateAligment(); 00101 00102 private: 00103 TQTextEdit *m_textEdit; 00104 00105 KToggleAction *m_actionBold; 00106 KToggleAction *m_actionItalic; 00107 KToggleAction *m_actionUnderline; 00108 00109 KFontAction *m_actionFont; 00110 KFontSizeAction *m_actionFontSize; 00111 00112 KToggleAction *m_actionAlignLeft; 00113 KToggleAction *m_actionAlignRight; 00114 KToggleAction *m_actionAlignCenter; 00115 KToggleAction *m_actionAlignJustify; 00116 }; 00117 00118 #endif