summaryrefslogtreecommitdiffstats
path: root/konq-plugins/fsview/fsview_part.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit84da08d7b7fcda12c85caeb5a10b4903770a6f69 (patch)
tree2a6aea76f2dfffb4cc04bb907c4725af94f70e72 /konq-plugins/fsview/fsview_part.h
downloadtdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.tar.gz
tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'konq-plugins/fsview/fsview_part.h')
-rw-r--r--konq-plugins/fsview/fsview_part.h122
1 files changed, 122 insertions, 0 deletions
diff --git a/konq-plugins/fsview/fsview_part.h b/konq-plugins/fsview/fsview_part.h
new file mode 100644
index 0000000..4f2c734
--- /dev/null
+++ b/konq-plugins/fsview/fsview_part.h
@@ -0,0 +1,122 @@
+/* This file is part of FSView.
+ Copyright (C) 2002, 2003 Josef Weidendorfer <[email protected]>
+
+ KCachegrind is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation, version 2.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+/*
+ * The KPart embedding the FSView widget
+ */
+
+#ifndef FSVIEW_PART_H
+#define FSVIEW_PART_H
+
+#include <kparts/part.h>
+#include <kparts/browserextension.h>
+#include <kio/jobclasses.h>
+
+#include "fsview.h"
+
+class KAboutData;
+class KActionMenu;
+
+class FSViewPart;
+
+class FSViewBrowserExtension : public KParts::BrowserExtension
+{
+ Q_OBJECT
+
+public:
+ FSViewBrowserExtension(FSViewPart *viewPart, const char *name=0L);
+ ~FSViewBrowserExtension();
+
+protected slots:
+ void selected(TreeMapItem*);
+ void contextMenu(TreeMapItem*,const QPoint&);
+
+ void updateActions();
+ void refresh();
+
+ void copy() { copySelection( false ); }
+ void cut() { copySelection( true ); }
+ void trash();
+ void del();
+ void editMimeType();
+
+private:
+ void copySelection( bool move );
+
+ FSView* _view;
+};
+
+class FSJob: public KIO::Job
+{
+ Q_OBJECT
+
+public:
+ FSJob(FSView*);
+
+ virtual void kill( bool quietly = true );
+
+public slots:
+ void progressSlot(int percent, int dirs, const QString& lastDir);
+
+private:
+ FSView* _view;
+};
+
+
+class FSViewPart : public KParts::ReadOnlyPart
+{
+ Q_OBJECT
+ Q_PROPERTY( bool supportsUndo READ supportsUndo )
+public:
+ FSViewPart(QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name, const QStringList &args);
+
+ virtual ~FSViewPart();
+
+ bool supportsUndo() const { return false; }
+
+ static KAboutData* createAboutData();
+ FSView* view() const { return _view; }
+
+public slots:
+ void showInfo();
+ void showHelp();
+ void startedSlot();
+ void completedSlot(int dirs);
+ void slotShowVisMenu();
+ void slotShowAreaMenu();
+ void slotShowDepthMenu();
+ void slotShowColorMenu();
+ void slotSettingsChanged(int);
+
+protected:
+ /**
+ * This must be implemented by each part
+ */
+ virtual bool openFile();
+ virtual bool openURL(const KURL &url);
+ virtual bool closeURL();
+
+private:
+ FSView* _view;
+ FSJob* _job;
+ FSViewBrowserExtension* _ext;
+ KActionMenu *_visMenu, *_areaMenu, *_depthMenu, *_colorMenu;
+};
+
+#endif // FSVIEW_PART_H