IUiController
From KDevelop
UiController is closely connected to the Sublime UI and basically is an subclass of Sublime::Controller which is explained in Sublime UI.
The main job of UiController is to allow plugins to manager their views and toolviews. Currently only toolviews can be added and removed.
Sublime UI wants plugins to add and remove not actual toolviews, but factories to create them. This is because user can request from Sublime UI to show a new toolview at any time. For example, it is possible to have more than one Konsole toolviews. The user just have to ask for them. Automatically factory will be used only once, when UI controller is asked to add a toolview. +This means for example that only one Konsole toolview will be opened automatically.
To create a factory, a plugin needs to subclass KDevelop::IToolViewFactory and implement two methods:
- virtual QWidget* create(QWidget *parent = 0)
- where the actual toolview widget will be created
- virtual Qt::DockWidgetArea defaultPosition(const QString &areaName)
- which will give the UI a hint on where to place the toolview
Once the factory is ready, it has to be added to the UiController using IUiController::addToolView() method. It is not absolutely necessary for a plugin to remove or delete toolview factory. UiController will delete them all upon unload.
NOTE: temporarily, IUiController has openUrl() method which is the only way to open files in KDevelop until DocumentController is ported.