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 <kdialogbase.h>
31 namespace KTextEditor {
class EditorChooser; }
36 class KRecentFilesAction;
38 class KWrite :
public KParts::MainWindow
44 KWrite(KTextEditor::Document * = 0L);
47 void loadURL(
const KURL &url);
49 KTextEditor::View *view()
const {
return m_view; }
51 static bool noWindows () {
return winList.isEmpty(); }
55 void setupStatusBar();
59 void dragEnterEvent( TQDragEnterEvent * );
60 void dropEvent( TQDropEvent * );
66 void slotOpen(
const KURL& url);
68 void toggleStatusBar();
74 void slotNewToolbarConfig();
80 void newStatus(
const TQString &msg);
83 void slotDropEvent(TQDropEvent *);
85 void slotEnableActions(
bool enable );
90 void slotFileNameChanged();
94 void readConfig (KConfig *);
95 void writeConfig (KConfig *);
102 void restore(KConfig *,
int);
103 static void restore();
106 void readProperties(KConfig *);
107 void saveProperties(KConfig *);
108 void saveGlobalProperties(KConfig *);
111 KTextEditor::View * m_view;
113 KRecentFilesAction * m_recentFiles;
114 KToggleAction * m_paShowPath;
115 KToggleAction * m_paShowStatusBar;
119 static TQPtrList<KTextEditor::Document> docList;
120 static TQPtrList<KWrite> winList;
123 class KWriteEditorChooser:
public KDialogBase
129 KWriteEditorChooser(TQWidget *parent);
130 virtual ~KWriteEditorChooser();
133 KTextEditor::EditorChooser *m_chooser;