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.
24
#include <ktexteditor/view.h>
25
#include <ktexteditor/document.h>
27
#include <kparts/mainwindow.h>
31
#include <QtGui/QKeyEvent>
37
namespace KTextEditor { class EditorChooser; }
39
#ifdef KActivities_FOUND
40
namespace KActivities { class ResourceInstance; }
44
class KRecentFilesAction;
45
class KSqueezedTextLabel;
47
class KWrite : public KParts::MainWindow
52
KWrite(KTextEditor::Document * = 0L);
55
void loadURL(const KUrl &url);
57
KTextEditor::View *view() const { return m_view; }
59
static bool noWindows () { return winList.isEmpty(); }
63
void setupStatusBar();
65
void addMenuBarActionToContextMenu();
66
void removeMenuBarActionFromContextMenu();
70
void dragEnterEvent( QDragEnterEvent * );
71
void dropEvent( QDropEvent * );
77
void slotOpen( const KUrl& url);
79
void toggleStatusBar();
80
void toggleMenuBar(bool silentMode = false);
86
void slotNewToolbarConfig();
89
void slotDropEvent(QDropEvent *);
91
void slotEnableActions( bool enable );
94
* adds a changed URL to the recent files
98
//config file functions
100
void readConfig (KSharedConfigPtr);
101
void writeConfig (KSharedConfigPtr);
108
void restore(KConfig *,int);
109
static void restore();
112
void readProperties(KSharedConfigPtr);
113
void saveProperties(KSharedConfigPtr);
114
void saveGlobalProperties(KConfig *);
117
KTextEditor::View * m_view;
119
KRecentFilesAction * m_recentFiles;
120
KToggleAction * m_paShowPath;
121
KToggleAction * m_paShowStatusBar;
122
KToggleAction *m_paShowMenuBar;
124
#ifdef KActivities_FOUND
125
KActivities::ResourceInstance * m_activityResource;
130
static QList<KTextEditor::Document*> docList;
131
static QList<KWrite*> winList;
134
* Stuff for the status bar
137
void updateStatus ();
139
void viewModeChanged ( KTextEditor::View *view );
141
void modeChanged ( KTextEditor::Document *document );
143
void cursorPositionChanged ( KTextEditor::View *view );
145
void selectionChanged (KTextEditor::View *view);
147
void modifiedChanged();
149
void documentNameChanged ();
151
void informationMessage (KTextEditor::View *view, const QString &message);
154
QLabel* m_lineColLabel;
155
QLabel* m_modifiedLabel;
156
QLabel* m_insertModeLabel;
157
QLabel* m_selectModeLabel;
159
KSqueezedTextLabel* m_fileNameLabel;
160
QPixmap m_modPm; //, m_modDiscPm, m_modmodPm;
165
// kate: space-indent on; indent-width 2; replace-tabs on; mixed-indent off;