Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / vcl / help.hxx
blobcd64b4f669dba4f3a68c8eee279a33c6635fb311
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 <tools/solar.h>
25 #include <vcl/dllapi.h>
26 #include <o3tl/typed_flags_set.hxx>
28 class Point;
29 namespace tools { class Rectangle; }
30 namespace vcl { class Window; }
33 enum class QuickHelpFlags
35 NONE = 0x0000,
36 Left = 0x0001,
37 Center = 0x0002,
38 Right = 0x0004,
39 Top = 0x0008,
40 VCenter = 0x0010,
41 Bottom = 0x0020,
42 NoAutoPos = Left | Center | Right | Top | VCenter | Bottom,
43 CtrlText = 0x0040,
44 /// no delay when opening the quick help. Applies to ShowBalloon and ShowQuickHelp
45 NoDelay = 0x0080,
46 /// force balloon-style in ShowPopover and ShowQuickHelp
47 TipStyleBalloon = 0x0100,
48 NoEvadePointer = 0x0200,
49 BiDiRtl = 0x0400,
51 namespace o3tl
53 template<> struct typed_flags<QuickHelpFlags> : is_typed_flags<QuickHelpFlags, 0x7ff> {};
56 #define OOO_HELP_INDEX ".help:index"
59 class VCL_DLLPUBLIC Help
61 public:
62 Help();
63 virtual ~Help();
65 virtual bool Start( const OUString& rHelpId, const vcl::Window* pWindow );
66 virtual bool SearchKeyword( const OUString& rKeyWord );
67 virtual OUString GetHelpText( const OUString& aHelpURL, const vcl::Window* pWindow );
69 static void EnableContextHelp();
70 static void DisableContextHelp();
71 static bool IsContextHelpEnabled();
73 static void EnableExtHelp();
74 static void DisableExtHelp();
75 static bool IsExtHelpEnabled();
76 static bool StartExtHelp();
77 static bool EndExtHelp();
79 static void EnableBalloonHelp();
80 static void DisableBalloonHelp();
81 static bool IsBalloonHelpEnabled();
82 static bool ShowBalloon( vcl::Window* pParent,
83 const Point& rScreenPos,
84 const tools::Rectangle&,
85 const OUString& rHelpText );
87 static void EnableQuickHelp();
88 static void DisableQuickHelp();
89 static bool IsQuickHelpEnabled();
90 static bool ShowQuickHelp( vcl::Window* pParent,
91 const tools::Rectangle& rScreenRect,
92 const OUString& rHelpText,
93 const OUString& rLongHelpText,
94 QuickHelpFlags nStyle );
95 static bool ShowQuickHelp( vcl::Window* pParent,
96 const tools::Rectangle& rScreenRect,
97 const OUString& rHelpText,
98 QuickHelpFlags nStyle = QuickHelpFlags::NONE )
99 { return Help::ShowQuickHelp( pParent, rScreenRect, rHelpText, OUString(), nStyle ); }
101 static void HideBalloonAndQuickHelp();
103 static sal_uLong ShowPopover(vcl::Window* pParent,
104 const tools::Rectangle& rScreenRect,
105 const OUString& rText,
106 QuickHelpFlags nStyle);
107 static void UpdatePopover(sal_uLong nId,
108 vcl::Window* pParent,
109 const tools::Rectangle& rScreenRect,
110 const OUString& rText);
111 static void HidePopover(vcl::Window* pParent, sal_uLong nId);
114 #endif // INCLUDED_VCL_HELP_HXX
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */