OpenIndy-Core  0.2.0.43
exchangeinterface.h
Go to the documentation of this file.
1 #ifndef EXCHANGEINTERFACE_H
2 #define EXCHANGEINTERFACE_H
3 
4 #include <QObject>
5 #include <QPointer>
6 #include <QIODevice>
7 #include <QStringList>
8 
9 #include "pluginmetadata.h"
10 #include "coordinatesystem.h"
11 #include "featurewrapper.h"
12 
13 namespace oi{
14 
19 class OI_CORE_EXPORT ExchangeInterface : public QObject
20 {
21  Q_OBJECT
22 
23 public:
24  explicit ExchangeInterface(QObject *parent = 0);
25 
26  virtual ~ExchangeInterface();
27 
28  //##############################
29  //exchange initialization method
30  //##############################
31 
32  virtual void init();
33 
34  //#########################################
35  //methods to get or set further information
36  //#########################################
37 
38  const PluginMetaData &getMetaData() const;
39  const QList<GeometryTypes> &getSupportedGeometries();
40 
41  const QPointer<QIODevice> &getDevice() const;
42  void setDevice(const QPointer<QIODevice> &device);
43 
44  const QList<QPointer<FeatureWrapper> > &getFeatures() const;
45  void setFeatures(const QList<QPointer<FeatureWrapper> > &features);
46 
47  const bool &getExportObservations() const;
48  void setExportObservations(const bool &exportObservations);
49 
50  const QString &getGroupName() const;
51  void setGroupName(const QString &groupName);
52 
53  const QPointer<CoordinateSystem> &getNominalSystem() const;
54  void setNominalSystem(const QPointer<CoordinateSystem> &nominalSystem);
55 
56  const QMap<DimensionType, UnitType> &getUnits() const;
57  void setUnit(const DimensionType &dimension, const UnitType &unit);
58 
59 public slots:
60 
61  //#########################
62  //import and export methods
63  //#########################
64 
65  virtual void importOiData();
66  virtual void exportOiData();
67 
68 signals:
69 
70  //################################################
71  //signals to inform OpenIndy about exchange issues
72  //################################################
73 
74  void sendMessage(const QString &msg, const MessageTypes &msgType, const MessageDestinations &msgDest = eConsoleMessage);
75  void updateProgress(const int &progress, const QString &msg); // 0 <= progress <= 100
76  void importFinished(const bool &success);
77  void exportFinished(const bool &success);
78 
79 protected:
80 
81  //###########################
82  //input and output parameters
83  //###########################
84 
85  QMap<DimensionType, UnitType> units;
86 
87  bool exportObservations; //true if only the observations of the selected geometries shall be exported
88  QString groupName; //group that the imported nominals shall be added to
89  QPointer<CoordinateSystem> nominalSystem; //nominal coordinate system the imported geometries are referenced to
90 
91  QPointer<QIODevice> device; //the device used for the im- or export (e.g. a file)
92  QList<QPointer<FeatureWrapper> > features; //the features that shall be exported or were imported
93 
95  QList<GeometryTypes> supportedGeometries;
96 
97 };
98 
99 }
100 
101 #ifndef STR
102 #define STR(x) #x
103 #endif
104 #ifndef STR2
105 #define STR2(x) STR(x)
106 #endif
107 
108 #ifndef CONCAT
109 #define CONCAT(a, b) a ## b
110 #endif
111 #ifndef CONCAT2
112 #define CONCAT2(a, b) CONCAT(a, b)
113 #endif
114 
115 #define EXCHANGE_PREFIX de.openIndy.plugin.exchange.v
116 #define Exchange_iidd STR2(CONCAT2(EXCHANGE_PREFIX, PLUGIN_INTERFACE_VERSION))
117 
118 #endif // EXCHANGEINTERFACE_H
119 
Definition: pluginmetadata.h:10
QPointer< QIODevice > device
Definition: exchangeinterface.h:91
QList< GeometryTypes > supportedGeometries
Definition: exchangeinterface.h:95
void init()
Definition: util.cpp:53
PluginMetaData metaData
Definition: exchangeinterface.h:94
Definition: coordinatesystem.h:15
The OiExchangeInterface class Base class for implementing import/export plugins.
Definition: exchangeinterface.h:19
Definition: types.h:38
MessageDestinations
used to specify where to print a message
Definition: types.h:37
QList< QPointer< FeatureWrapper > > features
Definition: exchangeinterface.h:92
MessageTypes
all types of messages
Definition: types.h:29
bool exportObservations
Definition: exchangeinterface.h:87
QString groupName
Definition: exchangeinterface.h:88
DimensionType
Definition: types.h:377
QPointer< CoordinateSystem > nominalSystem
Definition: exchangeinterface.h:89
UnitType
Definition: types.h:354
QMap< DimensionType, UnitType > units
Definition: exchangeinterface.h:85
#define OI_CORE_EXPORT
Definition: types.h:11