diff options
Diffstat (limited to 'src/part/part.h')
-rw-r--r-- | src/part/part.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/part/part.h b/src/part/part.h new file mode 100644 index 0000000..348b22b --- /dev/null +++ b/src/part/part.h @@ -0,0 +1,71 @@ +// Author: Max Howell <[email protected]>, (C) 2003-4 +// Copyright: See COPYING file that comes with this distribution + +#ifndef FILELIGHTPART_H +#define FILELIGHTPART_H + +#include <kparts/browserextension.h> +#include <kparts/statusbarextension.h> +#include <kparts/part.h> +#include <kurl.h> + +class KAboutData; +using KParts::StatusBarExtension; +namespace RadialMap { class Widget; } +class Directory; + + +namespace Filelight +{ + class Part; + + class BrowserExtension : public KParts::BrowserExtension + { + public: + BrowserExtension( Part*, const char * = 0 ); + }; + + + class Part : public KParts::ReadOnlyPart + { + Q_OBJECT + + public: + Part( QWidget *, const char *, QObject *, const char *, const QStringList& ); + + virtual bool openFile() { return false; } //pure virtual in base class + virtual bool closeURL(); + + QString prettyURL() const { return m_url.protocol() == "file" ? m_url.path() : m_url.prettyURL(); } + + static KAboutData *createAboutData(); + + public slots: + virtual bool openURL( const KURL& ); + void configFilelight(); + void rescan(); + + private slots: + void postInit(); + void scanCompleted( Directory* ); + void mapChanged( const Directory* ); + + private: + KStatusBar *statusBar() { return m_statusbar->statusBar(); } + + BrowserExtension *m_ext; + StatusBarExtension *m_statusbar; + RadialMap::Widget *m_map; + class ScanManager *m_manager; + + bool m_started; + + private: + bool start( const KURL& ); + + private slots: + void updateURL( const KURL & ); + }; +} + +#endif |