• 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.14
  • kdeplasma-addons
  • containments
  • groupingdesktop
  • lib
gridhandle.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010 by Giulio Camuffo <giuliocamuffo@gmail.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Library General Public License as
6  * published by the Free Software Foundation; either version 2, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef GRIDHANDLE_H
21 #define GRIDHANDLE_H
22 
23 #include "handle.h"
24 
25 class GridHandle : public Handle
26 {
27  Q_OBJECT
28  public:
29  GridHandle(GroupingContainment *containment, Plasma::Applet *applet);
30  GridHandle(GroupingContainment *containment, AbstractGroup *group);
31  virtual ~GridHandle();
32 
33  void init();
34  void detachWidget();
35  QRectF boundingRect() const;
36  void setHoverPos(const QPointF &hoverPos);
37  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
38 
39  public slots:
40  void widgetResized();
41 
42  protected:
43  void mousePressEvent(QGraphicsSceneMouseEvent *event);
44  void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
45  void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
46  void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
47  bool eventFilter(QObject *obj, QEvent *event);
48 
49  private:
50  enum Location {
51  NoLocation,
52  Top,
53  Right,
54  Bottom,
55  Left
56  };
57 
58  bool enoughRoom();
59  Handle::ButtonType mapToButton(const QPointF &pos);
60  QRectF fullRect() const;
61  bool isHorizontal() const;
62 
63  bool m_moving;
64  QPointF m_startPos;
65  int m_savedZValue;
66  QPointF m_widgetPos;
67  QSizeF m_widgetSize;
68  Plasma::Svg *m_configureIcons;
69  Handle::ButtonType m_lastButton;
70  Location m_location;
71  const int SIZE;
72 };
73 
74 #endif
GridHandle::eventFilter
bool eventFilter(QObject *obj, QEvent *event)
Definition: gridhandle.cpp:81
GridHandle::GridHandle
GridHandle(GroupingContainment *containment, Plasma::Applet *applet)
Definition: gridhandle.cpp:35
QEvent
QWidget
GridHandle::mouseMoveEvent
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Definition: gridhandle.cpp:193
Handle::ButtonType
ButtonType
Definition: handle.h:46
Handle
Definition: handle.h:41
GridHandle::init
void init()
Definition: gridhandle.cpp:56
GridHandle::setHoverPos
void setHoverPos(const QPointF &hoverPos)
Definition: gridhandle.cpp:121
Handle::containment
GroupingContainment * containment() const
Definition: handle.cpp:95
GridHandle
Definition: gridhandle.h:25
QPointF
QObject::event
virtual bool event(QEvent *e)
Handle::applet
Plasma::Applet * applet() const
Definition: handle.cpp:85
handle.h
QGraphicsItem::pos
QPointF pos() const
GridHandle::paint
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: gridhandle.cpp:334
Handle::group
AbstractGroup * group() const
Definition: handle.cpp:90
QObject
QGraphicsSceneMouseEvent
QPainter
GridHandle::~GridHandle
virtual ~GridHandle()
Definition: gridhandle.cpp:51
GridHandle::widgetResized
void widgetResized()
Definition: gridhandle.cpp:174
QGraphicsSceneHoverEvent
Handle::widget
QGraphicsWidget * widget() const
Definition: handle.cpp:80
GridHandle::boundingRect
QRectF boundingRect() const
Definition: gridhandle.cpp:101
QSizeF
GroupingContainment
The base Containment class.
Definition: groupingcontainment.h:38
QRectF
GridHandle::detachWidget
void detachWidget()
Definition: gridhandle.cpp:72
QStyleOptionGraphicsItem
GridHandle::mouseReleaseEvent
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Definition: gridhandle.cpp:209
AbstractGroup
The base Group class.
Definition: abstractgroup.h:43
GridHandle::hoverLeaveEvent
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Definition: gridhandle.cpp:272
GridHandle::mousePressEvent
void mousePressEvent(QGraphicsSceneMouseEvent *event)
Definition: gridhandle.cpp:179
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:39:08 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