LibreOffice Module vcl (master)  1
UnoGraphicDescriptor.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_VCL_SOURCE_GRAPHIC_DESCRIPTOR_HXX
21 #define INCLUDED_VCL_SOURCE_GRAPHIC_DESCRIPTOR_HXX
22 
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 
26 #include <cppuhelper/weakagg.hxx>
28 #include <vcl/graph.hxx>
29 
30 #define MIMETYPE_BMP "image/x-MS-bmp"
31 #define MIMETYPE_GIF "image/gif"
32 #define MIMETYPE_JPG "image/jpeg"
33 #define MIMETYPE_PCD "image/x-photo-cd"
34 #define MIMETYPE_PCX "image/x-pcx"
35 #define MIMETYPE_PNG "image/png"
36 #define MIMETYPE_TIF "image/tiff"
37 #define MIMETYPE_XBM "image/x-xbitmap"
38 #define MIMETYPE_XPM "image/x-xpixmap"
39 #define MIMETYPE_PBM "image/x-portable-bitmap"
40 #define MIMETYPE_PGM "image/x-portable-graymap"
41 #define MIMETYPE_PPM "image/x-portable-pixmap"
42 #define MIMETYPE_RAS "image/x-cmu-raster"
43 #define MIMETYPE_TGA "image/x-targa"
44 #define MIMETYPE_PSD "image/vnd.adobe.photoshop"
45 #define MIMETYPE_EPS "image/x-eps"
46 #define MIMETYPE_DXF "image/vnd.dxf"
47 #define MIMETYPE_MET "image/x-met"
48 #define MIMETYPE_PCT "image/x-pict"
49 #define MIMETYPE_SVM "image/x-svm"
50 #define MIMETYPE_WMF "image/x-wmf"
51 #define MIMETYPE_EMF "image/x-emf"
52 #define MIMETYPE_SVG "image/svg+xml"
53 #define MIMETYPE_PDF "application/pdf"
54 #define MIMETYPE_VCLGRAPHIC "image/x-vclgraphic"
55 
56 namespace comphelper { class PropertySetInfo; }
57 namespace com::sun::star::io { class XInputStream; }
58 
59 class Graphic;
60 
61 namespace unographic {
62 
64  public css::lang::XServiceInfo,
65  public css::lang::XTypeProvider,
67 {
68 public:
69 
71  virtual ~GraphicDescriptor() noexcept override;
72 
73  void init( const ::Graphic& rGraphic );
74  void init( const OUString& rURL );
75  void init( const css::uno::Reference< css::io::XInputStream >& rxIStm, const OUString& rURL );
76 
78 
79  // XInterface
80  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
81  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
82  virtual void SAL_CALL acquire() noexcept override;
83  virtual void SAL_CALL release() noexcept override;
84 
85 protected:
86  // XServiceInfo
87  virtual OUString SAL_CALL getImplementationName() override;
88  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
89  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
90 
91  // XTypeProvider
92  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
93  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
94 
95  // PropertySetHelper
96  virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const css::uno::Any* pValues ) override;
97  virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, css::uno::Any* pValue ) override;
98 
99 private:
100 
101  const ::Graphic* mpGraphic;
103  OUString maMimeType;
106  sal_uInt16 mnBitsPerPixel;
108 
109  GraphicDescriptor( const GraphicDescriptor& rDescriptor ) = delete;
110 
111  GraphicDescriptor& operator=( const GraphicDescriptor& ) = delete;
112 
113  void implCreate( SvStream& rIStm, const OUString* pPath );
114 };
115 
116 }
117 
118 #endif
119 
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString SAL_CALL getImplementationName() override
GraphicType
Definition: graph.hxx:34
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual void SAL_CALL release() noexcept override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
GraphicDescriptor & operator=(const GraphicDescriptor &)=delete
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual ~GraphicDescriptor() noexcept override
virtual void _setPropertyValues(const comphelper::PropertyMapEntry **ppEntries, const css::uno::Any *pValues) override
unsigned char sal_Bool
virtual void SAL_CALL acquire() noexcept override
const PropertyValue * pValues
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
void implCreate(SvStream &rIStm, const OUString *pPath)
virtual void _getPropertyValues(const comphelper::PropertyMapEntry **ppEntries, css::uno::Any *pValue) override
void init(const ::Graphic &rGraphic)
static rtl::Reference<::comphelper::PropertySetInfo > createPropertySetInfo()
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override