"Fossies" - the Fresh Open Source Software Archive

Member "labplot-2.8.2/src/backend/core/Project.h" (24 Feb 2021, 4310 Bytes) of package /linux/privat/labplot-2.8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Project.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.8.1_vs_2.8.2.

    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,
   48         folderAndSubfolders,
   49         allMdiWindows
   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 
   69     void setMdiWindowVisibility(MdiWindowVisibility visibility);
   70     MdiWindowVisibility mdiWindowVisibility() const;
   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 
   80     void setSuppressAspectAddedSignal(bool);
   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:
   94     void descriptionChanged(const AbstractAspect*);
   95     void aspectAddedSlot(const AbstractAspect*);
   96 
   97 signals:
   98     void authorChanged(const QString&);
   99     void requestSaveState(QXmlStreamWriter*) const;
  100     void requestLoadState(XmlStreamReader*);
  101     void requestProjectContextMenu(QMenu*);
  102     void requestFolderContextMenu(const Folder*, QMenu*);
  103     void mdiWindowVisibilityChanged();
  104     void changed();
  105     void requestNavigateTo(const QString& path);
  106     void loaded();
  107     void closeRequested();
  108 
  109 private:
  110     Private* d;
  111     void updateCurveColumnDependencies(const QVector<XYCurve*>&, const AbstractColumn*) const;
  112     void updateHistogramColumnDependencies(const QVector<Histogram*>&, const AbstractColumn*) const;
  113     bool readProjectAttributes(XmlStreamReader*);
  114     void save(QXmlStreamWriter*) const override;
  115 };
  116 
  117 #endif // ifndef PROJECT_H