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)  

AbstractPart.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : AbstractPart.h
3  Project : LabPlot
4  Description : Base class of Aspects with MDI windows as views.
5  --------------------------------------------------------------------
6  Copyright : (C) 2012-2015 Alexander Semke (alexander.semke@web.de)
7 
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  * This program is distributed in the hope that it will be useful, *
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20  * GNU General Public License for more details. *
21  * *
22  * You should have received a copy of the GNU General Public License *
23  * along with this program; if not, write to the Free Software *
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
25  * Boston, MA 02110-1301 USA *
26  * *
27  ***************************************************************************/
28 #ifndef ABSTRACT_PART_H
29 #define ABSTRACT_PART_H
30 
31 #include "AbstractAspect.h"
32 
33 class PartMdiView;
34 class QMenu;
35 
36 class AbstractPart : public AbstractAspect {
37 Q_OBJECT
38 
39 public:
40  AbstractPart(const QString &name, AspectType type);
41  ~AbstractPart() override;
42 
43  virtual QWidget* view() const = 0;
44  void deleteView() const;
45 
46  PartMdiView* mdiSubWindow() const;
47  bool hasMdiSubWindow() const;
48 
49  QMenu* createContextMenu() override;
50  virtual bool exportView() const = 0;
51  virtual bool printView() = 0;
52  virtual bool printPreview() const = 0;
53 
54  bool isDraggable() const override;
55  QVector<AspectType> dropableOn() const override;
56 
57  //TODO: move these functions to a new class AbstractPartView
58  virtual void registerShortcuts() {};
59  virtual void unregisterShortcuts() {};
60 
61 private:
62  mutable PartMdiView* m_mdiWindow{nullptr};
63 
64 protected:
65  mutable QWidget* m_partView{nullptr};
66 
67 signals:
68  void showRequested();
74 };
75 
76 #endif // ifndef ABSTRACT_PART_H
AspectType
Base class of all persistent objects in a Project.
AspectType type() const
QString name() const
Base class of Aspects with MDI windows as views (AspectParts).
Definition: AbstractPart.h:36
void printPreviewRequested()
QMenu * createContextMenu() override
Return AbstractAspect::createContextMenu() plus operations on the primary view.
AbstractPart(const QString &name, AspectType type)
bool hasMdiSubWindow() const
QVector< AspectType > dropableOn() const override
void deleteView() const
virtual void registerShortcuts()
Definition: AbstractPart.h:58
PartMdiView * m_mdiWindow
Definition: AbstractPart.h:62
PartMdiView * mdiSubWindow() const
Wrap the view() into a PartMdiView.
virtual bool exportView() const =0
void printRequested()
void importFromFileRequested()
void importFromSQLDatabaseRequested()
QWidget * m_partView
Definition: AbstractPart.h:65
~AbstractPart() override
virtual bool printPreview() const =0
virtual void unregisterShortcuts()
Definition: AbstractPart.h:59
void exportRequested()
virtual QWidget * view() const =0
Construct a primary view on me.
virtual bool printView()=0
void showRequested()
bool isDraggable() const override
QMdiSubWindow wrapper for aspect views.
Definition: PartMdiView.h:38