kate
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 <tdetexteditor/view.h>
00025 #include <tdetexteditor/document.h>
00026
00027 #include <tdeparts/mainwindow.h>
00028
00029 #include <kdialogbase.h>
00030
00031 namespace KTextEditor { class EditorChooser; }
00032
00033 class TDEAction;
00034 class TDEToggleAction;
00035 class TDESelectAction;
00036 class TDERecentFilesAction;
00037
00038 class KWrite : public KParts::MainWindow
00039 {
00040 Q_OBJECT
00041
00042
00043 public:
00044 KWrite(KTextEditor::Document * = 0L);
00045 ~KWrite();
00046
00047 void loadURL(const KURL &url);
00048
00049 KTextEditor::View *view() const { return m_view; }
00050
00051 static bool noWindows () { return winList.isEmpty(); }
00052
00053 private:
00054 void setupActions();
00055 void setupStatusBar();
00056
00057 bool queryClose();
00058
00059 void dragEnterEvent( TQDragEnterEvent * );
00060 void dropEvent( TQDropEvent * );
00061
00062 public slots:
00063 void slotNew();
00064 void slotFlush ();
00065 void slotOpen();
00066 void slotOpen( const KURL& url);
00067 void newView();
00068 void toggleStatusBar();
00069 void editKeys();
00070 void editToolbars();
00071 void changeEditor();
00072
00073 private slots:
00074 void slotNewToolbarConfig();
00075
00076 public slots:
00077 void printNow();
00078 void printDlg();
00079
00080 void newStatus(const TQString &msg);
00081 void newCaption();
00082
00083 void slotDropEvent(TQDropEvent *);
00084
00085 void slotEnableActions( bool enable );
00086
00090 void slotFileNameChanged();
00091
00092
00093 public:
00094 void readConfig (TDEConfig *);
00095 void writeConfig (TDEConfig *);
00096
00097 void readConfig ();
00098 void writeConfig ();
00099
00100
00101 public:
00102 void restore(TDEConfig *,int);
00103 static void restore();
00104
00105 private:
00106 void readProperties(TDEConfig *);
00107 void saveProperties(TDEConfig *);
00108 void saveGlobalProperties(TDEConfig *);
00109
00110 private:
00111 KTextEditor::View * m_view;
00112
00113 TDERecentFilesAction * m_recentFiles;
00114 TDEToggleAction * m_paShowPath;
00115 TDEToggleAction * m_paShowStatusBar;
00116
00117 TQString encoding;
00118
00119 static TQPtrList<KTextEditor::Document> docList;
00120 static TQPtrList<KWrite> winList;
00121 };
00122
00123 class KWriteEditorChooser: public KDialogBase
00124 {
00125 Q_OBJECT
00126
00127
00128 public:
00129 KWriteEditorChooser(TQWidget *parent);
00130 virtual ~KWriteEditorChooser();
00131
00132 private:
00133 KTextEditor::EditorChooser *m_chooser;
00134
00135 protected slots:
00136 void slotOk();
00137 };
00138
00139 #endif
00140