summaryrefslogtreecommitdiffstats
path: root/src/api.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/api.cpp')
-rw-r--r--src/api.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/api.cpp b/src/api.cpp
new file mode 100644
index 00000000..8e56da3d
--- /dev/null
+++ b/src/api.cpp
@@ -0,0 +1,60 @@
+#include "core.h"
+#include "codemodel.h"
+#include "partcontroller.h"
+#include "plugincontroller.h"
+#include "toplevel.h"
+#include "api.h"
+
+
+API *API::s_instance = 0;
+
+
+KDevMainWindow *API::mainWindow() const
+{
+ return TopLevel::getInstance();
+}
+
+KDevPartController *API::partController() const
+{
+ return PartController::getInstance();
+}
+
+
+KDevCore *API::core() const
+{
+ return Core::getInstance();
+}
+
+
+CodeModel *API::codeModel() const
+{
+ return m_classStore;
+}
+
+
+API *API::getInstance()
+{
+ if (!s_instance)
+ s_instance = new API;
+ return s_instance;
+}
+
+
+API::API()
+ : KDevApi()
+{
+ m_classStore = new CodeModel();
+}
+
+
+API::~API()
+{
+ delete( m_classStore );
+ m_classStore = 0;
+}
+
+KDevPluginController * API::pluginController() const
+{
+ return PluginController::getInstance();
+}
+