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)  

CantorWorksheet.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : CantorWorksheet.h
3  Project : LabPlot
4  Description : Aspect providing a Cantor Worksheets for Multiple backends
5  --------------------------------------------------------------------
6  Copyright : (C) 2015 Garvit Khatri (garvitdelhi@gmail.com)
7  Copyright : (C) 2016 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 #ifndef CANTORWORKSHEET_H
30 #define CANTORWORKSHEET_H
31 
33 #include <cantor/session.h>
34 
35 namespace Cantor {
36 class PanelPlugin;
37 class WorksheetAccessInterface;
38 }
39 
40 namespace KParts {
41 class ReadWritePart;
42 }
43 
45 class Column;
46 class QAbstractItemModel;
47 
48 class CantorWorksheet : public AbstractPart {
49  Q_OBJECT
50 
51 public:
52  explicit CantorWorksheet(const QString& name, bool loading = false);
53 
54  bool init(QByteArray* content = nullptr);
55 
56  QWidget* view() const override;
57  QMenu* createContextMenu() override;
58  QIcon icon() const override;
59 
60  bool exportView() const override;
61  bool printView() override;
62  bool printPreview() const override;
63 
64  void save(QXmlStreamWriter*) const override;
65  bool load(XmlStreamReader*, bool preview) override;
66 
67  QString backendName();
68  KParts::ReadWritePart* part();
70 
71 private:
72  mutable CantorWorksheetView* m_view{nullptr};
73  QString m_backendName;
74  Cantor::Session* m_session{nullptr};
75  KParts::ReadWritePart* m_part{nullptr};
77  QAbstractItemModel* m_variableModel{nullptr};
78  Cantor::WorksheetAccessInterface* m_worksheetAccess{nullptr};
79 
80 private slots:
81  void dataChanged(const QModelIndex&);
82  void rowsInserted(const QModelIndex & parent, int first, int last);
83  void rowsAboutToBeRemoved(const QModelIndex & parent, int first, int last);
84  void modelReset();
85  void modified();
86 
87 signals:
89  void statusChanged(Cantor::Session::Status);
90 };
91 
92 #endif // CANTORWORKSHEET_H
AbstractAspect * parent(AspectType type) const
In the parent-child hierarchy, return the first parent of type.
QString name() const
Base class of Aspects with MDI windows as views (AspectParts).
Definition: AbstractPart.h:36
void dataChanged(const QModelIndex &)
bool init(QByteArray *content=nullptr)
QList< Cantor::PanelPlugin * > getPlugins()
bool load(XmlStreamReader *, bool preview) override
Load from XML.
QAbstractItemModel * m_variableModel
KParts::ReadWritePart * m_part
void save(QXmlStreamWriter *) const override
Save as XML.
void statusChanged(Cantor::Session::Status)
KParts::ReadWritePart * part()
QList< Cantor::PanelPlugin * > m_plugins
CantorWorksheet(const QString &name, bool loading=false)
QMenu * createContextMenu() override
Return a new context menu.
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
CantorWorksheetView * m_view
bool exportView() const override
Cantor::Session * m_session
QWidget * view() const override
Construct a primary view on me.
Cantor::WorksheetAccessInterface * m_worksheetAccess
void rowsInserted(const QModelIndex &parent, int first, int last)
void requestProjectContextMenu(QMenu *)
QIcon icon() const override
Return an icon to be used for decorating my views.
bool printPreview() const override
bool printView() override
Aspect that manages a column.
Definition: Column.h:42
XML stream parser that supports errors as well as warnings. This class also adds line and column numb...