QGIS API Documentation 3.41.0-Master (45a0abf3bec)
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 "qgslayeritem.h"
20#include "qgsdataitemprovider.h"
21
23#define SIP_NO_FILE
24
26class CORE_EXPORT QgsSensorThingsRootItem : public QgsConnectionsRootItem
27{
28 Q_OBJECT
29 public:
30 QgsSensorThingsRootItem( QgsDataItem *parent, QString name, QString path );
31
32 QVector<QgsDataItem *> createChildren() override;
33
34 QVariant sortKey() const override { return 8; }
35
36};
37
39class CORE_EXPORT QgsSensorThingsConnectionItem : public QgsDataCollectionItem
40{
41 Q_OBJECT
42 public:
43 QgsSensorThingsConnectionItem( QgsDataItem *parent, const QString &name, const QString &path );
44 bool equal( const QgsDataItem *other ) override;
45 QVector<QgsDataItem *> createChildren() override;
46 private:
47 QString mConnName;
48};
49
51class CORE_EXPORT QgsSensorThingsEntityContainerItem : public QgsDataCollectionItem
52{
53 Q_OBJECT
54 public:
55 QgsSensorThingsEntityContainerItem( QgsDataItem *parent, const QString &name, const QString &path, const QVariantMap &entityUriParts,
56 Qgis::SensorThingsEntity entityType, const QString &connectionName );
57 bool equal( const QgsDataItem *other ) override;
58 QVector<QgsDataItem *> createChildren() override;
59 private:
60 QVariantMap mEntityUriParts;
62 QString mConnectionName;
63};
64
65
66class CORE_EXPORT QgsSensorThingsLayerEntityItem : public QgsLayerItem
67{
68 Q_OBJECT
69 public:
70 QgsSensorThingsLayerEntityItem( QgsDataItem *parent, const QString &name, const QString &path,
71 const QVariantMap &uriParts, const QString &provider, Qgis::BrowserLayerType type,
72 Qgis::SensorThingsEntity entityType, const QString &connectionName );
73 QString layerName() const final;
74 private:
75 QVariantMap mUriParts;
76 Qgis::SensorThingsEntity mEntityType = Qgis::SensorThingsEntity::Invalid;
77 QString mConnectionName;
78};
79
81class QgsSensorThingsDataItemProvider : public QgsDataItemProvider
82{
83 public:
84 QString name() override;
85 QString dataProviderKey() const override;
86 Qgis::DataItemProviderCapabilities capabilities() const override;
87
88 QgsDataItem *createDataItem( const QString &path, QgsDataItem *parentItem ) override;
89};
90
92
93#endif // QGSSENSORTHINGSDATAITEMS_H
The Qgis class provides global constants for use throughout the application.
Definition qgis.h:54
QFlags< DataItemProviderCapability > DataItemProviderCapabilities
Capabilities for data item providers.
Definition qgis.h:926
SensorThingsEntity
OGC SensorThings API entity types.
Definition qgis.h:5564
@ Invalid
An invalid/unknown entity.
BrowserLayerType
Browser item layer types.
Definition qgis.h:935
A Collection that represents a root group of connections from a single data provider.
A Collection: logical collection of layers or subcollections, e.g.
This is the interface for those who want to add custom data items to the browser tree.
Base class for all items in the model.
Definition qgsdataitem.h:46
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).
Item that represents a layer that can be opened with one of the providers.