Branch libreoffice-5-0-4
[LibreOffice.git] / include / vcl / help.hxx
blob40dfcf2e4e0e650b70b795af8d95fcfdaad73b7d
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 class Rectangle;
30 namespace vcl { class Window; }
33 // - Help-Types -
35 enum class QuickHelpFlags
37 NONE = 0x0000,
38 Left = 0x0001,
39 Center = 0x0002,
40 Right = 0x0004,
41 Top = 0x0008,
42 VCenter = 0x0010,
43 Bottom = 0x0020,
44 NoAutoPos = Left | Center | Right | Top | VCenter | Bottom,
45 CtrlText = 0x0040,
46 /// force the existent tip window to be re-positioned, even if the previous incarnation has the same text. Applies to ShowBallon and ShowQuickHelp.
47 ForceReposition = 0x0080,
48 /// no delay when opening the quick help. Applies to ShowBallon and ShowQuickHelp
49 NoDelay = 0x0100,
50 /// force balloon-style in ShowTip
51 TipStyleBalloon = 0x0200,
52 NoEvadePointer = 0x4000,
53 BiDiRtl = 0x8000,
55 namespace o3tl
57 template<> struct typed_flags<QuickHelpFlags> : is_typed_flags<QuickHelpFlags, 0xc3ff> {};
60 #define OOO_HELP_INDEX ".help:index"
62 // - Help -
64 class VCL_DLLPUBLIC Help
66 public:
67 Help();
68 virtual ~Help();
70 virtual bool Start( const OUString& rHelpId, const vcl::Window* pWindow );
71 virtual bool SearchKeyword( const OUString& rKeyWord );
72 virtual OUString GetHelpText( const OUString& aHelpURL, const vcl::Window* pWindow );
74 static void EnableContextHelp();
75 static void DisableContextHelp();
76 static bool IsContextHelpEnabled();
78 static void EnableExtHelp();
79 static void DisableExtHelp();
80 static bool IsExtHelpEnabled();
81 static bool StartExtHelp();
82 static bool EndExtHelp();
84 static void EnableBalloonHelp();
85 static void DisableBalloonHelp();
86 static bool IsBalloonHelpEnabled();
87 static bool ShowBalloon( vcl::Window* pParent,
88 const Point& rScreenPos,
89 const OUString& rHelpText );
90 static bool ShowBalloon( vcl::Window* pParent,
91 const Point& rScreenPos,
92 const Rectangle&,
93 const OUString& rHelpText );
95 static void EnableQuickHelp();
96 static void DisableQuickHelp();
97 static bool IsQuickHelpEnabled();
98 static bool ShowQuickHelp( vcl::Window* pParent,
99 const Rectangle& rScreenRect,
100 const OUString& rHelpText,
101 const OUString& rLongHelpText,
102 QuickHelpFlags nStyle = QuickHelpFlags::NONE );
103 static bool ShowQuickHelp( vcl::Window* pParent,
104 const Rectangle& rScreenRect,
105 const OUString& rHelpText,
106 QuickHelpFlags nStyle = QuickHelpFlags::NONE )
107 { return Help::ShowQuickHelp( pParent, rScreenRect, rHelpText, OUString(), nStyle ); }
109 static void HideBalloonAndQuickHelp();
111 static sal_uLong ShowTip( vcl::Window* pParent,
112 const Rectangle& rScreenRect,
113 const OUString& rText, QuickHelpFlags nStyle = QuickHelpFlags::NONE );
114 static void UpdateTip( sal_uLong nId,
115 vcl::Window* pParent,
116 const Rectangle& rScreenRect,
117 const OUString& rText );
118 static void HideTip( sal_uLong nId );
121 #endif // INCLUDED_VCL_HELP_HXX
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */