Namespace for Kate application interfaces.
This namespace contains interfaces for plugin developers for the Kate application.
Configuration objects provide plugin-specific configuration dictionary.
In other words, each plugin uses kate.configuration and the class automatically creates a plugin-specific dictionary to support it.
The config is saved and loaded from disk automatically for minimal user hassle. Just go ahead and use kate.configuration as a persistent dictionary. Do not instantiate your own Configuration object; use kate.configuration instead.
Use a string key. Any Python type that can be pickled is can be used as a value – dictionaries, lists, numbers, strings, sets, and so on.
Decorator that adds an action to the menu bar. When the item is fired, your function is called. Optional shortcuts, menu to place the action in, and icon can be specified.
item label, etc).
shortcut. Must be a string such as ‘Ctrl+1’ or a QKeySequence instance. By default no shortcut is set (by passing None)
alongside text in the menu bar and in toolbars as required. Pass a string to use KDE’s image loading system or a QPixmap or QIcon to use any custom icon. None (the default) sets no icon.
string such as ‘tools’ or ‘settings’, or None to not place it in any menu.
The docstring for your action will be used to provide “help” text.
NOTE: Kate may need to be restarted for this decorator to take effect, or to remove all traces of the plugin on removal.
The document for the currently active view. Throws NoActiveView if no active view available.
The currently active view. Access its KTextEditor.Document by calling document() on it (or by using kate.activeDocument()). This is a shortcut for kate.application.activeMainWindow().activeView()
Global accessor to the application object. Equivalent to Kate::application().
Returns: application object.
Bases: object
Standard error handling for plugin actions.
The central widget that holds the tab bar and the editor. This is a shortcut for kate.application.activeMainWindow().centralWidget()
Decorator that adds a configPage into Kate’s settings dialog. When the item is fired, your function is called.
config pages.
fullName - The title of the configPage when selected.
to use KDE’s image loading system or a QPixmap or QIcon to use any custom icon.
NOTE: Kate may need to be restarted for this decorator to take effect, or to remove all traces of the plugin on removal.
Configuration for this plugin.
Global accessor to the document manager object. Equivalent to Kate::documentManager().
Returns: document manager object.
Configuration for all plugins.
This can also be used by one plugin to access another plugin’s configurations.
The function will be called when Kate has loaded completely: when all other enabled plugins have been loaded into memory, the configuration has been initiated, etc.
The interface to the main window currently showing. Calling window() on the interface window gives you the actual QWidget-derived main window, which is what the mainWindow() function returns
The QWidget-derived main Kate window currently showing. A shortcut around kate.application.activeMainWindow().window().
The Kate API differentiates between the interface main window and the actual widget main window. If you need to access the Kate.MainWindow for the methods it provides (e.g createToolView), then use the mainInterfaceWindow function
Return a list of each module function decorated with @action.
The returned object is [ { function, ( text, icon, shortcut, menu), help }... ].
Return a list of each module function decorated with @configPage.
The returned object is [ { function, callable, ( name, fullName, icon ) }... ].
Test whether an object is alive; that is, whether the pointer to the object still exists.
The function will be called when Pate is being unloaded from memory. Clean up any widgets that you have added to the interface (toolviews etc).
Useful widgets
Bases: PyQt4.QtCore.QTimer
Bases: PyQt4.QtGui.QLabel
Bases: PyQt4.QtGui.QFrame
Bases: PyQt4.QtGui.QFrame
Utility function to set the background color of a QWidget