##############################################################################
#
# Copyright (c) 2002 Ingeniweb SARL
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################

"""
AttachmentField product
"""

import AttachmentHandler

import os
import os.path
import string
import re
import sys

if sys.platform == "win32":
    program = "ppthtml.exe"
else:
    program = "ppthtml"


class MSPowerpointAttachment(AttachmentHandler.AbstractHandler):
    """
    MSPowerpointAttachment file abstraction
    """
    icon_file = "powerpoint.gif"
    small_icon_file = "powerpoint_small.gif"
    content_types = ('application/powerpoint', 'application/mspowerpoint', 'application/x-powerpoint', 'application/x-mspowerpoint', 'application/vnd.ms-powerpoint', )
    converter_type = "MSPowerpoint"

    index_path = program
    index_arguments = r"%s"
    index_encoding = ("CP1252", "utf8", )
    
    preview_path = program
    preview_arguments = r"%s"
    preview_encoding = ("CP1252", "utf8", )
    preview_format = "html"


AttachmentHandler.registerHandler(MSPowerpointAttachment)
