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
, weld::Widget
* pWidget
= nullptr);
67 virtual void SearchKeyword( const OUString
& rKeyWord
);
69 virtual bool Start(const OUString
& rHelpId
, const vcl::Window
* pWindow
);
70 virtual OUString
GetHelpText(const OUString
& aHelpURL
);
72 static void EnableContextHelp();
73 static void DisableContextHelp();
75 static void EnableExtHelp();
76 static void DisableExtHelp();
77 static bool IsExtHelpEnabled();
78 static bool StartExtHelp();
79 static bool EndExtHelp();
81 static void EnableBalloonHelp();
82 static void DisableBalloonHelp();
83 static bool IsBalloonHelpEnabled();
84 static void ShowBalloon( vcl::Window
* pParent
,
85 const Point
& rScreenPos
,
86 const tools::Rectangle
&,
87 const OUString
& rHelpText
);
89 static void EnableQuickHelp();
90 static void DisableQuickHelp();
91 static bool IsQuickHelpEnabled();
92 static void ShowQuickHelp( vcl::Window
* pParent
,
93 const tools::Rectangle
& rScreenRect
,
94 const OUString
& rHelpText
,
95 QuickHelpFlags nStyle
= QuickHelpFlags::NONE
);
97 static void HideBalloonAndQuickHelp();
99 static void* ShowPopover(vcl::Window
* pParent
,
100 const tools::Rectangle
& rScreenRect
,
101 const OUString
& rText
,
102 QuickHelpFlags nStyle
);
103 static void UpdatePopover(void* nId
,
104 vcl::Window
* pParent
,
105 const tools::Rectangle
& rScreenRect
,
106 const OUString
& rText
);
107 static void HidePopover(vcl::Window
const * pParent
, void* nId
);
110 #endif // INCLUDED_VCL_HELP_HXX
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */