/src/libreoffice/vcl/inc/FileDefinitionWidgetDraw.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 | | */ |
10 | | |
11 | | #pragma once |
12 | | |
13 | | #include "widgetdraw/WidgetDefinition.hxx" |
14 | | #include "salgdi.hxx" |
15 | | #include "WidgetDrawInterface.hxx" |
16 | | |
17 | | namespace vcl |
18 | | { |
19 | | class FileDefinitionWidgetDraw final : public vcl::WidgetDrawInterface |
20 | | { |
21 | | private: |
22 | | SalGraphics& m_rGraphics; |
23 | | bool m_bIsActive; |
24 | | |
25 | | std::shared_ptr<WidgetDefinition> m_pWidgetDefinition; |
26 | | |
27 | | bool resolveDefinition(ControlType eType, ControlPart ePart, ControlState eState, |
28 | | const ImplControlValue& rValue, tools::Long nX, tools::Long nY, |
29 | | tools::Long nWidth, tools::Long nHeight); |
30 | | |
31 | | public: |
32 | | FileDefinitionWidgetDraw(SalGraphics& rGraphics); |
33 | | |
34 | 0 | bool isActive() const { return m_bIsActive; } |
35 | | |
36 | | bool isNativeControlSupported(ControlType eType, ControlPart ePart) override; |
37 | | |
38 | | bool hitTestNativeControl(ControlType eType, ControlPart ePart, |
39 | | const tools::Rectangle& rBoundingControlRegion, const Point& aPos, |
40 | | bool& rIsInside) override; |
41 | | |
42 | | bool drawNativeControl(ControlType eType, ControlPart ePart, |
43 | | const tools::Rectangle& rBoundingControlRegion, ControlState eState, |
44 | | const ImplControlValue& aValue, const OUString& aCaptions, |
45 | | const Color& rBackgroundColor) override; |
46 | | |
47 | | bool getNativeControlRegion(ControlType eType, ControlPart ePart, |
48 | | const tools::Rectangle& rBoundingControlRegion, ControlState eState, |
49 | | const ImplControlValue& aValue, const OUString& aCaption, |
50 | | tools::Rectangle& rNativeBoundingRegion, |
51 | | tools::Rectangle& rNativeContentRegion) override; |
52 | | |
53 | | bool updateSettings(AllSettings& rSettings) override; |
54 | | |
55 | | static void drawPolyPolygon(SalGraphics& rGraphics, |
56 | | const basegfx::B2DHomMatrix& rObjectToDevice, |
57 | | const basegfx::B2DPolyPolygon& i_rPolyPolygon, |
58 | | double i_fTransparency); |
59 | | |
60 | | static void drawPolyLine(SalGraphics& rGraphics, const basegfx::B2DHomMatrix& rObjectToDevice, |
61 | | const basegfx::B2DPolygon& i_rPolygon, double i_fTransparency, |
62 | | double i_fLineWidth, const std::vector<double>* i_pStroke, |
63 | | basegfx::B2DLineJoin i_eLineJoin, css::drawing::LineCap i_eLineCap, |
64 | | double i_fMiterMinimumAngle, bool bPixelSnapHairline); |
65 | | |
66 | | static void drawBitmap(SalGraphics& rGraphics, const SalTwoRect& rPosAry, |
67 | | const SalBitmap& rSalBitmap); |
68 | | |
69 | | static void implDrawGradient(SalGraphics& rGraphics, |
70 | | const basegfx::B2DPolyPolygon& rPolyPolygon, |
71 | | const SalGradient& rGradient); |
72 | | }; |
73 | | |
74 | | } // end vcl namespace |
75 | | |
76 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |