labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

WorksheetElement.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : WorksheetElement.h
3  Project : LabPlot
4  Description : Base class for all Worksheet children.
5  --------------------------------------------------------------------
6  Copyright : (C) 2009 Tilman Benkert (thzs@gmx.net)
7  Copyright : (C) 2012-2015 by Alexander Semke (alexander.semke@web.de)
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 
30 #ifndef WORKSHEETELEMENT_H
31 #define WORKSHEETELEMENT_H
32 
34 #include <QPainterPath>
35 
36 class QAction;
37 class QGraphicsItem;
38 class QPen;
39 class KConfig;
40 
42  Q_OBJECT
43 
44 public:
46  WorksheetElement(const QString&, AspectType);
47  ~WorksheetElement() override;
48 
50 
53 
56 
57  struct PositionWrapper {
58  QPointF point;
61  };
62 
63  virtual QGraphicsItem* graphicsItem() const = 0;
64  virtual void setZValue(qreal);
65  virtual void setVisible(bool on) = 0;
66  virtual bool isVisible() const = 0;
67  virtual bool isFullyVisible() const;
68  virtual void setPrinting(bool) = 0;
69 
70  QMenu* createContextMenu() override;
71 
72  virtual void loadThemeConfig(const KConfig&);
73  virtual void saveThemeConfig(const KConfig&);
74 
75  static QPainterPath shapeFromPath(const QPainterPath&, const QPen&);
76  virtual void handleResize(double horizontalRatio, double verticalRatio, bool pageResize = false) = 0;
77 
78 public slots:
79  virtual void retransform() = 0;
80 
81 private:
85 
86 private slots:
87  void prepareMoveBehindMenu();
89  void execMoveBehind(QAction*);
90  void execMoveInFrontOf(QAction*);
91 
92 signals:
100  void rightPaddingChanged(double);
101  void bottomPaddingChanged(double);
103 
104  void hovered();
105  void unhovered();
106 };
107 
108 #endif
AspectType
Base class of all persistent objects in a Project.
Base class for all Worksheet children.
WorksheetElement(const QString &, AspectType)
void symmetricPaddingChanged(double)
virtual void handleResize(double horizontalRatio, double verticalRatio, bool pageResize=false)=0
friend class AbstractPlotSetVerticalPaddingCmd
static QPainterPath shapeFromPath(const QPainterPath &, const QPen &)
void bottomPaddingChanged(double)
virtual void setPrinting(bool)=0
Switches the printing mode on/off.
friend class AbstractPlotSetBottomPaddingCmd
virtual void retransform()=0
Tell the element to newly transform its graphics item into its coordinate system.
virtual bool isVisible() const =0
Return whether the element is (at least) partially visible.
void execMoveInFrontOf(QAction *)
virtual void setZValue(qreal)
void horizontalPaddingChanged(float)
virtual void loadThemeConfig(const KConfig &)
virtual void setVisible(bool on)=0
Show/hide the element.
QMenu * m_moveInFrontOfMenu
QMenu * createContextMenu() override
Return a new context menu.
void execMoveBehind(QAction *)
virtual bool isFullyVisible() const
Return whether the element is fully visible (i.e., including all child elements).
friend class AbstractPlotSetSymmetricPaddingCmd
virtual QGraphicsItem * graphicsItem() const =0
Return the graphics item representing this element.
friend class AbstractPlotSetHorizontalPaddingCmd
~WorksheetElement() override
friend class AbstractPlotSetRightPaddingCmd
virtual void saveThemeConfig(const KConfig &)
void rightPaddingChanged(double)
void verticalPaddingChanged(float)
QMenu * m_drawingOrderMenu
WorksheetElement::VerticalPosition verticalPosition
WorksheetElement::HorizontalPosition horizontalPosition