Read@CVL
ReadConfig.h
Go to the documentation of this file.
1 /*******************************************************************************************************
2 ReadModules are plugins for nomacs 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 ReadModules.
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 "DkPluginInterface.h"
36 #include "DkBatchInfo.h"
37 #include "DkSettingsWidget.h"
38 
39 #pragma warning(push, 0) // no warnings from includes - begin
40 #include <QDialog>
41 #pragma warning(pop) // no warnings from includes - end
42 
43 namespace rdm {
44 
45 class SettingsDialog;
46 
47 class DkTestInfo : public nmc::DkBatchInfo {
48 
49 public:
50  DkTestInfo(const QString& id = QString(), const QString& filePath = QString());
51 
52  void setProperty(const QString& p);
53  QString property() const;
54 
55 private:
56  QString mProp;
57 
58 };
59 
60 class ReadConfig : public QObject, nmc::DkBatchPluginInterface {
61  Q_OBJECT
62  Q_INTERFACES(nmc::DkBatchPluginInterface)
63  Q_PLUGIN_METADATA(IID "com.nomacs.ImageLounge.ReadConfig/3.2" FILE "ReadConfig.json")
64 
65 public:
66  ReadConfig(QObject* parent = 0);
67  ~ReadConfig();
68 
69  QString id() const override;
70  QImage image() const override;
71 
72  QList<QAction*> createActions(QWidget* parent) override;
73  QList<QAction*> pluginActions() const override;
74  QSharedPointer<nmc::DkImageContainer> runPlugin(
75  const QString &runID,
76  QSharedPointer<nmc::DkImageContainer> imgC,
77  const nmc::DkSaveInfo& saveInfo,
78  QSharedPointer<nmc::DkBatchInfo>& info) const override;
79 
80  void preLoadPlugin() const override;
81  void postLoadPlugin(const QVector<QSharedPointer<nmc::DkBatchInfo> >& batchInfo) const override;
82 
83  enum {
85  // add actions here
86 
87  id_end
88  };
89 
90 protected:
91  QList<QAction*> mActions;
92  QStringList mRunIDs;
93  QStringList mMenuNames;
94  QStringList mMenuStatusTips;
95 };
96 
97 class SettingsDialog : public QDialog {
98  Q_OBJECT
99 
100 public:
101  SettingsDialog(const QString& title = tr("READ Settings"), QWidget* parent = 0);
102 
103  void setSettings(QSettings& settings);
104 
105 protected:
106  nmc::DkSettingsWidget* mSettingsWidget = 0;
107  void createLayout();
108 };
109 
110 };
QStringList mMenuNames
Definition: ReadConfig.h:93
void setProperty(const QString &p)
Definition: BatchTest.cpp:193
Definition: ReadConfig.h:97
DkTestInfo(const QString &id=QString(), const QString &filePath=QString())
Definition: BatchTest.cpp:190
QStringList mRunIDs
Definition: ReadConfig.h:92
Definition: ReadConfig.h:84
Definition: ReadConfig.h:60
QList< QAction * > mActions
Definition: ReadConfig.h:91
QStringList mMenuStatusTips
Definition: ReadConfig.h:94
QString property() const
Definition: BatchTest.cpp:197
Definition: BatchTest.cpp:45