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_HELP_HXX
21 #define INCLUDED_VCL_HELP_HXX
23 #include <rtl/ustring.hxx>
24 #include <vcl/dllapi.h>
25 #include <o3tl/typed_flags_set.hxx>
28 namespace tools
{ class Rectangle
; }
29 namespace vcl
{ class Window
; }
32 enum class QuickHelpFlags
41 NoAutoPos
= Left
| Center
| Right
| Top
| VCenter
| Bottom
,
43 /// force balloon-style in ShowPopover and ShowQuickHelp
44 TipStyleBalloon
= 0x0100,
45 NoEvadePointer
= 0x0200,
50 template<> struct typed_flags
<QuickHelpFlags
> : is_typed_flags
<QuickHelpFlags
, 0x77f> {};
53 #define OOO_HELP_INDEX ".help:index"
60 class VCL_DLLPUBLIC Help
66 virtual bool Start(const OUString
& rHelpId
, const vcl::Window
* pWindow
);
67 virtual bool Start(const OUString
& rHelpId
, weld::Widget
* pWidget
);
68 virtual void SearchKeyword( const OUString
& rKeyWord
);
69 virtual OUString
GetHelpText(const OUString
& aHelpURL
, const vcl::Window
* pWindow
);
70 virtual OUString
GetHelpText(const OUString
& aHelpURL
, const weld::Widget
* pWidget
);
72 static void EnableContextHelp();
73 static void DisableContextHelp();
74 static bool IsContextHelpEnabled();
76 static void EnableExtHelp();
77 static void DisableExtHelp();
78 static bool IsExtHelpEnabled();
79 static bool StartExtHelp();
80 static bool EndExtHelp();
82 static void EnableBalloonHelp();
83 static void DisableBalloonHelp();
84 static bool IsBalloonHelpEnabled();
85 static void ShowBalloon( vcl::Window
* pParent
,
86 const Point
& rScreenPos
,
87 const tools::Rectangle
&,
88 const OUString
& rHelpText
);
90 static void EnableQuickHelp();
91 static void DisableQuickHelp();
92 static bool IsQuickHelpEnabled();
93 static void ShowQuickHelp( vcl::Window
* pParent
,
94 const tools::Rectangle
& rScreenRect
,
95 const OUString
& rHelpText
,
96 QuickHelpFlags nStyle
= QuickHelpFlags::NONE
);
98 static void HideBalloonAndQuickHelp();
100 static void* ShowPopover(vcl::Window
* pParent
,
101 const tools::Rectangle
& rScreenRect
,
102 const OUString
& rText
,
103 QuickHelpFlags nStyle
);
104 static void UpdatePopover(void* nId
,
105 vcl::Window
* pParent
,
106 const tools::Rectangle
& rScreenRect
,
107 const OUString
& rText
);
108 static void HidePopover(vcl::Window
const * pParent
, void* nId
);
111 #endif // INCLUDED_VCL_HELP_HXX
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */