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 protected:
00139 void focusInEvent( QFocusEvent * );
00140 void showEvent( QShowEvent * );
00141 bool eventFilter( QObject *, QEvent * );
00142 KURL activeDocumentUrl();
00143
00144 private:
00145 class KDevFileSelectorToolBar *toolbar;
00146 KActionCollection *mActionCollection;
00147 class KBookmarkHandler *bookmarkHandler;
00148 KURLComboBox *cmbPath;
00149 KDevDirOperator * dir;
00150 class KAction *acSyncDir;
00151 KHistoryCombo * filter;
00152 class QToolButton *btnFilter;
00153
00154 FileSelectorPart *m_part;
00155 KDevMainWindow *mainwin;
00156 KDevPartController *partController;
00157
00158 QString lastFilter;
00159 int autoSyncEvents;
00160 QString waitingUrl;
00161 QString waitingDir;
00162 };
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177 class KFSConfigPage : public QWidget
00178 {
00179 Q_OBJECT
00180 public:
00181 KFSConfigPage( QWidget* parent=0, const char *name=0, KDevFileSelector *kfs=0);
00182 virtual ~KFSConfigPage() {};
00183
00184 public slots:
00185 virtual void apply();
00186 virtual void reload();
00187 virtual void slotChanged();
00188
00189 private:
00190 void init();
00191
00192 KDevFileSelector *fileSelector;
00193 bool bDirty;
00194
00195 KActionSelector *acSel;
00196 class QSpinBox *sbPathHistLength, *sbFilterHistLength;
00197 class QCheckBox *cbSyncOpen, *cbSyncActive, *cbSyncShow;
00198 class QCheckBox *cbSesLocation, *cbSesFilter;
00199 };
00200
00201
00202 #endif
00203
This file is part of the documentation for KDevelop Version 3.1.2.