parts/fileselector/fileselector_widget.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#ifndef FILESELECTOR_WIDGET_H
00023
#define FILESELECTOR_WIDGET_H
00024
00025
#include <qwidget.h>
00026
#include <kfile.h>
00027
#include <kurl.h>
00028
#include <ktoolbar.h>
00029
#include <qframe.h>
00030
#include <kdiroperator.h>
00031
00032
class KDevMainWindow;
00033
class KDevPartController;
00034
class FileSelectorPart;
00035
class KActionCollection;
00036
class KActionSelector;
00037
class KDirOperator;
00038
class KURLComboBox;
00039
class KHistoryCombo;
00040
00041
namespace KParts
00042 {
00043
class Part;
00044 }
00045
00046
namespace KTextEditor
00047 {
00048
class Document;
00049 }
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 class KDevFileSelectorToolBar:
public KToolBar
00061 {
00062 Q_OBJECT
00063
public:
00064
KDevFileSelectorToolBar(
QWidget *parent);
00065
virtual ~KDevFileSelectorToolBar();
00066
00067
virtual void setMovingEnabled(
bool b );
00068 };
00069
00070 class KDevFileSelectorToolBarParent:
public QFrame
00071 {
00072 Q_OBJECT
00073
public:
00074
KDevFileSelectorToolBarParent(
QWidget *parent);
00075
~KDevFileSelectorToolBarParent();
00076
void setToolBar(
KDevFileSelectorToolBar *tb);
00077
00078
private:
00079 KDevFileSelectorToolBar *
m_tb;
00080
00081
protected:
00082
virtual void resizeEvent (
QResizeEvent * );
00083 };
00084
00085 class KDevDirOperator:
public KDirOperator
00086 {
00087 Q_OBJECT
00088
public:
00089 KDevDirOperator(
FileSelectorPart *part,
const KURL &urlName=
KURL(),
QWidget *parent=0,
const char *name=0)
00090 :
KDirOperator(urlName, parent, name),
m_part(part)
00091 {
00092 }
00093
00094
protected slots:
00095
virtual void activatedMenu (
const KFileItem *fi,
const QPoint &pos);
00096
00097
private:
00098 FileSelectorPart *
m_part;
00099 };
00100
00101 class KDevFileSelector :
public QWidget
00102 {
00103 Q_OBJECT
00104
00105
friend class KFSConfigPage;
00106
00107
public:
00108
00109 enum AutoSyncEvent {
DocumentChanged=1,
DocumentOpened=2,
GotVisible=4 };
00110
00111
KDevFileSelector(
FileSelectorPart *part,
KDevMainWindow *mainWindow=0,
KDevPartController *partController=0,
00112
QWidget * parent = 0,
const char * name = 0 );
00113
~KDevFileSelector();
00114
00115
void readConfig(
KConfig *,
const QString & );
00116
void writeConfig(
KConfig *,
const QString & );
00117
void setupToolbar(
KConfig * );
00118
void setView( KFile::FileView );
00119 KDevDirOperator *
dirOperator(){
return dir; }
00120 KActionCollection *
actionCollection() {
return mActionCollection; };
00121
00122
public slots:
00123
void slotFilterChange(
const QString&);
00124
void setDir(
KURL);
00125 void setDir(
const QString& url ) { setDir(
KURL( url ) ); };
00126
00127
private slots:
00128
void cmbPathActivated(
const KURL& u );
00129
void cmbPathReturnPressed(
const QString& u );
00130
void dirUrlEntered(
const KURL& u );
00131
void dirFinishedLoading();
00132
void setActiveDocumentDir();
00133
void viewChanged();
00134
void btnFilterClick();
00135
void autoSync();
00136
void autoSync(
KParts::Part * );
00137
void initialDirChangeHack();
00138
00139
protected:
00140
void focusInEvent(
QFocusEvent * );
00141
void showEvent(
QShowEvent * );
00142
bool eventFilter(
QObject *,
QEvent * );
00143
KURL activeDocumentUrl();
00144
00145
private:
00146 class KDevFileSelectorToolBar *
toolbar;
00147 KActionCollection *
mActionCollection;
00148 class KBookmarkHandler *
bookmarkHandler;
00149 KURLComboBox *
cmbPath;
00150 KDevDirOperator *
dir;
00151 class KAction *
acSyncDir;
00152 KHistoryCombo *
filter;
00153 class QToolButton *
btnFilter;
00154
00155 FileSelectorPart *
m_part;
00156 KDevMainWindow *
mainwin;
00157 KDevPartController *
partController;
00158
00159 QString lastFilter;
00160 int autoSyncEvents;
00161 QString waitingUrl;
00162 QString waitingDir;
00163 };
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178 class KFSConfigPage :
public QWidget
00179 {
00180 Q_OBJECT
00181
public:
00182
KFSConfigPage(
QWidget* parent=0,
const char *name=0,
KDevFileSelector *kfs=0);
00183 virtual ~KFSConfigPage() {};
00184
00185
public slots:
00186
virtual void apply();
00187
virtual void reload();
00188
virtual void slotChanged();
00189
00190
private:
00191
void init();
00192
00193 KDevFileSelector *
fileSelector;
00194 bool bDirty;
00195
00196 KActionSelector *
acSel;
00197 class QSpinBox *
sbPathHistLength, *
sbFilterHistLength;
00198 class QCheckBox *
cbSyncOpen, *
cbSyncActive, *
cbSyncShow;
00199 class QCheckBox *
cbSesLocation, *
cbSesFilter;
00200 };
00201
00202
00203
#endif
00204
This file is part of the documentation for KDevelop Version 3.0.4.