QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgsdataitemprovider.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsdataitemprovider.h
3 --------------------------------------
4 Date : March 2015
5 Copyright : (C) 2015 by Martin Dobias
6 Email : wonder dot sk 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 QGSDATAITEMPROVIDER_H
17#define QGSDATAITEMPROVIDER_H
18
19#include "qgis_core.h"
20#include "qgis_sip.h"
21#include "qgis.h"
22#include <QString>
23#include <QVector>
24
25class QgsDataItem;
26
28typedef bool handlesDirectoryPath_t( const QString &path ) SIP_SKIP;
29
30
44class CORE_EXPORT QgsDataItemProvider
45{
46 public:
47 virtual ~QgsDataItemProvider() = default;
48
50 virtual QString name() = 0;
51
58 virtual QString dataProviderKey() const { return QString(); };
59
62
67 virtual QgsDataItem *createDataItem( const QString &path, QgsDataItem *parentItem ) = 0 SIP_FACTORY;
68
73 virtual QVector<QgsDataItem *> createDataItems( const QString &path, QgsDataItem *parentItem );
74
85 virtual bool handlesDirectoryPath( const QString &path );
86};
87
88#endif // QGSDATAITEMPROVIDER_H
QFlags< DataItemProviderCapability > DataItemProviderCapabilities
Capabilities for data item providers.
Definition: qgis.h:727
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 ~QgsDataItemProvider()=default
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
QString path() const
Definition: qgsdataitem.h:348
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_FACTORY
Definition: qgis_sip.h:76
bool handlesDirectoryPath_t(const QString &path)
handlesDirectoryPath function