Plasma5Support

dataengineconsumer.h
1/*
2 SPDX-FileCopyrightText: 2012 Aaron Seigo <aseigo@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef PLASMA_DATAENGINECONSUMER_H
8#define PLASMA_DATAENGINECONSUMER_H
9
10#include <QUrl>
11
12#include <plasma5support/plasma5support_export.h>
13
14namespace Plasma5Support
15{
16class DataEngine;
17class DataEngineConsumerPrivate;
18
19/**
20 * @class DataEngineConsumer plasma5support/dataengineconsumer.h <Plasma/DataEngineConsumer>
21 *
22 * @brief A class that makes it safe and easy to use DataEngines
23 *
24 * DataEngineConsumer provides access to DataEngines, which are internally reference
25 * counted and shared between all users of them. The only public method provided is
26 * dataEngine which returns engines upon request.
27 *
28 * When the DataEngineConsumer class is deleted, all engines accessed using it are
29 * de-referenced and possibly deleted (in the case that there are no other users of
30 * the engine in question).
31 *
32 * DataEngineConsumer can be subclassed by other C++ classes to allow this simple
33 * API to be used directly from these classes in a convenient manner.
34 **/
35class PLASMA5SUPPORT_EXPORT DataEngineConsumer
36{
37public:
38 /**
39 * Constructs a DataEngineConsumer
40 **/
43
44 /**
45 * Returns a Plasma5Support::DataEngine. It never returns a null pointer, and the
46 * DataEngine returned should not be deleted. All DataEngines will be dereferenced
47 * once this DataEngineConsumer instance is deleted.
48 *
49 * It is safe and fast to request the same engine more than once.
50 *
51 * @param name the name of the DataEngine. This corresponds to the plugin name
52 * of the DataEngine.
53 */
54 DataEngine *dataEngine(const QString &name);
55
56private:
57 DataEngineConsumerPrivate *const d;
58};
59
60} // namespace Plasma5Support
61
62#endif
A class that makes it safe and easy to use DataEngines.
Data provider for plasmoids (Plasma plugins)
Definition dataengine.h:45
Namespace for everything in libplasma.
Definition datamodel.cpp:15
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.