from zope.interface import Interface
from zope.app.annotation.interfaces import IAnnotatable

class IUndeleteContainer(Interface):
    """A marker interface indicating hat a container supports undeleting its
       contents."""

class IUndeleteSupport(IAnnotatable):
    """An interface for containers which are capable of undeleting objects."""

    def undelete(uid):
        """Undeletes the object corresponding to the given unique id."""

    def saveObjectInfo(obj):
        """Saves information about how to restore an object before it is
           deleted."""

    def listDeleted():
        """Returns a sequence of mappings with info about deleted objects.
           Expected keys are: id, title, user, date, revision, uid.  'user'
           is the user who deleted the object and 'date' is the date of the
           deletion."""

    def getMetadataFor(uid):
       """Returns a single mapping with info a bout a particular deleted
          object determined by the given uid.  The metadata returned is the
          same as the above method."""


class ICanBeUndeleted(Interface):
    """A marker interface indicating that an object supports being undeleted.
       Technically such an object needs to provide some sort of UID and
       support versioning, but this is not the place to define such
       constraints.
    """