/src/libreoffice/vcl/inc/graphic/UnoGraphic.hxx
Line | Count | Source |
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 | | #pragma once |
21 | | |
22 | | #include <com/sun/star/graphic/XGraphic.hpp> |
23 | | #include <com/sun/star/awt/XBitmap.hpp> |
24 | | #include <com/sun/star/graphic/XGraphicTransformer.hpp> |
25 | | |
26 | | #include <graphic/UnoGraphicDescriptor.hxx> |
27 | | |
28 | | #include <vcl/graph.hxx> |
29 | | |
30 | | namespace unographic { |
31 | | |
32 | | class Graphic final : public css::graphic::XGraphic, |
33 | | public css::awt::XBitmap, |
34 | | public css::graphic::XGraphicTransformer, |
35 | | public ::unographic::GraphicDescriptor |
36 | | { |
37 | | public: |
38 | | Graphic(const ::Graphic& rGraphic); |
39 | | virtual ~Graphic() noexcept override; |
40 | | |
41 | 51.1k | const ::Graphic& GetGraphic() const { return maGraphic; } |
42 | | |
43 | | // XInterface |
44 | | virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; |
45 | | virtual void SAL_CALL acquire() noexcept override; |
46 | | virtual void SAL_CALL release() noexcept override; |
47 | | private: |
48 | | // XServiceInfo |
49 | | virtual OUString SAL_CALL getImplementationName() override; |
50 | | virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; |
51 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
52 | | |
53 | | // XTypeProvider |
54 | | virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; |
55 | | |
56 | | // XGraphic |
57 | | virtual ::sal_Int8 SAL_CALL getType( ) override; |
58 | | |
59 | | // XBitmap |
60 | | virtual css::awt::Size SAL_CALL getSize( ) override; |
61 | | virtual css::uno::Sequence< ::sal_Int8 > SAL_CALL getDIB( ) override; |
62 | | virtual css::uno::Sequence< ::sal_Int8 > SAL_CALL getMaskDIB( ) override; |
63 | | |
64 | | // XGraphicTransformer |
65 | | virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL colorChange( |
66 | | const css::uno::Reference< css::graphic::XGraphic >& rGraphic, |
67 | | sal_Int32 nColorFrom, sal_Int8 nTolerance, sal_Int32 nColorTo, sal_Int8 nAlphaTo ) override; |
68 | | |
69 | | virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL applyDuotone( |
70 | | const css::uno::Reference< css::graphic::XGraphic >& rGraphic, |
71 | | sal_Int32 nColorOne, sal_Int32 nColorTwo ) override; |
72 | | |
73 | | virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL applyBrightnessContrast( |
74 | | const css::uno::Reference< css::graphic::XGraphic >& rxGraphic, |
75 | | sal_Int32 nBrightness, sal_Int32 nContrast, sal_Bool mso ) override; |
76 | | |
77 | | ::Graphic maGraphic; |
78 | | }; |
79 | | |
80 | | } |
81 | | |
82 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |