1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
11 #ifndef INCLUDED_VCL_INC_WIDGETDRAWINTERFACE_HXX
12 #define INCLUDED_VCL_INC_WIDGETDRAWINTERFACE_HXX
14 #include <vcl/dllapi.h>
15 #include <vcl/salnativewidgets.hxx>
16 #include <vcl/settings.hxx>
20 class VCL_PLUGIN_PUBLIC WidgetDrawInterface
23 virtual ~WidgetDrawInterface() COVERITY_NOEXCEPT_FALSE
{}
26 * Query the platform layer for native control support.
28 * @param [in] eType The widget type.
29 * @param [in] ePart The part of the widget.
30 * @return true if the platform supports native drawing of the widget type defined by part.
32 virtual inline bool isNativeControlSupported(ControlType eType
, ControlPart ePart
);
35 * Query if a position is inside the native widget part.
37 * Mainly used for scrollbars.
39 * @param [in] eType The widget type.
40 * @param [in] ePart The part of the widget.
41 * @param [in] rBoundingControlRegion The bounding Rectangle of
42 the complete control in VCL frame coordinates.
43 * @param [in] aPos The position to check the hit.
44 * @param [out] rIsInside true, if \a aPos was inside the native widget.
45 * @return true, if the query was successful.
47 virtual inline bool hitTestNativeControl(ControlType eType
, ControlPart ePart
,
48 const tools::Rectangle
& rBoundingControlRegion
,
49 const Point
& aPos
, bool& rIsInside
);
52 * Draw the requested control.
54 * @param [in] eType The widget type.
55 * @param [in] ePart The part of the widget.
56 * @param [in] rBoundingControlRegion The bounding rectangle of
57 * the complete control in VCL frame coordinates.
58 * @param [in] eState The general state of the control (enabled, focused, etc.).
59 * @param [in] aValue Addition control specific information.
60 * @param [in] aCaption A caption or title string (like button text etc.).
61 * @return true, if the control could be drawn.
63 virtual inline bool drawNativeControl(ControlType eType
, ControlPart ePart
,
64 const tools::Rectangle
& rBoundingControlRegion
,
65 ControlState eState
, const ImplControlValue
& aValue
,
66 const OUString
& aCaptions
);
69 * Get the native control regions for the control part.
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.
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.
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
);
94 virtual inline bool updateSettings(AllSettings
& rSettings
);
97 bool WidgetDrawInterface::isNativeControlSupported(ControlType
, ControlPart
) { return false; }
99 bool WidgetDrawInterface::hitTestNativeControl(ControlType
, ControlPart
, const tools::Rectangle
&,
105 bool WidgetDrawInterface::drawNativeControl(ControlType
, ControlPart
, const tools::Rectangle
&,
106 ControlState
, const ImplControlValue
&, const OUString
&)
111 bool WidgetDrawInterface::getNativeControlRegion(ControlType
, ControlPart
, const tools::Rectangle
&,
112 ControlState
, const ImplControlValue
&,
113 const OUString
&, tools::Rectangle
&,
119 bool WidgetDrawInterface::updateSettings(AllSettings
&) { return false; }
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */