QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 QString &entityUri );
56 bool equal( const QgsDataItem *other ) override;
57 QVector<QgsDataItem *> createChildren() override;
58 private:
59 QString mEntityUri;
60};
61
62
63class CORE_EXPORT QgsSensorThingsLayerEntityItem : public QgsLayerItem
64{
65 Q_OBJECT
66 public:
67 QgsSensorThingsLayerEntityItem( QgsDataItem *parent, QString name, QString path, const QString &encodedUri, const QString &provider, Qgis::BrowserLayerType type );
68
69};
70
72class QgsSensorThingsDataItemProvider : public QgsDataItemProvider
73{
74 public:
75 QString name() override;
76 QString dataProviderKey() const override;
77 Qgis::DataItemProviderCapabilities capabilities() const override;
78
79 QgsDataItem *createDataItem( const QString &path, QgsDataItem *parentItem ) override;
80};
81
83
84#endif // QGSSENSORTHINGSDATAITEMS_H
BrowserLayerType
Browser item layer types.
Definition qgis.h:736
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.
virtual QString dataProviderKey() const
Returns the data provider key (if the data item provider is associated with a data provider),...
virtual QString name()=0
Human-readable name of the provider name.
virtual QgsDataItem * createDataItem(const QString &path, QgsDataItem *parentItem)=0
Create a new instance of QgsDataItem (or nullptr) for given path and parent item.
virtual Qgis::DataItemProviderCapabilities capabilities() const =0
Returns combination of flags from QgsDataProvider::DataCapabilities.
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.
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.