diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-10 00:18:25 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-10 00:18:25 +0000 |
commit | f21e5792b5084f5d008bf46f6316030c6dfb31e5 (patch) | |
tree | d51583b36aa1672bac78d98a682cdc330df27e4d /src/basketlistview.h | |
download | basket-f21e5792b5084f5d008bf46f6316030c6dfb31e5.tar.gz basket-f21e5792b5084f5d008bf46f6316030c6dfb31e5.zip |
Add author-abandoned basket application
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/basket@1072339 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/basketlistview.h')
-rw-r--r-- | src/basketlistview.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/src/basketlistview.h b/src/basketlistview.h new file mode 100644 index 0000000..9a6a918 --- /dev/null +++ b/src/basketlistview.h @@ -0,0 +1,103 @@ +/*************************************************************************** + * Copyright (C) 2003 by S�astien Laot * + * slaout@linux62.org * + * * + * 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. * + * * + * 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; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef BASKETLISTVIEW_H +#define BASKETLISTVIEW_H + +#include <klistview.h> +#include <qtimer.h> + +class Basket; + +class BasketListViewItem : public QListViewItem +{ + public: + /// CONSTRUCTOR AND DESTRUCTOR: + BasketListViewItem(QListView *parent, Basket *basket); + BasketListViewItem(QListViewItem *parent, Basket *basket); + BasketListViewItem(QListView *parent, QListViewItem *after, Basket *basket); + BasketListViewItem(QListViewItem *parent, QListViewItem *after, Basket *basket); + ~BasketListViewItem(); + /// + bool acceptDrop(const QMimeSource *mime) const; + void dropped(QDropEvent *event); + Basket *basket() { return m_basket; } + void setup(); + int width(const QFontMetrics &fontMetrics, const QListView *listView, int column) const; + BasketListViewItem* lastChild(); + BasketListViewItem* prevSibling(); + BasketListViewItem* shownItemAbove(); + BasketListViewItem* shownItemBelow(); + QStringList childNamesTree(int deep = 0); + void moveChildsBaskets(); + void ensureVisible(); + bool isShown(); + bool isCurrentBasket(); + void paintCell(QPainter *painter, const QColorGroup &colorGroup, int column, int width, int align); + QString escapedName(const QString &string); + /// + QPixmap circledTextPixmap(const QString &text, int height, const QFont &font, const QColor &color); + QPixmap foundCountPixmap(bool isLoading, int countFound, bool childsAreLoading, int countChildsFound, const QFont &font, int height); + bool haveChildsLoading(); + bool haveHiddenChildsLoading(); + bool haveChildsLocked(); + bool haveHiddenChildsLocked(); + int countChildsFound(); + int countHiddenChildsFound(); + + void setUnderDrag(bool); + bool isAbbreviated(); + /// +// QDragObject* dragObject(); +// bool acceptDrop ( const QMimeSource * mime ) const; + private: + Basket *m_basket; + int m_width; + bool m_isUnderDrag; + bool m_isAbbreviated; +}; + +class BasketTreeListView : public KListView +{ + Q_OBJECT + public: + BasketTreeListView(QWidget *parent = 0, const char *name = 0); + void contentsDragEnterEvent(QDragEnterEvent *event); + void removeExpands(); + void contentsDragLeaveEvent(QDragLeaveEvent *event); + void contentsDragMoveEvent(QDragMoveEvent *event); + void contentsDropEvent(QDropEvent *event); + void resizeEvent(QResizeEvent *event); + void paintEmptyArea(QPainter *painter, const QRect &rect); + protected: + void focusInEvent(QFocusEvent*); + void viewportResizeEvent(QResizeEvent *event); + private: + QTimer m_autoOpenTimer; + QListViewItem *m_autoOpenItem; + private slots: + void autoOpen(); + private: + void setItemUnderDrag(BasketListViewItem* item); + BasketListViewItem* m_itemUnderDrag; + +}; + +#endif // BASKETLISTVIEW_H |