• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeplasma-addons API Reference
  • KDE Home
  • Contact Us
 

GroupingDesktop

  • sources
  • kde-4.12
  • kdeplasma-addons
  • containments
  • groupingdesktop
  • lib
  • groupexplorer
groupiconlist.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009 by Ana CecĂ­lia Martins <anaceciliamb@gmail.com>
3  * Copyright (C) 2009 by Ivan Cukic <ivan.cukic+kde@gmail.com>
4  * Copyright (C) 2010 by Chani Armitage <chani@kde.org>
5  * Copyright 2010 by Giulio Camuffo <giuliocamuffo@gmail.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Library/Lesser General Public License
9  * version 2, or (at your option) any later version, as published by the
10  * Free Software Foundation
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details
16  *
17  * You should have received a copy of the GNU Library/Lesser General Public
18  * License along with this program; if not, write to the
19  * Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef GROUPICONLIST_H
24 #define GROUPICONLIST_H
25 
26 #include <QtGui/QGraphicsWidget>
27 
28 #include <Plasma/Plasma>
29 
30 class QGraphicsLinearLayout;
31 
32 namespace Plasma
33 {
34  class Animation;
35  class ItemBackground;
36  class ToolButton;
37  class Svg;
38 }
39 
40 class GroupIcon;
41 
42 class GroupIconList : public QGraphicsWidget
43 {
44  Q_OBJECT
45  public:
46  explicit GroupIconList(Plasma::Location location = Plasma::BottomEdge, QGraphicsItem *parent = 0);
47  ~GroupIconList();
48 
49  void setLocation(Plasma::Location location);
50  Plasma::Location location();
51  void setIconSize(int size);
52  int iconSize() const;
53 
54  public Q_SLOTS:
55  void updateList();
56 
57  protected:
58  void wheelEvent(QGraphicsSceneWheelEvent *event);
59  bool eventFilter(QObject *obj, QEvent *event);
60 
61  private Q_SLOTS:
62  //checks if arrows should be enabled or not
63  void manageArrows();
64  void scrollDownRight();
65  void scrollUpLeft();
66  void scrollStepFinished();
67  //moves list to position 0,0
68  void resetScroll();
69  void iconHoverEnter(GroupIcon *icon);
70 
71  private:
72  void addIcon(GroupIcon *applet);
73  void scrollTo(int index);
74  //see how many icons is visible at once, approximately
75  int maximumAproxVisibleIconsOnList();
76  //removes all the icons from the widget
77  void eraseList();
78  //returns the what's the visible rect of the list widget
79  QRectF visibleListRect();
80  //returns window's start position
81  qreal visibleStartPosition();
82  //returns window's end position
83  qreal visibleEndPosition();
84  //returns list size
85  qreal listSize();
86  //returns windows size relative to list
87  qreal windowSize();
88  //returns item position
89  qreal itemPosition(int i);
90 
91  QList<GroupIcon *> m_items;
92  QGraphicsLinearLayout *m_listLayout;
93  QGraphicsWidget *m_scrollWidget;
94  QGraphicsWidget *m_listWidget;
95  QGraphicsLinearLayout *m_arrowsLayout;
96 
97  Plasma::ToolButton *m_downRightArrow;
98  Plasma::ToolButton *m_upLeftArrow;
99  Plasma::Svg *m_arrowsSvg;
100 
101  Qt::Orientation m_orientation;
102  Plasma::Location m_location;
103  Plasma::ItemBackground *m_hoverIndicator;
104 
105  int m_firstItemIndex;
106 
107  int m_scrollStep;
108  int m_iconSize;
109  bool m_scrollingDueToWheel;
110 
111  Plasma::Animation *m_slide;
112 };
113 
114 #endif //ICONLIST_H
GroupIconList::updateList
void updateList()
Definition: groupiconlist.cpp:240
GroupIconList::GroupIconList
GroupIconList(Plasma::Location location=Plasma::BottomEdge, QGraphicsItem *parent=0)
Definition: groupiconlist.cpp:53
GroupIconList::setLocation
void setLocation(Plasma::Location location)
Definition: groupiconlist.cpp:155
GroupIcon
Definition: groupicon.h:33
GroupIconList
Definition: groupiconlist.h:42
GroupIconList::iconSize
int iconSize() const
Definition: groupiconlist.cpp:451
GroupIconList::eventFilter
bool eventFilter(QObject *obj, QEvent *event)
Definition: groupiconlist.cpp:122
GroupIconList::~GroupIconList
~GroupIconList()
Definition: groupiconlist.cpp:117
GroupIconList::wheelEvent
void wheelEvent(QGraphicsSceneWheelEvent *event)
Definition: groupiconlist.cpp:247
GroupIconList::setIconSize
void setIconSize(int size)
Definition: groupiconlist.cpp:436
GroupIconList::location
Plasma::Location location()
Definition: groupiconlist.cpp:150
QGraphicsWidget
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Mon Oct 13 2014 22:55:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

GroupingDesktop

Skip menu "GroupingDesktop"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeplasma-addons API Reference

Skip menu "kdeplasma-addons API Reference"
  •     GroupingDesktop
  •   liblancelot

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal