
Config Tool Plugin APIs
=======================

The modules that are described in this section define the APIs to
which plugins to the Config Tool can provide concrete implementations.


Background
----------

Unlike Java, Python does not have an *interface* concept defined in
the language. However the ability to specify interfaces indepenent of
implementation is a very powerful mechanism which provides a cleaner
definition of the published APIs within this application.

The ``zope.interface`` package, which was initially devloped by the
Zope community quite early on in Python's evolution, is still a useful
framework. It defines an abstract **interface** using the standard
Python class, and encourages a few conventions that make it work. The
most important conventions are:

- the class that defines an interface should have a leading ``I`` in
  its name.

- the class that defines the interface must derive from the
  ``zope.interface.Interface`` class.

- abstract method declarations in the interface are defined just
  as Python methods, but the ``self`` parameter must be omitted. The body
  of the method should just have a ``pass`` or, ideally, a docstring
  describing the semantics of this abstract method.

- Abstract attributes of the interface must use the
  ``zope.interface.Attribute`` class to define them. See examples
  below of some of these attributes.


The Zope package provides a framework that enables us to add logic
around interfaces and implementations. For example, we can define a
concrete factory class that will create an instance of this
interface. A concrete implementation of a particular interface should
use the decorator (``@implementer``) to declare to the Zope framework
which interface(s) this class is implementing.

A destinction is made between a "utility" interface, and an "adapter"
interface. This disctinction is important, and should be understood by
reading the documentation on the ``zope.interface`` package.
  

Top Level Utilities
-------------------

.. automodule:: qct_interfaces
    :members:


Persistence of UI State
-----------------------

.. automodule:: qct_interfaces.persist
    :members:


Application Options
-------------------

.. automodule:: qct_interfaces.options
    :members:


Device Configuration Database
-----------------------------

The Config Tool maintains a tree of objects that define what is
visible on the user interface. This tree is tradionally referred to as
the "model" that the user interface interacts with, usually through
"views". In this application the model objects are actually made
*persistent* simply by deriving them from the Zope Database's base
class for persistence: ``persistent.Persistent``.

This interface defines the methods to create and open one of these
persisent object stores.

.. automodule:: qct_interfaces.database
    :members:



Global Events
-------------

.. automodule:: qct_interfaces.events
    :members:
    :show-inheritance:


User Interface
--------------


Themes
~~~~~~

.. automodule:: qct_interfaces.theme
    :members:


Attribute Views
~~~~~~~~~~~~~~~

.. automodule:: qct_interfaces.attributeviews
    :members:
