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 <qwidget.h>
00029
#include <kfile.h>
00030
#include <kurl.h>
00031
#include <ktoolbar.h>
00032
#include <qframe.h>
00033
00034
class KateMainWindow;
00035
class KateViewManager;
00036
class KActionCollection;
00037
class KActionSelector;
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
class KateFileSelectorToolBar:
public KToolBar
00049 {
00050 Q_OBJECT
00051
public:
00052 KateFileSelectorToolBar(QWidget *parent);
00053
virtual ~KateFileSelectorToolBar();
00054
00055
virtual void setMovingEnabled(
bool b );
00056 };
00057
00058
class KateFileSelectorToolBarParent:
public QFrame
00059 {
00060 Q_OBJECT
00061
public:
00062 KateFileSelectorToolBarParent(QWidget *parent);
00063 ~KateFileSelectorToolBarParent();
00064
void setToolBar(KateFileSelectorToolBar *tb);
00065
private:
00066 KateFileSelectorToolBar *m_tb;
00067
protected:
00068
virtual void resizeEvent ( QResizeEvent * );
00069 };
00070
00071
class KateFileSelector :
public QWidget
00072 {
00073 Q_OBJECT
00074
00075
friend class KFSConfigPage;
00076
00077
public:
00078
00079
enum AutoSyncEvent { DocumentChanged=1, GotVisible=2 };
00080
00081 KateFileSelector( KateMainWindow *mainWindow=0, KateViewManager *viewManager=0,
00082 QWidget * parent = 0,
const char * name = 0 );
00083 ~KateFileSelector();
00084
00085
void readConfig( KConfig *,
const QString & );
00086
void writeConfig( KConfig *,
const QString & );
00087
void setupToolbar( KConfig * );
00088
void setView( KFile::FileView );
00089 KDirOperator *dirOperator(){
return dir; }
00090 KActionCollection *actionCollection() {
return mActionCollection; };
00091
00092
public slots:
00093
void slotFilterChange(
const QString&);
00094
void setDir(KURL);
00095
void setDir(
const QString& url ) { setDir( KURL( url ) ); };
00096
void kateViewChanged();
00097
00098
private slots:
00099
void cmbPathActivated(
const KURL& u );
00100
void cmbPathReturnPressed(
const QString& u );
00101
void dirUrlEntered(
const KURL& u );
00102
void dirFinishedLoading();
00103
void setActiveDocumentDir();
00104
void btnFilterClick();
00105
00106
protected:
00107
void focusInEvent( QFocusEvent * );
00108
void showEvent( QShowEvent * );
00109
bool eventFilter( QObject *, QEvent * );
00110
void initialDirChangeHack();
00111
00112
private:
00113
class KateFileSelectorToolBar *toolbar;
00114 KActionCollection *mActionCollection;
00115
class KBookmarkHandler *bookmarkHandler;
00116 KURLComboBox *cmbPath;
00117 KDirOperator * dir;
00118
class KAction *acSyncDir;
00119 KHistoryCombo * filter;
00120
class QToolButton *btnFilter;
00121
00122 KateMainWindow *mainwin;
00123 KateViewManager *viewmanager;
00124
00125 QString lastFilter;
00126
int autoSyncEvents;
00127 QString waitingUrl;
00128 QString waitingDir;
00129 };
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
class KFSConfigPage :
public Kate::ConfigPage {
00145 Q_OBJECT
00146
public:
00147 KFSConfigPage( QWidget* parent=0,
const char *name=0, KateFileSelector *kfs=0);
00148
virtual ~KFSConfigPage() {};
00149
00150
virtual void apply();
00151
virtual void reload();
00152
00153
private:
00154
void init();
00155
00156 KateFileSelector *fileSelector;
00157
bool bDirty;
00158
00159
KActionSelector *acSel;
00160
class QSpinBox *sbPathHistLength, *sbFilterHistLength;
00161
class QCheckBox *cbSyncActive, *cbSyncShow;
00162
class QCheckBox *cbSesLocation, *cbSesFilter;
00163 };
00164
00165
00166
#endif //__KATE_FILESELECTOR_H__