Read@CVL
PageData.h
Go to the documentation of this file.
1 /*******************************************************************************************************
2  ReadFramework is the basis for modules developed at CVL/TU Wien for the EU project READ.
3 
4  Copyright (C) 2016 Markus Diem <diem@caa.tuwien.ac.at>
5  Copyright (C) 2016 Stefan Fiel <fiel@caa.tuwien.ac.at>
6  Copyright (C) 2016 Florian Kleber <kleber@caa.tuwien.ac.at>
7 
8  This file is part of ReadFramework.
9 
10  ReadFramework is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  ReadFramework is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program. If not, see <http://www.gnu.org/licenses/>.
22 
23  The READ project has received funding from the European Union’s Horizon 2020
24  research and innovation programme under grant agreement No 674943
25 
26  related links:
27  [1] http://www.caa.tuwien.ac.at/cvl/
28  [2] https://transkribus.eu/Transkribus/
29  [3] https://github.com/TUWien/
30  [4] http://nomacs.org
31  *******************************************************************************************************/
32 
33 #pragma once
34 
35 #include "ElementsHelper.h"
36 
37 #pragma warning(push, 0) // no warnings from includes
38 #include <QObject>
39 #pragma warning(pop)
40 
41 // Qt defines
42 
43 namespace rdm {
44 
45 // read defines
46 class PageData : public QObject {
47  Q_OBJECT
48 
49 public:
50  PageData(QObject* parent);
51  ~PageData();
52 
53  QVector<QSharedPointer<rdf::RegionTypeConfig> > config() const;
54  QSharedPointer<rdf::PageElement> page() const;
55  QString xmlPath() const;
56 
57 public slots:
58  void parse(const QString& xmlPath);
59  void loadConfig(const QString& name);
60  void saveConfig(const QString& name) const;
61  void setXmlPath(const QString& path);
62 
63 signals:
64  void updatePage(QSharedPointer<rdf::PageElement> page) const;
65  void updateConfig() const;
66  void updateXml();
67 
68 private:
69  QVector<QSharedPointer<rdf::RegionTypeConfig> > mConfig;
70  QSharedPointer<rdf::PageElement> mPage;
71  QString mXmlPath;
72 
73  void loadSettings(QSettings& settings, const QString& name);
74  void saveSettings(QSettings& settings, const QString& name) const;
75 };
76 
77 
78 };
Definition: PageData.h:46
QString xmlPath() const
Definition: PageData.cpp:68
void updateXml()
void loadConfig(const QString &name)
Definition: PageData.cpp:72
~PageData()
Definition: PageData.cpp:54
void saveConfig(const QString &name) const
Definition: PageData.cpp:77
PageData(QObject *parent)
Definition: PageData.cpp:48
void updatePage(QSharedPointer< rdf::PageElement > page) const
QVector< QSharedPointer< rdf::RegionTypeConfig > > config() const
Definition: PageData.cpp:60
void parse(const QString &xmlPath)
Definition: PageData.cpp:87
Definition: BatchTest.cpp:45
void updateConfig() const
QSharedPointer< rdf::PageElement > page() const
Definition: PageData.cpp:64
void setXmlPath(const QString &path)
Definition: PageData.cpp:82