2
* Copyright (C) 2009 by Ana Cecília Martins <anaceciliamb@gmail.com>
3
* Copyright (C) 2009 by Ivan Cukic <ivan.cukic+kde@gmail.com>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU Library/Lesser General Public License
7
* version 2, or (at your option) any later version, as published by the
8
* Free Software Foundation
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details
15
* You should have received a copy of the GNU Library/Lesser General Public
16
* License along with this program; if not, write to the
17
* Free Software Foundation, Inc.,
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24
#include <QBasicTimer>
27
#include "kcategorizeditemsviewmodels_p.h"
28
#include "plasmaappletitemmodel_p.h"
29
#include "appleticon.h"
30
#include "applettooltip.h"
31
#include "abstracticonlist.h"
34
class AppletsListWidget : public Plasma::AbstractIconList
40
AppletsListWidget(Plasma::Location location = Plasma::BottomEdge, QGraphicsItem *parent = 0);
43
//not used yet and probably never will be
44
QList <KCategorizedItemsViewModels::AbstractItem *> selectedItems() const;
46
void setItemModel(PlasmaAppletItemModel *model);
47
void setFilterModel(QStandardItemModel *model);
50
KCategorizedItemsViewModels::AbstractItem *getItemByProxyIndex(const QModelIndex &index) const;
52
void populateAllAppletsHash();
54
//Creates a new applet icon and puts it into the hash
55
AppletIconWidget *createAppletIcon(PlasmaAppletItem *appletItem);
57
void setToolTipPosition();
60
void filterChanged(int index);
62
void appletIconDoubleClicked(Plasma::AbstractIcon *icon);
63
void appletIconHoverLeave(Plasma::AbstractIcon *icon);
64
void appletIconHoverEnter(Plasma::AbstractIcon *icon);
65
void appletIconDragging(Plasma::AbstractIcon *icon);
66
void onToolTipEnter();
67
void onToolTipLeave();
69
void animateToolTipMove();
70
void toolTipMoveTimeLineFrameChanged(int frame);
71
void rowsAboutToBeRemoved(const QModelIndex& parent, int row, int column);
73
protected: //FIXME wuh?
74
void timerEvent(QTimerEvent *event);
75
QVariant itemChange(GraphicsItemChange change, const QVariant & value);
77
//virtuals from AbstractIconList
78
void updateVisibleIcons();
79
void setSearch(const QString &searchString);
82
void appletDoubleClicked(PlasmaAppletItem *appletItem);
86
//One single tootip to show applets info
87
AppletToolTipWidget *m_toolTip;
89
QStandardItemModel *m_modelItems;
92
QStandardItemModel *m_modelFilters;
94
//model that filters the item models
95
KCategorizedItemsViewModels::DefaultItemFilterProxyModel *m_modelFilterItems;
97
QVariant m_dataFilterAboutToApply;
98
QBasicTimer m_filterApplianceTimer;
99
QBasicTimer m_toolTipAppearTimer;
100
QBasicTimer m_toolTipDisappearTimer;
101
QBasicTimer m_toolTipAppearWhenAlreadyVisibleTimer;
103
QTimeLine toolTipMoveTimeLine;
104
QPoint toolTipMoveFrom;
105
QPoint toolTipMoveTo;
108
#endif //APPLETSLIST_H