1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVTOOLS_SOURCE_GRAPHIC_DESCRIPTOR_HXX
21 #define INCLUDED_SVTOOLS_SOURCE_GRAPHIC_DESCRIPTOR_HXX
23 #include <comphelper/propertysethelper.hxx>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <comphelper/propertysetinfo.hxx>
27 #include <vcl/graph.hxx>
29 #define MIMETYPE_BMP "image/x-MS-bmp"
30 #define MIMETYPE_GIF "image/gif"
31 #define MIMETYPE_JPG "image/jpeg"
32 #define MIMETYPE_PCD "image/x-photo-cd"
33 #define MIMETYPE_PCX "image/x-pcx"
34 #define MIMETYPE_PNG "image/png"
35 #define MIMETYPE_TIF "image/tiff"
36 #define MIMETYPE_XBM "image/x-xbitmap"
37 #define MIMETYPE_XPM "image/x-xpixmap"
38 #define MIMETYPE_PBM "image/x-portable-bitmap"
39 #define MIMETYPE_PGM "image/x-portable-graymap"
40 #define MIMETYPE_PPM "image/x-portable-pixmap"
41 #define MIMETYPE_RAS "image/x-cmu-raster"
42 #define MIMETYPE_TGA "image/x-targa"
43 #define MIMETYPE_PSD "image/vnd.adobe.photoshop"
44 #define MIMETYPE_EPS "image/x-eps"
45 #define MIMETYPE_DXF "image/vnd.dxf"
46 #define MIMETYPE_MET "image/x-met"
47 #define MIMETYPE_PCT "image/x-pict"
48 #define MIMETYPE_SGF "image/x-sgf"
49 #define MIMETYPE_SVM "image/x-svm"
50 #define MIMETYPE_WMF "image/x-wmf"
51 #define MIMETYPE_SGV "image/x-sgv"
52 #define MIMETYPE_EMF "image/x-emf"
53 #define MIMETYPE_SVG "image/svg+xml"
54 #define MIMETYPE_VCLGRAPHIC "image/x-vclgraphic"
56 namespace comphelper
{ class PropertySetInfo
; }
57 namespace com
{ namespace sun
{ namespace star
{ namespace io
{ class XInputStream
; } } } }
61 namespace unographic
{
63 class GraphicDescriptor
: public ::cppu::OWeakAggObject
,
64 public ::com::sun::star::lang::XServiceInfo
,
65 public ::com::sun::star::lang::XTypeProvider
,
66 public ::comphelper::PropertySetHelper
71 virtual ~GraphicDescriptor() throw();
73 void init( const ::Graphic
& rGraphic
);
74 void init( const OUString
& rURL
);
75 void init( const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
>& rxIStm
, const OUString
& rURL
);
77 static OUString
getImplementationName_Static() throw();
78 static ::com::sun::star::uno::Sequence
< OUString
> getSupportedServiceNames_Static() throw();
82 static ::comphelper::PropertySetInfo
* createPropertySetInfo();
85 virtual ::com::sun::star::uno::Any SAL_CALL
queryAggregation( const ::com::sun::star::uno::Type
& rType
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
86 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& rType
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
87 virtual void SAL_CALL
acquire() throw() SAL_OVERRIDE
;
88 virtual void SAL_CALL
release() throw() SAL_OVERRIDE
;
91 virtual OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
92 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
93 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
96 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
97 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
100 virtual void _setPropertyValues( const comphelper::PropertyMapEntry
** ppEntries
, const ::com::sun::star::uno::Any
* pValues
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
) SAL_OVERRIDE
;
101 virtual void _getPropertyValues( const comphelper::PropertyMapEntry
** ppEntries
, ::com::sun::star::uno::Any
* pValue
) throw (css::beans::UnknownPropertyException
, css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
105 const ::Graphic
* mpGraphic
;
110 sal_uInt16 mnBitsPerPixel
;
115 GraphicDescriptor( const GraphicDescriptor
& rDescriptor
) SAL_DELETED_FUNCTION
;
117 GraphicDescriptor
& operator=( const GraphicDescriptor
& ) SAL_DELETED_FUNCTION
;
119 void implCreate( SvStream
& rIStm
, const OUString
* pPath
);
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */