Logo Search packages:      
Sourcecode: zope-kupu version File versions

interfaces.py

##############################################################################
#
# Copyright (c) 2003-2004 Kupu Contributors. All rights reserved.
#
# This software is distributed under the terms of the Kupu
# License. See LICENSE.txt for license text. For a list of Kupu
# Contributors see CREDITS.txt.
#
##############################################################################
"""Kupu Plone interfaces

$Id: interfaces.py 6772 2004-09-28 11:55:11Z guido $
"""
from Interface import Interface

00016 class ILibraryManager(Interface):
    """Provide an interface for managing and retrieving libraries for
    the Kupu editor.
    """

00021     def getLibraries(context):
        """Return an ordered sequence of libraries.

        Since libraries might be defined placefully, we look them up
        using a context. The return value is provided as a sequence of
        dictionaries with the following keys:

          id    - the computed id
          title - the computed title of the library
          uri   - the computed URI of the library
          src   - the computed source URI
          icon  - the computed icon URI
        """

00035     def addLibrary(id, title, uri, src, icon):
        """Add a library.
        """

00039     def deleteLibraries(indices):
        """Delete libraries
        """

00043     def updateLibraries(libraries):
        """Update libraries.

        Update libraries using the sequence of mapping objects
        provided in the 'libraries' parameter. Each mapping object
        needs to provide an 'index' key to indicate which library it
        is updating.
        """

00052     def moveUp(indices):
        """Reorder libraries by moving specified libraries up.
        """

00056     def moveDown(indices):
        """Reorder libraries by moving specified libraries down.
        """

00060 class IResourceTypeMapper(Interface):
    """Map portal types to resource types"""

00063     def getPortalTypesForResourceType(resource_type):
        """Return a sequence of portal types for a specific resource type.

        Raises KeyError if resource_type is not found.
        """

00069     def queryPortalTypesForResourceType(resource_type, default=None):
        """Return a sequence of portal types for a specific resource type.

        Returns 'default' if resource_type is not found.
        """

00075     def addResourceType(resource_type, portal_types):
        """Add a resource type pointing to a sequence of portal_types."""

00078     def updateResourceTypes(type_mapping):
        """Update resource types using the type mapping passed as argument."""

00081     def deleteResourceTypes(resource_types):
        """Delete the type mapping for the specififed resource types

        Raises KeyError if one of the resource_types is not found.
        """

00087 class IKupuLibraryTool(ILibraryManager, IResourceTypeMapper):
    """Interface for the Kupu library tool"""

Generated by  Doxygen 1.6.0   Back to index