kwritemain.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __KWRITE_MAIN_H__
00022 #define __KWRITE_MAIN_H__
00023
00024 #include <ktexteditor/view.h>
00025 #include <ktexteditor/document.h>
00026
00027 #include <kparts/mainwindow.h>
00028
00029 #include <kdialogbase.h>
00030
00031 namespace KTextEditor { class EditorChooser; }
00032
00033 class KAction;
00034 class KToggleAction;
00035 class KSelectAction;
00036 class KRecentFilesAction;
00037
00038 class KWrite : public KParts::MainWindow
00039 {
00040 Q_OBJECT
00041
00042 public:
00043 KWrite(KTextEditor::Document * = 0L);
00044 ~KWrite();
00045
00046 void loadURL(const KURL &url);
00047
00048 KTextEditor::View *view() const { return m_view; }
00049
00050 static bool noWindows () { return winList.isEmpty(); }
00051
00052 private:
00053 void setupActions();
00054 void setupStatusBar();
00055
00056 bool queryClose();
00057
00058 void dragEnterEvent( QDragEnterEvent * );
00059 void dropEvent( QDropEvent * );
00060
00061 public slots:
00062 void slotNew();
00063 void slotFlush ();
00064 void slotOpen();
00065 void slotOpen( const KURL& url);
00066 void newView();
00067 void toggleStatusBar();
00068 void editKeys();
00069 void editToolbars();
00070 void changeEditor();
00071
00072 public slots:
00073 void printNow();
00074 void printDlg();
00075
00076 void newStatus(const QString &msg);
00077 void newCaption();
00078
00079 void slotDropEvent(QDropEvent *);
00080
00081 void slotEnableActions( bool enable );
00085 void slotFileNameChanged();
00086
00087
00088
00089
00090 public:
00091 void readConfig (KConfig *);
00092 void writeConfig (KConfig *);
00093
00094 void readConfig ();
00095 void writeConfig ();
00096
00097
00098 public:
00099 void restore(KConfig *,int);
00100 static void restore();
00101
00102 private:
00103 void readProperties(KConfig *);
00104 void saveProperties(KConfig *);
00105 void saveGlobalProperties(KConfig *);
00106
00107 private:
00108 KTextEditor::View * m_view;
00109
00110 KRecentFilesAction * m_recentFiles;
00111 KToggleAction * m_paShowPath;
00112 KToggleAction * m_paShowStatusBar;
00113
00114 QString encoding;
00115
00116 static QPtrList<KTextEditor::Document> docList;
00117 static QPtrList<KWrite> winList;
00118 };
00119
00120 class KWriteEditorChooser: public KDialogBase
00121 {
00122 Q_OBJECT
00123
00124 public:
00125 KWriteEditorChooser(QWidget *parent);
00126 virtual ~KWriteEditorChooser();
00127
00128 private:
00129 KTextEditor::EditorChooser *m_chooser;
00130
00131 protected slots:
00132 void slotOk();
00133 };
00134
00135 #endif
This file is part of the documentation for kate Library Version 3.3.90.