Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SV_HELP_HXX
30 : : #define _SV_HELP_HXX
31 : :
32 : : #include <tools/string.hxx>
33 : : #include <tools/solar.h>
34 : : #include <vcl/dllapi.h>
35 : :
36 : : class Point;
37 : : class Rectangle;
38 : : class Window;
39 : :
40 : : // --------------
41 : : // - Help-Types -
42 : : // --------------
43 : :
44 : : #define QUICKHELP_LEFT ((sal_uInt16)0x0001)
45 : : #define QUICKHELP_CENTER ((sal_uInt16)0x0002)
46 : : #define QUICKHELP_RIGHT ((sal_uInt16)0x0004)
47 : : #define QUICKHELP_TOP ((sal_uInt16)0x0008)
48 : : #define QUICKHELP_VCENTER ((sal_uInt16)0x0010)
49 : : #define QUICKHELP_BOTTOM ((sal_uInt16)0x0020)
50 : : #define QUICKHELP_NOAUTOPOS (QUICKHELP_LEFT | QUICKHELP_CENTER | QUICKHELP_RIGHT | QUICKHELP_TOP | QUICKHELP_VCENTER | QUICKHELP_BOTTOM)
51 : : #define QUICKHELP_CTRLTEXT ((sal_uInt16)0x0040)
52 : : /// force the existent tip window to be re-positioned, even if the previous incarnation has the same text. Applies to ShowBallon and ShowQuickHelp.
53 : : #define QUICKHELP_FORCE_REPOSITION ((sal_uInt16)0x0080)
54 : : /// no delay when opening the quick help. Applies to ShowBallon and ShowQuickHelp
55 : : #define QUICKHELP_NO_DELAY ((sal_uInt16)0x0100)
56 : : /// force balloon-style in ShowTip
57 : : #define QUICKHELP_TIP_STYLE_BALLOON ((sal_uInt16)0x0200)
58 : : #define QUICKHELP_NOEVADEPOINTER ((sal_uInt16)0x4000)
59 : : #define QUICKHELP_BIDI_RTL ((sal_uInt16)0x8000)
60 : :
61 : : // By changes you must also change: rsc/vclrsc.hxx
62 : : #define OOO_HELP_INDEX ".help:index"
63 : : #define OOO_HELP_HELPONHELP ".help:helponhelp"
64 : :
65 : : // --------
66 : : // - Help -
67 : : // --------
68 : :
69 : : class VCL_DLLPUBLIC Help
70 : : {
71 : : private:
72 : : String maHelpFile;
73 : :
74 : : public:
75 : : Help();
76 : : virtual ~Help();
77 : :
78 : : void SetHelpFile( const String& rFileName ) { maHelpFile = rFileName; }
79 : : const String& GetHelpFile() const { return maHelpFile; }
80 : :
81 : : virtual sal_Bool Start( const XubString& rHelpId, const Window* pWindow );
82 : : virtual sal_Bool SearchKeyword( const XubString& rKeyWord );
83 : : virtual void OpenHelpAgent( const rtl::OString& rHelpId );
84 : : virtual XubString GetHelpText( const String& aHelpURL, const Window* pWindow );
85 : :
86 : : static void EnableContextHelp();
87 : : static void DisableContextHelp();
88 : : static sal_Bool IsContextHelpEnabled();
89 : :
90 : : static void EnableExtHelp();
91 : : static void DisableExtHelp();
92 : : static sal_Bool IsExtHelpEnabled();
93 : : static sal_Bool StartExtHelp();
94 : : static sal_Bool EndExtHelp();
95 : :
96 : : static void EnableBalloonHelp();
97 : : static void DisableBalloonHelp();
98 : : static sal_Bool IsBalloonHelpEnabled();
99 : : static sal_Bool ShowBalloon( Window* pParent,
100 : : const Point& rScreenPos,
101 : : const XubString& rHelpText );
102 : : static sal_Bool ShowBalloon( Window* pParent,
103 : : const Point& rScreenPos,
104 : : const Rectangle&,
105 : : const XubString& rHelpText );
106 : :
107 : : static void EnableQuickHelp();
108 : : static void DisableQuickHelp();
109 : : static sal_Bool IsQuickHelpEnabled();
110 : : static sal_Bool ShowQuickHelp( Window* pParent,
111 : : const Rectangle& rScreenRect,
112 : : const XubString& rHelpText,
113 : : const XubString& rLongHelpText,
114 : : sal_uInt16 nStyle = 0 );
115 : 0 : static sal_Bool ShowQuickHelp( Window* pParent,
116 : : const Rectangle& rScreenRect,
117 : : const XubString& rHelpText,
118 : : sal_uInt16 nStyle = 0 )
119 [ # # ]: 0 : { return Help::ShowQuickHelp( pParent, rScreenRect, rHelpText, XubString(), nStyle ); }
120 : :
121 : : static sal_uLong ShowTip( Window* pParent,
122 : : const Rectangle& rScreenRect,
123 : : const XubString& rText, sal_uInt16 nStyle = 0 );
124 : : static void UpdateTip( sal_uLong nId,
125 : : Window* pParent,
126 : : const Rectangle& rScreenRect,
127 : : const XubString& rText );
128 : : static void HideTip( sal_uLong nId );
129 : : };
130 : :
131 : : #endif // _SV_HELP_HXX
132 : :
133 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|