diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-22 19:31:25 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-22 19:31:25 +0000 |
commit | 6afd9d8dddbe9e450690e05d498a503c00333a5e (patch) | |
tree | ee3eaca74e8e33dd66f24f5fb6c1431d7a9ff429 /ksquirrel/sidebar/sq_categoriesview.h | |
download | ksquirrel-6afd9d8dddbe9e450690e05d498a503c00333a5e.tar.gz ksquirrel-6afd9d8dddbe9e450690e05d498a503c00333a5e.zip |
Added KDE3 version of ksquirrel photo manager
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ksquirrel@1094446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksquirrel/sidebar/sq_categoriesview.h')
-rw-r--r-- | ksquirrel/sidebar/sq_categoriesview.h | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/ksquirrel/sidebar/sq_categoriesview.h b/ksquirrel/sidebar/sq_categoriesview.h new file mode 100644 index 0000000..b803dbb --- /dev/null +++ b/ksquirrel/sidebar/sq_categoriesview.h @@ -0,0 +1,129 @@ +/*************************************************************************** + sq_categoriesview.h - description + ------------------- + begin : ??? June 3 2006 + copyright : (C) 2006 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program 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; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_CATEGORIESVIEW_H +#define SQ_CATEGORIESVIEW_H + +#include <qvbox.h> + +#include <kfiletreeview.h> +#include <kfiletreebranch.h> + +class KToolBar; + +class SQ_CategoryBrowserMenu; +class SQ_TreeViewMenu; +class SQ_Dir; + +/** + *@author Baryshev Dmitry + */ + +/* *************************************************** */ + +class SQ_CategoriesViewBranch : public KFileTreeBranch +{ + public: + SQ_CategoriesViewBranch(KFileTreeView*, const KURL &url, const QString &name, const QPixmap &pix); + ~SQ_CategoriesViewBranch(); + + protected: + virtual KFileTreeViewItem *createTreeViewItem(KFileTreeViewItem *parent, KFileItem *fileItem); +}; + +/* *************************************************** */ + +class SQ_CategoriesView : public KFileTreeView +{ + Q_OBJECT + + public: + SQ_CategoriesView(QWidget *parent = 0, const char *name = 0); + ~SQ_CategoriesView(); + + SQ_TreeViewMenu *popupMenu() const; + + SQ_Dir* dir(); + + private slots: + void slotItemExecuted(QListViewItem *item); + void slotContextMenu(KListView *, QListViewItem *i, const QPoint &p); + + private: + KFileTreeBranch *root; + SQ_TreeViewMenu *menu; + + SQ_Dir *m_dir; +}; + +inline +SQ_TreeViewMenu* SQ_CategoriesView::popupMenu() const +{ + return menu; +} + +inline +SQ_Dir* SQ_CategoriesView::dir() +{ + return m_dir; +} + +/* *************************************************** */ + +class SQ_CategoriesBox : public QVBox +{ + Q_OBJECT + + public: + SQ_CategoriesBox(QWidget *parent = 0, const char *name = 0); + ~SQ_CategoriesBox(); + + /* + * Get current popup menu. + */ + SQ_CategoryBrowserMenu* popupMenu() const; + + /* + * Add selected files to some category + */ + void addToCategory(const QString &); + + static SQ_CategoriesBox* instance() { return sing; }; + + private slots: + void slotNewCategory(); + void slotDefaultCategories(); + void slotDeleteItem(); + void slotItemProperties(); + void slotDropped(QDropEvent *, QListViewItem *, QListViewItem *); + + private: + SQ_CategoriesView *view; + KToolBar *toolbar; + QString lastdir, copypath; + SQ_CategoryBrowserMenu *menu; + + static SQ_CategoriesBox *sing; +}; + +inline +SQ_CategoryBrowserMenu* SQ_CategoriesBox::popupMenu() const +{ + return menu; +} + +#endif |