forked from qt-creator/qt-creator
Doc: Fix IPlugin class docs
Fix \fn command values and document missing enum and arguments. Remove unnecessary \fn commands, so that the signatures don't need to be maintained. Fix formatting and language issues. Task-number: QTCREATORBUG-23544 Change-Id: Iddddb704a51e7a4fa9ac79fa2d4a89aa6abeefd5 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -55,7 +55,8 @@ depends += qtwidgets \
|
|||||||
qtsensors \
|
qtsensors \
|
||||||
qtuitools \
|
qtuitools \
|
||||||
qtwebkit \
|
qtwebkit \
|
||||||
qtxml
|
qtxml \
|
||||||
|
qttestlib
|
||||||
|
|
||||||
include(macros.qdocconf)
|
include(macros.qdocconf)
|
||||||
include(qt-cpp-ignore.qdocconf)
|
include(qt-cpp-ignore.qdocconf)
|
||||||
|
@@ -30,22 +30,20 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class ExtensionSystem::IPlugin
|
\class ExtensionSystem::IPlugin
|
||||||
\mainclass
|
\ingroup mainclasses
|
||||||
\brief The IPlugin class is the base class for all plugins.
|
\brief The IPlugin class is the base class for all plugins.
|
||||||
|
|
||||||
The IPlugin class is an abstract class that must be implemented
|
The IPlugin class is an abstract class that must be implemented
|
||||||
once for each plugin.
|
once for each plugin.
|
||||||
A plugin consists of two parts: A description file, and a library
|
A plugin consists of two parts: a description file, and a library
|
||||||
that at least contains the IPlugin implementation.
|
that at least contains the IPlugin implementation.
|
||||||
|
|
||||||
\tableofcontents
|
|
||||||
|
|
||||||
\section1 Plugin Specification
|
\section1 Plugin Specification
|
||||||
|
|
||||||
A plugin needs to provide a plugin specification file in addition
|
A plugin needs to provide a plugin specification file in addition
|
||||||
to the actual plugin library, so the plugin manager can find the plugin,
|
to the actual plugin library, so the plugin manager can find the plugin,
|
||||||
resolve its dependencies, and load it. For more information,
|
resolve its dependencies, and load it. For more information,
|
||||||
see \l{Plugin Specifications}.
|
see \l{Plugin Meta Data}.
|
||||||
|
|
||||||
\section1 Plugin Implementation
|
\section1 Plugin Implementation
|
||||||
Plugins must provide one implementation of the IPlugin class, located
|
Plugins must provide one implementation of the IPlugin class, located
|
||||||
@@ -65,7 +63,7 @@
|
|||||||
needed by other plugins and register them via appropriate core functions
|
needed by other plugins and register them via appropriate core functions
|
||||||
or, if a weak dependency is neceessary to be implemented, to put
|
or, if a weak dependency is neceessary to be implemented, to put
|
||||||
them into the global object pool.
|
them into the global object pool.
|
||||||
\li All plugins' extensionsInitialized functions are called in \e{leaf-to-root}
|
\li All plugins' extensionsInitialized() functions are called in \e{leaf-to-root}
|
||||||
order of the dependency tree. At this point, plugins can
|
order of the dependency tree. At this point, plugins can
|
||||||
be sure that all plugins that depend on this plugin have
|
be sure that all plugins that depend on this plugin have
|
||||||
been initialized completely and objects these plugins wish to
|
been initialized completely and objects these plugins wish to
|
||||||
@@ -75,17 +73,31 @@
|
|||||||
that depend on that plugin also fail.
|
that depend on that plugin also fail.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\enum IPlugin::ShutdownFlag
|
||||||
|
|
||||||
|
This enum type holds whether the plugin is shut down synchronously or
|
||||||
|
asynchronously.
|
||||||
|
|
||||||
|
\value SynchronousShutdown
|
||||||
|
The plugin is shut down synchronously.
|
||||||
|
\value AsynchronousShutdown
|
||||||
|
The plugin needs to perform asynchronous
|
||||||
|
actions before it shuts down.
|
||||||
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool IPlugin::initialize(const QStringList &arguments, QString *errorString)
|
\fn bool IPlugin::initialize(const QStringList &arguments, QString *errorString)
|
||||||
\brief Called after the plugin has been loaded and the IPlugin instance
|
Called after the plugin has been loaded and the IPlugin instance
|
||||||
has been created.
|
has been created.
|
||||||
|
|
||||||
The initialize functions of plugins that depend
|
The initialize functions of plugins that depend on this plugin are called
|
||||||
on this plugin are called after the initialize function of this plugin
|
after the initialize function of this plugin has been called with
|
||||||
has been called. Plugins should initialize their internal state in this
|
\a arguments. Plugins should initialize their internal state in this
|
||||||
function. Returns if initialization of successful. If it wasn't successful,
|
function.
|
||||||
the \a errorString should be set to a user-readable message
|
|
||||||
describing the reason.
|
Returns whether initialization succeeds. If it does not, \a errorString
|
||||||
|
should be set to a user-readable message describing the reason.
|
||||||
|
|
||||||
\sa extensionsInitialized()
|
\sa extensionsInitialized()
|
||||||
\sa delayedInitialize()
|
\sa delayedInitialize()
|
||||||
@@ -93,12 +105,12 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void IPlugin::extensionsInitialized()
|
\fn void IPlugin::extensionsInitialized()
|
||||||
\brief Called after the IPlugin::initialize() function has been called,
|
Called after the initialize() function has been called,
|
||||||
and after both the IPlugin::initialize() and IPlugin::extensionsInitialized()
|
and after both the initialize() and \c extensionsInitialized()
|
||||||
functions of plugins that depend on this plugin have been called.
|
functions of plugins that depend on this plugin have been called.
|
||||||
|
|
||||||
In this function, the plugin can assume that plugins that depend on
|
In this function, the plugin can assume that plugins that depend on
|
||||||
this plugin are fully 'up and running'. It is a good place to
|
this plugin are fully \e {up and running}. It is a good place to
|
||||||
look in the global object pool for objects that have been provided
|
look in the global object pool for objects that have been provided
|
||||||
by weakly dependent plugins.
|
by weakly dependent plugins.
|
||||||
|
|
||||||
@@ -108,19 +120,21 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool IPlugin::delayedInitialize()
|
\fn bool IPlugin::delayedInitialize()
|
||||||
\brief Called after all plugins' IPlugin::extensionsInitialized() function has been called,
|
Called after all plugins' extensionsInitialized() function has been called,
|
||||||
and after the IPlugin::delayedInitialize() function of plugins that depend on this plugin
|
and after the \c delayedInitialize() function of plugins that depend on this
|
||||||
have been called.
|
plugin have been called.
|
||||||
|
|
||||||
The plugins' delayedInitialize() functions are called after the application is already running,
|
The plugins' \c delayedInitialize() functions are called after the
|
||||||
with a few milliseconds delay to application startup, and between individual delayedInitialize
|
application is already running, with a few milliseconds delay to
|
||||||
function calls. To avoid unnecessary delays, a plugin should return true from the function if it
|
application startup, and between individual \c delayedInitialize()
|
||||||
actually implements it, to indicate that the next plugins' delayedInitialize() call should
|
function calls. To avoid unnecessary delays, a plugin should return
|
||||||
be delayed a few milliseconds to give input and paint events a chance to be processed.
|
\c true from the function if it actually implements it, to indicate
|
||||||
|
that the next plugins' \c delayedInitialize() call should be delayed
|
||||||
|
a few milliseconds to give input and paint events a chance to be processed.
|
||||||
|
|
||||||
This function can be used if a plugin needs to do non-trivial setup that doesn't
|
This function can be used if a plugin needs to do non-trivial setup that doesn't
|
||||||
necessarily need to be done directly at startup, but still should be done within a
|
necessarily need to be done directly at startup, but still should be done within a
|
||||||
short time afterwards. This can decrease the felt plugin/application startup
|
short time afterwards. This can decrease the perceived plugin or application startup
|
||||||
time a lot, with very little effort.
|
time a lot, with very little effort.
|
||||||
|
|
||||||
\sa initialize()
|
\sa initialize()
|
||||||
@@ -129,7 +143,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn IPlugin::ShutdownFlag IPlugin::aboutToShutdown()
|
\fn IPlugin::ShutdownFlag IPlugin::aboutToShutdown()
|
||||||
\brief Called during a shutdown sequence in the same order as initialization
|
Called during a shutdown sequence in the same order as initialization
|
||||||
before the plugins get deleted in reverse order.
|
before the plugins get deleted in reverse order.
|
||||||
|
|
||||||
This function should be used to disconnect from other plugins,
|
This function should be used to disconnect from other plugins,
|
||||||
@@ -138,34 +152,44 @@
|
|||||||
it needs to wait for external processes to finish for a clean shutdown,
|
it needs to wait for external processes to finish for a clean shutdown,
|
||||||
the plugin can return IPlugin::AsynchronousShutdown from this function. This
|
the plugin can return IPlugin::AsynchronousShutdown from this function. This
|
||||||
will keep the main event loop running after the aboutToShutdown() sequence
|
will keep the main event loop running after the aboutToShutdown() sequence
|
||||||
has finished, until all plugins requesting AsynchronousShutdown have sent
|
has finished, until all plugins requesting asynchronous shutdown have sent
|
||||||
the asynchronousShutdownFinished() signal.
|
the asynchronousShutdownFinished() signal.
|
||||||
|
|
||||||
The default implementation of this function does nothing and returns
|
The default implementation of this function does nothing and returns
|
||||||
IPlugin::SynchronousShutdown.
|
IPlugin::SynchronousShutdown.
|
||||||
|
|
||||||
Returns IPlugin::AsynchronousShutdown if the plugin needs to perform
|
Returns IPlugin::AsynchronousShutdown if the plugin needs to perform
|
||||||
asynchronous actions before performing the shutdown.
|
asynchronous actions before shutdown.
|
||||||
|
|
||||||
\sa asynchronousShutdownFinished()
|
\sa asynchronousShutdownFinished()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn QObject *IPlugin::remoteCommand(const QStringList &options, const QStringList &arguments)
|
\fn QObject *IPlugin::remoteCommand(const QStringList &options,
|
||||||
\brief When \QC is executed with the -client argument while already another instance of \QC
|
const QString &workingDirectory,
|
||||||
is running, this function of plugins is called in the running instance.
|
const QStringList &arguments)
|
||||||
|
|
||||||
|
When \QC is executed with the \c -client argument while another \QC instance
|
||||||
|
is running, this function of the plugin is called in the running instance.
|
||||||
|
|
||||||
|
The \a workingDirectory argument specifies the working directory of the
|
||||||
|
calling process. For example, if you're in a directory, and you execute
|
||||||
|
\c { qtcreator -client file.cpp}, the working directory of the calling
|
||||||
|
process is passed to the running instance and \c {file.cpp} is transformed
|
||||||
|
into an absolute path starting from this directory.
|
||||||
|
|
||||||
Plugin-specific arguments are passed in \a options, while the rest of the
|
Plugin-specific arguments are passed in \a options, while the rest of the
|
||||||
arguments are passed in \a arguments.
|
arguments are passed in \a arguments.
|
||||||
|
|
||||||
\returns a QObject that blocks the command until it is destroyed, if -block is used.
|
Returns a QObject that blocks the command until it is destroyed, if \c -block
|
||||||
|
is used.
|
||||||
|
|
||||||
\sa PluginManager::serializedArguments()
|
\sa PluginManager::serializedArguments()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void IPlugin::asynchronousShutdownFinished()
|
\fn void IPlugin::asynchronousShutdownFinished()
|
||||||
Sent by the plugin implementation after a asynchronous shutdown
|
Sent by the plugin implementation after an asynchronous shutdown
|
||||||
is ready to proceed with the shutdown sequence.
|
is ready to proceed with the shutdown sequence.
|
||||||
|
|
||||||
\sa aboutToShutdown()
|
\sa aboutToShutdown()
|
||||||
@@ -174,7 +198,6 @@
|
|||||||
using namespace ExtensionSystem;
|
using namespace ExtensionSystem;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn IPlugin::IPlugin()
|
|
||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
IPlugin::IPlugin()
|
IPlugin::IPlugin()
|
||||||
@@ -183,7 +206,6 @@ IPlugin::IPlugin()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn IPlugin::~IPlugin()
|
|
||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
IPlugin::~IPlugin()
|
IPlugin::~IPlugin()
|
||||||
@@ -193,11 +215,10 @@ IPlugin::~IPlugin()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn QVector<QObject *> IPlugin::createTestObjects() const
|
Returns objects that are meant to be passed on to \l QTest::qExec().
|
||||||
|
|
||||||
Returns objects that are meant to be passed on to QTest::qExec().
|
This function will be called if the user starts \QC with
|
||||||
|
\c {-test PluginName} or \c {-test all}.
|
||||||
This function will be called if the user starts \QC with '-test PluginName' or '-test all'.
|
|
||||||
|
|
||||||
The ownership of returned objects is transferred to caller.
|
The ownership of returned objects is transferred to caller.
|
||||||
*/
|
*/
|
||||||
@@ -207,7 +228,6 @@ QVector<QObject *> IPlugin::createTestObjects() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn PluginSpec *IPlugin::pluginSpec() const
|
|
||||||
Returns the PluginSpec corresponding to this plugin.
|
Returns the PluginSpec corresponding to this plugin.
|
||||||
This is not available in the constructor.
|
This is not available in the constructor.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user