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
28#include <vcl/graph.hxx>
29
30inline constexpr OUStringLiteral MIMETYPE_BMP = u"image/x-MS-bmp";
31inline constexpr OUStringLiteral MIMETYPE_GIF = u"image/gif";
32inline constexpr OUStringLiteral MIMETYPE_JPG = u"image/jpeg";
33inline constexpr OUStringLiteral MIMETYPE_PCD = u"image/x-photo-cd";
34inline constexpr OUStringLiteral MIMETYPE_PCX = u"image/x-pcx";
35inline constexpr OUStringLiteral MIMETYPE_PNG = u"image/png";
36inline constexpr OUStringLiteral MIMETYPE_TIF = u"image/tiff";
37inline constexpr OUStringLiteral MIMETYPE_XBM = u"image/x-xbitmap";
38inline constexpr OUStringLiteral MIMETYPE_XPM = u"image/x-xpixmap";
39inline constexpr OUStringLiteral MIMETYPE_PBM = u"image/x-portable-bitmap";
40inline constexpr OUStringLiteral MIMETYPE_PGM = u"image/x-portable-graymap";
41inline constexpr OUStringLiteral MIMETYPE_PPM = u"image/x-portable-pixmap";
42inline constexpr OUStringLiteral MIMETYPE_RAS = u"image/x-cmu-raster";
43inline constexpr OUStringLiteral MIMETYPE_TGA = u"image/x-targa";
44inline constexpr OUStringLiteral MIMETYPE_PSD = u"image/vnd.adobe.photoshop";
45inline constexpr OUStringLiteral MIMETYPE_EPS = u"image/x-eps";
46inline constexpr OUStringLiteral MIMETYPE_DXF = u"image/vnd.dxf";
47inline constexpr OUStringLiteral MIMETYPE_MET = u"image/x-met";
48inline constexpr OUStringLiteral MIMETYPE_PCT = u"image/x-pict";
49inline constexpr OUStringLiteral MIMETYPE_SVM = u"image/x-svm";
50inline constexpr OUStringLiteral MIMETYPE_WMF = u"image/x-wmf";
51inline constexpr OUStringLiteral MIMETYPE_EMF = u"image/x-emf";
52inline constexpr OUStringLiteral MIMETYPE_SVG = u"image/svg+xml";
53inline constexpr OUStringLiteral MIMETYPE_PDF = u"application/pdf";
54inline constexpr OUStringLiteral MIMETYPE_WEBP = u"image/webp";
55inline constexpr OUStringLiteral MIMETYPE_VCLGRAPHIC = u"image/x-vclgraphic";
56
57namespace comphelper { class PropertySetInfo; }
58namespace com::sun::star::io { class XInputStream; }
59
60class Graphic;
61
62namespace unographic {
63
65 public css::lang::XServiceInfo,
66 public css::lang::XTypeProvider,
68{
69public:
70
72 virtual ~GraphicDescriptor() noexcept override;
73
74 void init( const ::Graphic& rGraphic );
75 void init( const OUString& rURL );
76 void init( const css::uno::Reference< css::io::XInputStream >& rxIStm, const OUString& rURL );
77
79
80 // XInterface
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
85protected:
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
99private:
100
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: */
constexpr OUStringLiteral MIMETYPE_MET
constexpr OUStringLiteral MIMETYPE_TIF
constexpr OUStringLiteral MIMETYPE_EPS
constexpr OUStringLiteral MIMETYPE_JPG
constexpr OUStringLiteral MIMETYPE_XPM
constexpr OUStringLiteral MIMETYPE_PDF
constexpr OUStringLiteral MIMETYPE_DXF
constexpr OUStringLiteral MIMETYPE_SVG
constexpr OUStringLiteral MIMETYPE_WMF
constexpr OUStringLiteral MIMETYPE_WEBP
constexpr OUStringLiteral MIMETYPE_TGA
constexpr OUStringLiteral MIMETYPE_RAS
constexpr OUStringLiteral MIMETYPE_PNG
constexpr OUStringLiteral MIMETYPE_XBM
constexpr OUStringLiteral MIMETYPE_VCLGRAPHIC
constexpr OUStringLiteral MIMETYPE_PCX
constexpr OUStringLiteral MIMETYPE_PBM
constexpr OUStringLiteral MIMETYPE_PSD
constexpr OUStringLiteral MIMETYPE_PGM
constexpr OUStringLiteral MIMETYPE_EMF
constexpr OUStringLiteral MIMETYPE_PCD
constexpr OUStringLiteral MIMETYPE_PPM
constexpr OUStringLiteral MIMETYPE_BMP
constexpr OUStringLiteral MIMETYPE_GIF
constexpr OUStringLiteral MIMETYPE_PCT
constexpr OUStringLiteral MIMETYPE_SVM
virtual void _setPropertyValues(const comphelper::PropertyMapEntry **ppEntries, const css::uno::Any *pValues) override
static rtl::Reference<::comphelper::PropertySetInfo > createPropertySetInfo()
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
void init(const css::uno::Reference< css::io::XInputStream > &rxIStm, const OUString &rURL)
virtual void SAL_CALL release() noexcept override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual ~GraphicDescriptor() noexcept override
void init(const ::Graphic &rGraphic)
virtual void _getPropertyValues(const comphelper::PropertyMapEntry **ppEntries, css::uno::Any *pValue) override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual void SAL_CALL acquire() noexcept override
void implCreate(SvStream &rIStm, const OUString *pPath)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
float u
GraphicType
Definition: graph.hxx:35
Type
std::pair< OUString const, DataAccessDescriptorProperty > PropertyMapEntry
unsigned char sal_Bool
signed char sal_Int8