LibreOffice Module vcl (master)  1
helpwin.hxx
Go to the documentation of this file.
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 #ifndef INCLUDED_VCL_INC_HELPWIN_HXX
21 #define INCLUDED_VCL_INC_HELPWIN_HXX
22 
23 #include <vcl/floatwin.hxx>
24 #include <vcl/timer.hxx>
25 
26 enum class QuickHelpFlags;
27 struct ImplSVHelpData;
28 
29 class HelpTextWindow final : public FloatingWindow
30 {
31 private:
32  tools::Rectangle maHelpArea; // If next Help for the same rectangle w/ same text, then keep window
33 
34  tools::Rectangle maTextRect; // For wrapped text in QuickHelp
35 
36  OUString maHelpText;
37 
40 
41  sal_uInt16 mnHelpWinStyle;
43 
44 private:
45  DECL_LINK( TimerHdl, Timer*, void );
46 
47  virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
48  virtual void RequestHelp( const HelpEvent& rHEvt ) override;
49  virtual void ApplySettings(vcl::RenderContext& rRenderContext) override;
50 
51  virtual OUString GetText() const override;
52  void ImplShow();
53 
54  virtual void dispose() override;
55 public:
56  HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle );
57  virtual ~HelpTextWindow() override;
58 
59  const OUString& GetHelpText() const { return maHelpText; }
60  void SetHelpText( const OUString& rHelpText );
61  sal_uInt16 GetWinStyle() const { return mnHelpWinStyle; }
62  QuickHelpFlags GetStyle() const { return mnStyle; }
63 
64  // only remember:
65  void SetHelpArea( const tools::Rectangle& rRect ) { maHelpArea = rRect; }
66 
67  void ShowHelp(bool bNoDelay);
68 
69  Size CalcOutSize() const;
70  const tools::Rectangle& GetHelpArea() const { return maHelpArea; }
71 };
72 
73 void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle,
74  const OUString& rHelpText,
75  const Point& rScreenPos, const tools::Rectangle& rHelpArea );
76 VCL_DLLPUBLIC void ImplDestroyHelpWindow( bool bUpdateHideTime );
77 void ImplDestroyHelpWindow(ImplSVHelpData& rHelpData, bool bUpdateHideTime);
78 void ImplSetHelpWindowPos( vcl::Window* pHelpWindow, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle,
79  const Point& rPos, const tools::Rectangle& rHelpArea );
80 
81 #endif // INCLUDED_VCL_INC_HELPWIN_HXX
82 
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
HelpTextWindow(vcl::Window *pParent, const OUString &rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle)
Definition: help.cxx:256
tools::Rectangle maTextRect
Definition: helpwin.hxx:34
void ImplShow()
Definition: help.cxx:367
sal_uInt16 mnHelpWinStyle
Definition: helpwin.hxx:41
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
sal_uInt16 GetWinStyle() const
Definition: helpwin.hxx:61
const tools::Rectangle & GetHelpArea() const
Definition: helpwin.hxx:70
void SetHelpText(const OUString &rHelpText)
Definition: help.cxx:326
Timer maHideTimer
Definition: helpwin.hxx:39
QuickHelpFlags mnStyle
Definition: helpwin.hxx:42
virtual OUString GetText() const override
Definition: help.cxx:475
QuickHelpFlags GetStyle() const
Definition: helpwin.hxx:62
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
Definition: help.cxx:375
OUString maHelpText
Definition: helpwin.hxx:36
virtual ~HelpTextWindow() override
Definition: help.cxx:311
QuickHelpFlags
Definition: help.hxx:32
VCL_DLLPUBLIC void ImplDestroyHelpWindow(bool bUpdateHideTime)
Definition: help.cxx:557
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:304
DECL_LINK(TimerHdl, Timer *, void)
Size CalcOutSize() const
Definition: help.cxx:461
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
Definition: help.cxx:287
void ImplShowHelpWindow(vcl::Window *pParent, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const OUString &rHelpText, const Point &rScreenPos, const tools::Rectangle &rHelpArea)
Definition: help.cxx:480
void ImplSetHelpWindowPos(vcl::Window *pHelpWindow, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const Point &rPos, const tools::Rectangle &rHelpArea)
Definition: help.cxx:588
virtual void RequestHelp(const HelpEvent &rHEvt) override
Definition: help.cxx:469
Timer maShowTimer
Definition: helpwin.hxx:38
const OUString & GetHelpText() const
Definition: helpwin.hxx:59
void ShowHelp(bool bNoDelay)
Definition: help.cxx:421
Definition: timer.hxx:26
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: help.cxx:316
void SetHelpArea(const tools::Rectangle &rRect)
Definition: helpwin.hxx:65
tools::Rectangle maHelpArea
Definition: helpwin.hxx:32