1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
|
/*
SPDX-FileCopyrightText: 2007 Alexander Dymo <adymo@kdevelop.org>
SPDX-FileCopyrightText: 2007 Kris Wong <kris.p.wong@gmail.com>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef KDEVPLATFORM_ICORE_H
#define KDEVPLATFORM_ICORE_H
#include <QObject>
#include "interfacesexport.h"
#include "isessionlock.h"
/**
* The KDevelop namespace contains all classes provided by the KDevelop
* platform libraries.
*/
namespace KDevelop
{
class IUiController;
class IPluginController;
class IProjectController;
class ILanguageController;
class IDocumentController;
class ISessionController;
class IRunController;
class ISourceFormatterController;
class ISession;
class ISelectionController;
class IDocumentationController;
class IDebugController;
class IPartController;
class IDashboardController;
class ITestController;
class IRuntimeController;
/**
* ICore is the container class for all the various objects in use by
* KDevelop. If access is needed to a particular controller, then this class
* should be used.
*
* ICore can provide the user with instances of the following things:
* - the main window(s)
* - the document controller(s)
* - the plugin controller
* - the project controller
* - the language controller
* - the KPart manager
*
* When an object is provided to ICore so it can be used later, ICore
* will take ownership of the object and upon application shutdown will take
* responsibility for deleting the objects stored by ICore.
*/
class KDEVPLATFORMINTERFACES_EXPORT ICore: public QObject
{
Q_OBJECT
Q_PROPERTY(KDevelop::IProjectController* projectController READ projectController)
public:
~ICore() override;
/** @return the static ICore instance */
static ICore *self();
/** @return ui controller */
virtual KDevelop::IUiController *uiController() = 0;
/** @return plugin controller */
virtual KDevelop::IPluginController *pluginController() = 0;
/** @return project controller */
virtual KDevelop::IProjectController *projectController() = 0;
/** @return language controller */
virtual KDevelop::ILanguageController *languageController() = 0;
/** @return part manager */
virtual KDevelop::IPartController *partController() = 0;
/** @return document controller */
virtual KDevelop::IDocumentController *documentController() = 0;
/** @return run controller */
virtual KDevelop::IRunController *runController() = 0;
/** @return the active session */
virtual KDevelop::ISession *activeSession() = 0;
/** @return the session lock for the active session */
virtual KDevelop::ISessionLock::Ptr activeSessionLock() = 0;
/** @return the active session's temporary directory path */
virtual QString sessionTemporaryDirectoryPath() const = 0;
/** @return the sourceformatter controller */
virtual KDevelop::ISourceFormatterController *sourceFormatterController() = 0;
/** @return the selection controller */
virtual KDevelop::ISelectionController* selectionController() = 0;
/** @return the documentation controller */
virtual KDevelop::IDocumentationController* documentationController() = 0;
/** @return the debug controller */
virtual KDevelop::IDebugController* debugController() = 0;
/** @return the test controller */
virtual KDevelop::ITestController* testController() = 0;
/** @return the runtime controller */
Q_SCRIPTABLE virtual KDevelop::IRuntimeController* runtimeController() = 0;
/** @return true if the application is currently being shut down */
virtual bool shuttingDown() const = 0;
Q_SIGNALS:
/** Emitted when the initialization of the core components has been completed */
void initializationCompleted();
/**
* Emitted immediately before tearing down the session and UI. Useful when performing any last minute
* preparations such as saving settings.
*/
void aboutToShutdown();
/**
* Emitted when the teardown of the core components has been completed.
*/
void shutdownCompleted();
protected:
explicit ICore(QObject *parent = nullptr);
static ICore *m_self;
};
}
#endif
|