defaulteditor.h
1 /*
2  * defaulteditor.h
3  *
4  * Copyright (C) 2004 Zack Rusin <zack@kde.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301 USA
20  */
21 
22 #ifndef DEFAULTEDITOR_H
23 #define DEFAULTEDITOR_H
24 
25 #include "editor.h"
26 
27 class TQTextEdit;
28 class TDEFontAction;
29 class TDEFontSizeAction;
30 class TDEToggleAction;
31 class TDEActionCollection;
32 
33 
34 class DefaultEditor : public Komposer::Editor
35 {
36  TQ_OBJECT
37 
38 public:
39  DefaultEditor( TQObject *parent, const char *name, const TQStringList &args );
40  ~DefaultEditor();
41 
42  virtual TQWidget *widget();
43  virtual TQString text() const;
44 public slots:
45  virtual void setText( const TQString &txt );
46  virtual void changeSignature( const TQString &txt );
47 
51  bool open();
52 
56  bool saveAs();
57 
61  bool print();
62 
66  void formatColor();
67 
68  void checkSpelling();
69 
73  void setAlignLeft( bool yes );
74 
78  void setAlignRight( bool yes );
79 
83  void setAlignCenter( bool yes );
84 
88  void setAlignJustify( bool yes );
89 
90 protected slots:
94  void createActions( TDEActionCollection *ac );
95 
96  void updateActions();
97 
98  void updateFont();
99  void updateCharFmt();
100  void updateAligment();
101 
102 private:
103  TQTextEdit *m_textEdit;
104 
105  TDEToggleAction *m_actionBold;
106  TDEToggleAction *m_actionItalic;
107  TDEToggleAction *m_actionUnderline;
108 
109  TDEFontAction *m_actionFont;
110  TDEFontSizeAction *m_actionFontSize;
111 
112  TDEToggleAction *m_actionAlignLeft;
113  TDEToggleAction *m_actionAlignRight;
114  TDEToggleAction *m_actionAlignCenter;
115  TDEToggleAction *m_actionAlignJustify;
116 };
117 
118 #endif