/src/libreoffice/vcl/inc/WidgetDrawInterface.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 <vcl/dllapi.h> |
14 | | #include <vcl/salnativewidgets.hxx> |
15 | | #include <vcl/settings.hxx> |
16 | | |
17 | | namespace vcl |
18 | | { |
19 | | class VCL_PLUGIN_PUBLIC WidgetDrawInterface |
20 | | { |
21 | | public: |
22 | 464k | virtual ~WidgetDrawInterface() {} |
23 | | |
24 | | /** |
25 | | * Query the platform layer for native control support. |
26 | | * |
27 | | * @param [in] eType The widget type. |
28 | | * @param [in] ePart The part of the widget. |
29 | | * @return true if the platform supports native drawing of the widget type defined by part. |
30 | | */ |
31 | | virtual inline bool isNativeControlSupported(ControlType eType, ControlPart ePart); |
32 | | |
33 | | /** |
34 | | * Query if a position is inside the native widget part. |
35 | | * |
36 | | * Mainly used for scrollbars. |
37 | | * |
38 | | * @param [in] eType The widget type. |
39 | | * @param [in] ePart The part of the widget. |
40 | | * @param [in] rBoundingControlRegion The bounding Rectangle of |
41 | | the complete control in VCL frame coordinates. |
42 | | * @param [in] aPos The position to check the hit. |
43 | | * @param [out] rIsInside true, if \a aPos was inside the native widget. |
44 | | * @return true, if the query was successful. |
45 | | */ |
46 | | virtual inline bool hitTestNativeControl(ControlType eType, ControlPart ePart, |
47 | | const tools::Rectangle& rBoundingControlRegion, |
48 | | const Point& aPos, bool& rIsInside); |
49 | | |
50 | | /** |
51 | | * Draw the requested control. |
52 | | * |
53 | | * @param [in] eType The widget type. |
54 | | * @param [in] ePart The part of the widget. |
55 | | * @param [in] rBoundingControlRegion The bounding rectangle of |
56 | | * the complete control in VCL frame coordinates. |
57 | | * @param [in] eState The general state of the control (enabled, focused, etc.). |
58 | | * @param [in] aValue Addition control specific information. |
59 | | * @param [in] aCaption A caption or title string (like button text etc.). |
60 | | * @param [in] rBackgroundColor Background color for the control (may be COL_AUTO) |
61 | | * @return true, if the control could be drawn. |
62 | | */ |
63 | | virtual inline bool drawNativeControl(ControlType eType, ControlPart ePart, |
64 | | const tools::Rectangle& rBoundingControlRegion, |
65 | | ControlState eState, const ImplControlValue& aValue, |
66 | | const OUString& aCaptions, const Color& rBackgroundColor); |
67 | | |
68 | | /** |
69 | | * Get the native control regions for the control part. |
70 | | * |
71 | | * If the return value is true, \a rNativeBoundingRegion contains |
72 | | * the true bounding region covered by the control including any |
73 | | * adornment, while \a rNativeContentRegion contains the area |
74 | | * within the control that can be safely drawn into without drawing over |
75 | | * the borders of the control. |
76 | | * |
77 | | * @param [in] eType Type of the widget. |
78 | | * @param [in] ePart Specification of the widget's part if it consists of more than one. |
79 | | * @param [in] rBoundingControlRegion The bounding region of the control in VCL frame coordinates. |
80 | | * @param [in] eState The general state of the control (enabled, focused, etc.). |
81 | | * @param [in] aValue Addition control specific information. |
82 | | * @param [in] aCaption A caption or title string (like button text etc.). |
83 | | * @param [out] rNativeBoundingRegion The region covered by the control including any adornment. |
84 | | * @param [out] rNativeContentRegion The region within the control that can be safely drawn into. |
85 | | * @return true, if the regions are filled. |
86 | | */ |
87 | | virtual inline bool getNativeControlRegion(ControlType eType, ControlPart ePart, |
88 | | const tools::Rectangle& rBoundingControlRegion, |
89 | | ControlState eState, const ImplControlValue& aValue, |
90 | | const OUString& aCaption, |
91 | | tools::Rectangle& rNativeBoundingRegion, |
92 | | tools::Rectangle& rNativeContentRegion); |
93 | | |
94 | | virtual inline bool updateSettings(AllSettings& rSettings); |
95 | | }; |
96 | | |
97 | 33.6k | bool WidgetDrawInterface::isNativeControlSupported(ControlType, ControlPart) { return false; } |
98 | | |
99 | | bool WidgetDrawInterface::hitTestNativeControl(ControlType, ControlPart, const tools::Rectangle&, |
100 | | const Point&, bool&) |
101 | 0 | { |
102 | 0 | return false; |
103 | 0 | } |
104 | | |
105 | | bool WidgetDrawInterface::drawNativeControl(ControlType, ControlPart, const tools::Rectangle&, |
106 | | ControlState, const ImplControlValue&, const OUString&, |
107 | | const Color& /*rBackgroundColor*/) |
108 | 0 | { |
109 | 0 | return false; |
110 | 0 | } |
111 | | |
112 | | bool WidgetDrawInterface::getNativeControlRegion(ControlType, ControlPart, const tools::Rectangle&, |
113 | | ControlState, const ImplControlValue&, |
114 | | const OUString&, tools::Rectangle&, |
115 | | tools::Rectangle&) |
116 | 0 | { |
117 | 0 | return false; |
118 | 0 | } |
119 | | |
120 | 0 | bool WidgetDrawInterface::updateSettings(AllSettings&) { return false; } |
121 | | } |
122 | | |
123 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |