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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_VCL_INC_HELPWIN_HXX
21 #define INCLUDED_VCL_INC_HELPWIN_HXX
23 #include <vcl/floatwin.hxx>
24 #include <vcl/timer.hxx>
26 enum class QuickHelpFlags
;
28 class HelpTextWindow
: public FloatingWindow
31 tools::Rectangle maHelpArea
; // If next Help for the same rectangle w/ same text, then keep window
33 tools::Rectangle maTextRect
; // For wrapped text in QuickHelp
40 sal_uInt16 mnHelpWinStyle
;
41 QuickHelpFlags mnStyle
;
44 DECL_LINK( TimerHdl
, Timer
*, void );
46 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
&) override
;
47 virtual void RequestHelp( const HelpEvent
& rHEvt
) override
;
48 virtual void ApplySettings(vcl::RenderContext
& rRenderContext
) override
;
50 virtual OUString
GetText() const override
;
53 virtual void dispose() override
;
55 HelpTextWindow( vcl::Window
* pParent
, const OUString
& rText
, sal_uInt16 nHelpWinStyle
, QuickHelpFlags nStyle
);
56 virtual ~HelpTextWindow() override
;
58 const OUString
& GetHelpText() const { return maHelpText
; }
59 void SetHelpText( const OUString
& rHelpText
);
60 sal_uInt16
GetWinStyle() const { return mnHelpWinStyle
; }
61 QuickHelpFlags
GetStyle() const { return mnStyle
; }
64 void SetHelpArea( const tools::Rectangle
& rRect
) { maHelpArea
= rRect
; }
66 void ShowHelp(bool bNoDelay
);
68 Size
CalcOutSize() const;
69 const tools::Rectangle
& GetHelpArea() const { return maHelpArea
; }
72 void ImplShowHelpWindow( vcl::Window
* pParent
, sal_uInt16 nHelpWinStyle
, QuickHelpFlags nStyle
,
73 const OUString
& rHelpText
,
74 const Point
& rScreenPos
, const tools::Rectangle
& rHelpArea
);
75 VCL_DLLPUBLIC
void ImplDestroyHelpWindow( bool bUpdateHideTime
);
76 void ImplSetHelpWindowPos( vcl::Window
* pHelpWindow
, sal_uInt16 nHelpWinStyle
, QuickHelpFlags nStyle
,
77 const Point
& rPos
, const tools::Rectangle
& rHelpArea
);
79 #endif // INCLUDED_VCL_INC_HELPWIN_HXX
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */