KPart Plugins Kit

Introduction

KParts are embedded components that applications in KDE can use to provide viewing and editing services. The use of components reduces the time spent by developers when designing applications and saves time otherwise spent reinventing existing features and technologies. The result is a more productive development environment, and a more consistent user experience.

The KParts framework encompasses a variety of forms for such components, from simple plugins to fully featured editors. Indeed, some of the most powerful widgets used in KDE are available in the form of KParts, making the construction of custom applications much more accessible to a wide range of programmers.

Applications written in Python using the PyKDE libraries have been able to import KParts for some time. This framework allows Python to be used to create KParts plugins for use with any application which provides suitable support for them.

Requirements

A working KPart plugin needs the following resources:

Plugins may also employ the following optional resource:

Additionally, a Python plugin requires a place to store the Python source code and possibly storage for any packages which are not situated in the Python library directory.

Examples

The following examples are supplied with the KPart Plugins Kit:

PyValidator

A Python version of the W3C validator example found on the developer.kde.org web site.

This could be improved by adding features which allow the browser's interface to be updated when the W3C site is visited.

Highlighter

This example allows the user to quickly highlight a given keyword or phrase in the HTML document currently being displayed in Konqueror. Issues such as Document Object Model (DOM) traversal and manipulation are explored as text in the document is modified and restyled.

Images/highlighterdialog.png

The highlighter dialog window