QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
qgsbabelformatregistry.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsbabelformatregistry.h
3 -------------------
4 begin : July 2021
5 copyright : (C) 2021 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSBABELFORMATREGISTRY_H
17#define QGSBABELFORMATREGISTRY_H
18
19#include "qgis.h"
20#include "qgis_core.h"
22#include "qgssettingstree.h"
23
24#include <QString>
25
26using namespace Qt::StringLiterals;
27
30
41class CORE_EXPORT QgsBabelFormatRegistry
42{
43 public:
44
45#ifndef SIP_RUN
46
47 static inline QgsSettingsTreeNamedListNode *sTreeBabelDevices = QgsSettingsTree::sTreeGps->createNamedListNode( u"babel-devices"_s );
48
55#endif
56
65
68
72 QStringList importFormatNames() const;
73
80 QgsBabelSimpleImportFormat *importFormat( const QString &name );
81
87 QgsBabelSimpleImportFormat *importFormatByDescription( const QString &description );
88
92 QString importFileFilter() const;
93
97 QStringList deviceNames() const;
98
104 QgsBabelGpsDeviceFormat *deviceFormat( const QString &name );
105
112 QMap< QString, QgsBabelGpsDeviceFormat * > devices() const;
113
117 void reloadFromSettings();
118
119 private:
120#ifdef SIP_RUN
122#endif
123
125 QMap< QString, QgsBabelSimpleImportFormat *> mImporters;
127 QMap< QString, QgsBabelGpsDeviceFormat *> mDevices;
128};
129
130
131#endif // QGSBABELFORMATREGISTRY_H
void reloadFromSettings()
Reloads the registry's members from the currently stored configuration.
QgsBabelSimpleImportFormat * importFormatByDescription(const QString &description)
Returns a registered import format by description.
static const QgsSettingsEntryString * settingsBabelWptDownload
static const QgsSettingsEntryString * settingsBabelRteUpload
static const QgsSettingsEntryString * settingsBabelTrkDownload
QMap< QString, QgsBabelGpsDeviceFormat * > devices() const
Returns a map of device name to device format.
static const QgsSettingsEntryString * settingsBabelWptUpload
QStringList importFormatNames() const
Returns a list of the names of all registered import formats.
static const QgsSettingsEntryString * settingsBabelTrkUpload
QStringList deviceNames() const
Returns a list of the names of all registered devices.
QgsBabelFormatRegistry & operator=(const QgsBabelFormatRegistry &rh)=delete
static QgsSettingsTreeNamedListNode * sTreeBabelDevices
QgsBabelFormatRegistry()
Constructor for QgsBabelFormatRegistry.
QgsBabelFormatRegistry(const QgsBabelFormatRegistry &rh)=delete
QString importFileFilter() const
Returns a file filter string representing all registered import formats.
static const QgsSettingsEntryString * settingsBabelRteDownload
QgsBabelSimpleImportFormat * importFormat(const QString &name)
Returns a registered import format by name.
QgsBabelGpsDeviceFormat * deviceFormat(const QString &name)
Returns a registered device format by name.
A babel format capable of interacting directly with a GPS device.
A babel format capable of converting input files to GPX files.
A string settings entry.
A named list tree node for the settings tree to help organizing and introspecting the tree.
static QgsSettingsTreeNode * sTreeGps