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)  

Project.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : Project.h
3  Project : LabPlot
4  Description : Represents a LabPlot project.
5  --------------------------------------------------------------------
6  Copyright : (C) 2011-2020 Alexander Semke (alexander.semke@web.de)
7  Copyright : (C) 2007-2008 Tilman Benkert (thzs@gmx.net)
8  Copyright : (C) 2007 Knut Franke (knut.franke@gmx.de)
9 
10  ***************************************************************************/
11 
12 /***************************************************************************
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * *
19  * This program is distributed in the hope that it will be useful, *
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22  * GNU General Public License for more details. *
23  * *
24  * You should have received a copy of the GNU General Public License *
25  * along with this program; if not, write to the Free Software *
26  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
27  * Boston, MA 02110-1301 USA *
28  * *
29  ***************************************************************************/
30 #ifndef PROJECT_H
31 #define PROJECT_H
32 
33 #include "backend/core/Folder.h"
34 #include "backend/lib/macros.h"
35 
36 class AbstractColumn;
37 class Histogram;
38 class XYCurve;
39 class QMimeData;
40 class QString;
41 
42 class Project : public Folder {
43  Q_OBJECT
44 
45 public:
46  enum class MdiWindowVisibility {
47  folderOnly,
50  };
51 
52 public:
53  Project();
54  ~Project() override;
55 
56  virtual const Project* project() const {
57  return this;
58  }
59  Project* project() override {
60  return this;
61  }
62  QUndoStack* undoStack() const override;
63  QString path() const override {
64  return name();
65  }
66  QMenu* createContextMenu() override;
67  virtual QMenu* createFolderContextMenu(const Folder*);
68 
71  CLASS_D_ACCESSOR_DECL(QString, fileName, FileName)
72  BASIC_D_ACCESSOR_DECL(QString, version, Version)
73  CLASS_D_ACCESSOR_DECL(QString, author, Author)
74  CLASS_D_ACCESSOR_DECL(QDateTime, modificationTime, ModificationTime)
75 
76  void setChanged(const bool value=true);
77  bool hasChanged() const;
78  void navigateTo(const QString& path);
79 
81  bool aspectAddedSignalSuppressed() const;
82 
83  void save(const QPixmap&, QXmlStreamWriter*) const;
84  bool load(XmlStreamReader*, bool preview) override;
85  bool load(const QString&, bool preview = false);
86 
87  static bool isLabPlotProject(const QString& fileName);
88  static QString supportedExtensions();
89  QVector<quintptr> droppedAspects(const QMimeData*);
90 
91  class Private;
92 
93 public slots:
95  void aspectAddedSlot(const AbstractAspect*);
96 
97 signals:
98  void authorChanged(const QString&);
99  void requestSaveState(QXmlStreamWriter*) const;
102  void requestFolderContextMenu(const Folder*, QMenu*);
104  void changed();
105  void requestNavigateTo(const QString& path);
106  void loaded();
108 
109 private:
114  void save(QXmlStreamWriter*) const override;
115 };
116 
117 #endif // ifndef PROJECT_H
Base class of all persistent objects in a Project.
QString name() const
Interface definition for data with column logic.
Folder in a project.
Definition: Folder.h:35
A 2D-curve, provides an interface for editing many properties of the curve.
Definition: Histogram.h:42
Represents a project.
Definition: Project.h:42
virtual const Project * project() const
Definition: Project.h:56
bool aspectAddedSignalSuppressed() const
Definition: Project.cpp:207
MdiWindowVisibility
MDI subwindow visibility setting.
Definition: Project.h:46
@ folderOnly
only show MDI windows corresponding to Parts in the current folder
@ allMdiWindows
show MDI windows for all Parts in the project simultaneously
void requestNavigateTo(const QString &path)
void updateCurveColumnDependencies(const QVector< XYCurve * > &, const AbstractColumn *) const
Definition: Project.cpp:271
void requestLoadState(XmlStreamReader *)
void setMdiWindowVisibility(MdiWindowVisibility visibility)
Definition: Project.cpp:173
Project * project() override
Return the Project this Aspect belongs to, or 0 if it is currently not part of one.
Definition: Project.h:59
Private * d
Definition: Project.h:110
void authorChanged(const QString &)
QVector< quintptr > droppedAspects(const QMimeData *)
Definition: Project.cpp:360
void navigateTo(const QString &path)
Definition: Project.cpp:344
void changed()
void descriptionChanged(const AbstractAspect *)
Project::descriptionChanged This function is called, when an object changes its name....
Definition: Project.cpp:221
MdiWindowVisibility mdiWindowVisibility() const
Definition: Project.cpp:178
QUndoStack * undoStack() const override
Return the undo stack of the Project, or 0 if this Aspect is not part of a Project.
Definition: Project.cpp:150
static QString supportedExtensions()
Definition: Project.cpp:355
void mdiWindowVisibilityChanged()
bool hasChanged() const
Definition: Project.cpp:211
void requestFolderContextMenu(const Folder *, QMenu *)
QMenu * createContextMenu() override
Return a new context menu.
Definition: Project.cpp:154
void requestSaveState(QXmlStreamWriter *) const
Project()
Definition: Project.cpp:107
void loaded()
void setChanged(const bool value=true)
Definition: Project.cpp:193
bool load(XmlStreamReader *, bool preview) override
Load from XML.
Definition: Project.cpp:505
void closeRequested()
void setSuppressAspectAddedSignal(bool)
Definition: Project.cpp:203
void updateHistogramColumnDependencies(const QVector< Histogram * > &, const AbstractColumn *) const
Definition: Project.cpp:328
bool readProjectAttributes(XmlStreamReader *)
Definition: Project.cpp:695
QString path() const override
Return the path that leads from the top-most Aspect (usually a Project) to me.
Definition: Project.h:63
virtual QMenu * createFolderContextMenu(const Folder *)
Definition: Project.cpp:167
void save(const QPixmap &, QXmlStreamWriter *) const
Definition: Project.cpp:379
void aspectAddedSlot(const AbstractAspect *)
Project::aspectAddedSlot When adding new columns, these should be connected to the corresponding curv...
Definition: Project.cpp:245
static bool isLabPlotProject(const QString &fileName)
Definition: Project.cpp:348
~Project() override
Definition: Project.cpp:128
void requestProjectContextMenu(QMenu *)
A 2D-curve, provides an interface for editing many properties of the curve.
Definition: XYCurve.h:46
XML stream parser that supports errors as well as warnings. This class also adds line and column numb...
#define CLASS_D_ACCESSOR_DECL(type, method, Method)
Definition: macros.h:134
#define BASIC_D_ACCESSOR_DECL(type, method, Method)
Definition: macros.h:107
short Version(char *&buffer, size_t &count)
Get version of ROOT object, obtain number of bytes in object.
Definition: ROOTFilter.cpp:573