Add (and install) svg for the new krunner interface.
[kdebase/uwolfer.git] / apps / kwrite / kwritemain.h
blob21600c6f27dab644e6e8e987fa56c54d55b854a1
1 /* This file is part of the KDE project
2 Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
3 Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
4 Copyright (C) 2001 Anders Lund <anders.lund@lund.tdcadsl.dk>
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #ifndef KWRITE_MAIN_H
22 #define KWRITE_MAIN_H
24 #include <ktexteditor/view.h>
25 #include <ktexteditor/document.h>
27 #include <kparts/mainwindow.h>
29 #include <kdialog.h>
31 #include <QtGui/QKeyEvent>
33 class QLabel;
35 namespace KTextEditor { class EditorChooser; }
37 class KToggleAction;
38 class KRecentFilesAction;
39 class KSqueezedTextLabel;
41 class KWrite : public KParts::MainWindow
43 Q_OBJECT
45 public:
46 KWrite(KTextEditor::Document * = 0L);
47 ~KWrite();
49 void loadURL(const KUrl &url);
51 KTextEditor::View *view() const { return m_view; }
53 static bool noWindows () { return winList.isEmpty(); }
55 private:
56 void setupActions();
57 void setupStatusBar();
59 bool queryClose();
61 void dragEnterEvent( QDragEnterEvent * );
62 void dropEvent( QDropEvent * );
64 public Q_SLOTS:
65 void slotNew();
66 void slotFlush ();
67 void slotOpen();
68 void slotOpen( const KUrl& url);
69 void newView();
70 void toggleStatusBar();
71 void editKeys();
72 void editToolbars();
73 void changeEditor();
74 void aboutEditor();
76 private Q_SLOTS:
77 void slotNewToolbarConfig();
79 public Q_SLOTS:
80 void slotDropEvent(QDropEvent *);
82 void slotEnableActions( bool enable );
84 /**
85 * adds a changed URL to the recent files
87 void urlChanged();
89 //config file functions
90 public:
91 void readConfig (KSharedConfigPtr);
92 void writeConfig (KSharedConfigPtr);
94 void readConfig ();
95 void writeConfig ();
97 //session management
98 public:
99 void restore(KConfig *,int);
100 static void restore();
102 private:
103 void readProperties(KSharedConfigPtr);
104 void saveProperties(KSharedConfigPtr);
105 void saveGlobalProperties(KConfig *);
107 private:
108 KTextEditor::View * m_view;
110 KRecentFilesAction * m_recentFiles;
111 KToggleAction * m_paShowPath;
112 KToggleAction * m_paShowStatusBar;
114 QString encoding;
116 static QList<KTextEditor::Document*> docList;
117 static QList<KWrite*> winList;
120 * Stuff for the status bar
122 public Q_SLOTS:
123 void updateStatus ();
125 void viewModeChanged ( KTextEditor::View *view );
127 void modeChanged ( KTextEditor::Document *document );
129 void cursorPositionChanged ( KTextEditor::View *view );
131 void selectionChanged (KTextEditor::View *view);
133 void modifiedChanged();
135 void documentNameChanged ();
137 void informationMessage (KTextEditor::View *view, const QString &message);
139 private:
140 QLabel* m_lineColLabel;
141 QLabel* m_modifiedLabel;
142 QLabel* m_insertModeLabel;
143 QLabel* m_selectModeLabel;
144 QLabel* m_modeLabel;
145 KSqueezedTextLabel* m_fileNameLabel;
146 QPixmap m_modPm, m_modDiscPm, m_modmodPm, m_noPm;
149 class KWriteEditorChooser: public KDialog
151 Q_OBJECT
153 public:
154 KWriteEditorChooser(QWidget *parent);
155 virtual ~KWriteEditorChooser();
157 private:
158 KTextEditor::EditorChooser *m_chooser;
160 protected Q_SLOTS:
161 void slotOk();
164 #endif
165 // kate: space-indent on; indent-width 2; replace-tabs on; mixed-indent off;