try:
    # older versions of zope.schema do not support defaultFactory
    schema.Int(title=u"", defaultFactory=lambda x: 5)
    SUPPORT_DEFAULT_FACTORY = True
except TypeError:
    SUPPORT_DEFAULT_FACTORY = False


class ILayer(Interface):
    """
    layer class
    """

FILE_TYPES_VOCAB = []

for id, doc in CONVERTABLE_TYPES.items():
    FILE_TYPES_VOCAB.append(SimpleTerm(id, id, doc.name))


class IGlobalDocumentViewerSettings(Interface):
    large_size = schema.Int(
        title=_("Large Image Size"),
        default=1000)
    normal_size = schema.Int(
        title=_("Normal Image Size"),
        default=700)
    thumb_size = schema.Int(
        title=_("Thumb Image Size"),
        default=180)
    storage_type = schema.Choice(
        title=_("Storage Type"),
try:
    # older versions of zope.schema do not support defaultFactory
    schema.Int(title=u"", defaultFactory=lambda x: 5)
    SUPPORT_DEFAULT_FACTORY = True
except TypeError:
    SUPPORT_DEFAULT_FACTORY = False


class ILayer(Interface):
    """
    layer class
    """

FILE_TYPES_VOCAB = []

for type_id, doc in CONVERTABLE_TYPES.items():
    FILE_TYPES_VOCAB.append(SimpleTerm(type_id, type_id, doc.name))


class IGlobalDocumentViewerSettings(Interface):
    large_size = schema.Int(
        title=_("Large Image Size"),
        default=1000)
    normal_size = schema.Int(
        title=_("Normal Image Size"),
        default=700)
    thumb_size = schema.Int(
        title=_("Thumb Image Size"),
        default=180)
    storage_type = schema.Choice(
        title=_("Storage Type"),
    from plone.app.contenttypes.interfaces import IFile

    class IPACPossibleDocumentViewerMarker(IFile):
        pass
except ImportError:
    pass


class ILayer(Interface):
    """
    layer class
    """

FILE_TYPES_VOCAB = []

for type_id, doc in CONVERTABLE_TYPES.items():
    FILE_TYPES_VOCAB.append(SimpleTerm(type_id, type_id, doc.name))


class IGlobalDocumentViewerSettings(Interface):
    large_size = schema.Int(
        title=_("Large Image Size"),
        default=1000)
    normal_size = schema.Int(
        title=_("Normal Image Size"),
        default=700)
    thumb_size = schema.Int(
        title=_("Thumb Image Size"),
        default=180)
    storage_type = schema.Choice(
        title=_("Storage Type"),
from zope.interface import Attribute
from zope import schema
from zope.component.interfaces import IObjectEvent
from collective.documentviewer.config import CONVERTABLE_TYPES
from OFS.interfaces import IItem


class ILayer(Interface):
    """
    layer class
    """


FILE_TYPES_VOCAB = []

for id, doc in CONVERTABLE_TYPES.items():
    FILE_TYPES_VOCAB.append(SimpleTerm(id, id, doc.name))


class IGlobalDocumentViewerSettings(Interface):
    large_size = schema.Int(title=u"Large Image Size", default=1000)
    normal_size = schema.Int(title=u"Normal Image Size", default=700)
    thumb_size = schema.Int(title=u"Thumb Image Size", default=180)
    storage_type = schema.Choice(
        title=u"Storage Type",
        description=u"Blob storage using the normal ZODB blob mechanism. "
        u"File storage is for just storage the files on the "
        u"file system with no hard reference on write to the "
        u"ZODB. This allows you to easily push the files to "
        u"be served off-site.",
        default='Blob',