QGIS API Documentation 3.99.0-Master (c22de0620c0)
Loading...
Searching...
No Matches
qgssensorthingsdataitems.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssensorthingsdataitems.h
3 ---------------------
4 begin : December 2023
5 copyright : (C) 2023 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#ifndef QGSSENSORTHINGSDATAITEMS_H
16#define QGSSENSORTHINGSDATAITEMS_H
17
18#include "qgsconnectionsitem.h"
19#include "qgsdataitemprovider.h"
20#include "qgslayeritem.h"
21
22#define SIP_NO_FILE
23
25
27class CORE_EXPORT QgsSensorThingsRootItem : public QgsConnectionsRootItem
28{
29 Q_OBJECT
30 public:
31 QgsSensorThingsRootItem( QgsDataItem *parent, QString name, QString path );
32
33 QVector<QgsDataItem *> createChildren() override;
34
35 QVariant sortKey() const override { return 8; }
36
37};
38
40class CORE_EXPORT QgsSensorThingsConnectionItem : public QgsDataCollectionItem
41{
42 Q_OBJECT
43 public:
44 QgsSensorThingsConnectionItem( QgsDataItem *parent, const QString &name, const QString &path );
45 bool equal( const QgsDataItem *other ) override;
46 QVector<QgsDataItem *> createChildren() override;
47 private:
48 QString mConnName;
49};
50
52class CORE_EXPORT QgsSensorThingsEntityContainerItem : public QgsDataCollectionItem
53{
54 Q_OBJECT
55 public:
56 QgsSensorThingsEntityContainerItem( QgsDataItem *parent, const QString &name, const QString &path, const QVariantMap &entityUriParts,
57 Qgis::SensorThingsEntity entityType, const QString &connectionName );
58 bool equal( const QgsDataItem *other ) override;
59 QVector<QgsDataItem *> createChildren() override;
60 private:
61 QVariantMap mEntityUriParts;
63 QString mConnectionName;
64};
65
66
67class CORE_EXPORT QgsSensorThingsLayerEntityItem : public QgsLayerItem
68{
69 Q_OBJECT
70 public:
71 QgsSensorThingsLayerEntityItem( QgsDataItem *parent, const QString &name, const QString &path,
72 const QVariantMap &uriParts, const QString &provider, Qgis::BrowserLayerType type,
73 Qgis::SensorThingsEntity entityType, const QString &connectionName );
74 QString layerName() const final;
75 private:
76 QVariantMap mUriParts;
77 Qgis::SensorThingsEntity mEntityType = Qgis::SensorThingsEntity::Invalid;
78 QString mConnectionName;
79};
80
82class QgsSensorThingsDataItemProvider : public QgsDataItemProvider
83{
84 public:
85 QString name() override;
86 QString dataProviderKey() const override;
87 Qgis::DataItemProviderCapabilities capabilities() const override;
88
89 QgsDataItem *createDataItem( const QString &path, QgsDataItem *parentItem ) override;
90};
91
93
94#endif // QGSSENSORTHINGSDATAITEMS_H
QFlags< DataItemProviderCapability > DataItemProviderCapabilities
Capabilities for data item providers.
Definition qgis.h:1013
SensorThingsEntity
OGC SensorThings API entity types.
Definition qgis.h:6282
@ Invalid
An invalid/unknown entity.
Definition qgis.h:6283
BrowserLayerType
Browser item layer types.
Definition qgis.h:1022
A browser item that represents a root group of connections from a single data provider.
A browser item for collections of data.
Base class for all items in the model.
Definition qgsdataitem.h:50
virtual QVariant sortKey() const
Returns the sorting key for the item.
virtual QVector< QgsDataItem * > createChildren()
Create children.
QString name() const
Returns the name of the item (the displayed text for the item).
virtual bool equal(const QgsDataItem *other)
Returns true if this item is equal to another item (by testing item type and path).
A browser item that represents a layer that can be opened with one of the providers.