00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __KATE_FILESELECTOR_H__
00022 #define __KATE_FILESELECTOR_H__
00023
00024 #include "katemain.h"
00025 #include "katedocmanager.h"
00026 #include <kate/document.h>
00027
00028 #include <tqvbox.h>
00029 #include <tdefile.h>
00030 #include <kurl.h>
00031 #include <tdetoolbar.h>
00032 #include <tqframe.h>
00033
00034 class KateMainWindow;
00035 class KateViewManager;
00036 class TDEActionCollection;
00037 class TDEActionSelector;
00038 class KFileView;
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 class KateFileSelectorToolBar: public TDEToolBar
00050 {
00051 Q_OBJECT
00052 public:
00053 KateFileSelectorToolBar(TQWidget *parent);
00054 virtual ~KateFileSelectorToolBar();
00055
00056 virtual void setMovingEnabled( bool b );
00057 };
00058
00059 class KateFileSelectorToolBarParent: public TQFrame
00060 {
00061 Q_OBJECT
00062 public:
00063 KateFileSelectorToolBarParent(TQWidget *parent);
00064 ~KateFileSelectorToolBarParent();
00065 void setToolBar(KateFileSelectorToolBar *tb);
00066 private:
00067 KateFileSelectorToolBar *m_tb;
00068 protected:
00069 virtual void resizeEvent ( TQResizeEvent * );
00070 };
00071
00072 class KateFileSelector : public TQVBox
00073 {
00074 Q_OBJECT
00075
00076 friend class KFSConfigPage;
00077
00078 public:
00079
00080 enum AutoSyncEvent { DocumentChanged=1, GotVisible=2 };
00081
00082 KateFileSelector( KateMainWindow *mainWindow=0, KateViewManager *viewManager=0,
00083 TQWidget * parent = 0, const char * name = 0 );
00084 ~KateFileSelector();
00085
00086 void readConfig( TDEConfig *, const TQString & );
00087 void writeConfig( TDEConfig *, const TQString & );
00088 void setupToolbar( TDEConfig * );
00089 void setView( KFile::FileView );
00090 KDirOperator *dirOperator(){ return dir; }
00091 TDEActionCollection *actionCollection() { return mActionCollection; };
00092
00093 public slots:
00094 void slotFilterChange(const TQString&);
00095 void setDir(KURL);
00096 void setDir( const TQString& url ) { setDir( KURL( url ) ); };
00097 void kateViewChanged();
00098 void selectorViewChanged( KFileView * );
00099
00100 private slots:
00101 void cmbPathActivated( const KURL& u );
00102 void cmbPathReturnPressed( const TQString& u );
00103 void dirUrlEntered( const KURL& u );
00104 void dirFinishedLoading();
00105 void setActiveDocumentDir();
00106 void btnFilterClick();
00107
00108 protected:
00109 void focusInEvent( TQFocusEvent * );
00110 void showEvent( TQShowEvent * );
00111 bool eventFilter( TQObject *, TQEvent * );
00112 void initialDirChangeHack();
00113
00114 private:
00115 class KateFileSelectorToolBar *toolbar;
00116 TDEActionCollection *mActionCollection;
00117 class KBookmarkHandler *bookmarkHandler;
00118 KURLComboBox *cmbPath;
00119 KDirOperator * dir;
00120 class TDEAction *acSyncDir;
00121 KHistoryCombo * filter;
00122 class TQToolButton *btnFilter;
00123
00124 KateMainWindow *mainwin;
00125 KateViewManager *viewmanager;
00126
00127 TQString lastFilter;
00128 int autoSyncEvents;
00129 TQString waitingUrl;
00130 TQString waitingDir;
00131 };
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146 class KFSConfigPage : public Kate::ConfigPage {
00147 Q_OBJECT
00148 public:
00149 KFSConfigPage( TQWidget* parent=0, const char *name=0, KateFileSelector *kfs=0);
00150 virtual ~KFSConfigPage() {};
00151
00152 virtual void apply();
00153 virtual void reload();
00154
00155 private slots:
00156 void slotMyChanged();
00157
00158 private:
00159 void init();
00160
00161 KateFileSelector *fileSelector;
00162 TDEActionSelector *acSel;
00163 class TQSpinBox *sbPathHistLength, *sbFilterHistLength;
00164 class TQCheckBox *cbSyncActive, *cbSyncShow;
00165 class TQCheckBox *cbSesLocation, *cbSesFilter;
00166
00167 bool m_changed;
00168 };
00169
00170
00171 #endif //__KATE_FILESELECTOR_H__
00172