Line data Source code
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_HELP_HXX
21 : #define INCLUDED_VCL_HELP_HXX
22 :
23 : #include <rtl/ustring.hxx>
24 : #include <tools/solar.h>
25 : #include <vcl/dllapi.h>
26 :
27 : class Point;
28 : class Rectangle;
29 : namespace vcl { class Window; }
30 :
31 :
32 : // - Help-Types -
33 :
34 :
35 : #define QUICKHELP_LEFT ((sal_uInt16)0x0001)
36 : #define QUICKHELP_CENTER ((sal_uInt16)0x0002)
37 : #define QUICKHELP_RIGHT ((sal_uInt16)0x0004)
38 : #define QUICKHELP_TOP ((sal_uInt16)0x0008)
39 : #define QUICKHELP_VCENTER ((sal_uInt16)0x0010)
40 : #define QUICKHELP_BOTTOM ((sal_uInt16)0x0020)
41 : #define QUICKHELP_NOAUTOPOS (QUICKHELP_LEFT | QUICKHELP_CENTER | QUICKHELP_RIGHT | QUICKHELP_TOP | QUICKHELP_VCENTER | QUICKHELP_BOTTOM)
42 : #define QUICKHELP_CTRLTEXT ((sal_uInt16)0x0040)
43 : /// force the existent tip window to be re-positioned, even if the previous incarnation has the same text. Applies to ShowBallon and ShowQuickHelp.
44 : #define QUICKHELP_FORCE_REPOSITION ((sal_uInt16)0x0080)
45 : /// no delay when opening the quick help. Applies to ShowBallon and ShowQuickHelp
46 : #define QUICKHELP_NO_DELAY ((sal_uInt16)0x0100)
47 : /// force balloon-style in ShowTip
48 : #define QUICKHELP_TIP_STYLE_BALLOON ((sal_uInt16)0x0200)
49 : #define QUICKHELP_NOEVADEPOINTER ((sal_uInt16)0x4000)
50 : #define QUICKHELP_BIDI_RTL ((sal_uInt16)0x8000)
51 :
52 : #define OOO_HELP_INDEX ".help:index"
53 :
54 : // - Help -
55 :
56 : class VCL_DLLPUBLIC Help
57 : {
58 : public:
59 : Help();
60 : virtual ~Help();
61 :
62 : virtual bool Start( const OUString& rHelpId, const vcl::Window* pWindow );
63 : virtual bool SearchKeyword( const OUString& rKeyWord );
64 : virtual OUString GetHelpText( const OUString& aHelpURL, const vcl::Window* pWindow );
65 :
66 : static void EnableContextHelp();
67 : static void DisableContextHelp();
68 : static bool IsContextHelpEnabled();
69 :
70 : static void EnableExtHelp();
71 : static void DisableExtHelp();
72 : static bool IsExtHelpEnabled();
73 : static bool StartExtHelp();
74 : static bool EndExtHelp();
75 :
76 : static void EnableBalloonHelp();
77 : static void DisableBalloonHelp();
78 : static bool IsBalloonHelpEnabled();
79 : static bool ShowBalloon( vcl::Window* pParent,
80 : const Point& rScreenPos,
81 : const OUString& rHelpText );
82 : static bool ShowBalloon( vcl::Window* pParent,
83 : const Point& rScreenPos,
84 : const Rectangle&,
85 : const OUString& rHelpText );
86 :
87 : static void EnableQuickHelp();
88 : static void DisableQuickHelp();
89 : static bool IsQuickHelpEnabled();
90 : static bool ShowQuickHelp( vcl::Window* pParent,
91 : const Rectangle& rScreenRect,
92 : const OUString& rHelpText,
93 : const OUString& rLongHelpText,
94 : sal_uInt16 nStyle = 0 );
95 0 : static bool ShowQuickHelp( vcl::Window* pParent,
96 : const Rectangle& rScreenRect,
97 : const OUString& rHelpText,
98 : sal_uInt16 nStyle = 0 )
99 0 : { return Help::ShowQuickHelp( pParent, rScreenRect, rHelpText, OUString(), nStyle ); }
100 :
101 : static void HideBalloonAndQuickHelp();
102 :
103 : static sal_uLong ShowTip( vcl::Window* pParent,
104 : const Rectangle& rScreenRect,
105 : const OUString& rText, sal_uInt16 nStyle = 0 );
106 : static void UpdateTip( sal_uLong nId,
107 : vcl::Window* pParent,
108 : const Rectangle& rScreenRect,
109 : const OUString& rText );
110 : static void HideTip( sal_uLong nId );
111 : };
112 :
113 : #endif // INCLUDED_VCL_HELP_HXX
114 :
115 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|