QGIS API Documentation 4.1.0-Master (60fea48833c)
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#ifndef SIP_RUN
45
46 static inline QgsSettingsTreeNamedListNode *sTreeBabelDevices = QgsSettingsTree::sTreeGps->createNamedListNode( u"babel-devices"_s );
47
54#endif
55
64
67
71 QStringList importFormatNames() const;
72
79 QgsBabelSimpleImportFormat *importFormat( const QString &name );
80
86 QgsBabelSimpleImportFormat *importFormatByDescription( const QString &description );
87
91 QString importFileFilter() const;
92
96 QStringList deviceNames() const;
97
103 QgsBabelGpsDeviceFormat *deviceFormat( const QString &name );
104
111 QMap< QString, QgsBabelGpsDeviceFormat * > devices() const;
112
116 void reloadFromSettings();
117
118 private:
119#ifdef SIP_RUN
121#endif
122
124 QMap< QString, QgsBabelSimpleImportFormat *> mImporters;
126 QMap< QString, QgsBabelGpsDeviceFormat *> mDevices;
127};
128
129
130#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