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_HELPWIN_HXX
30 : : #define _SV_HELPWIN_HXX
31 : :
32 : : #include <vcl/floatwin.hxx>
33 : : #include <vcl/timer.hxx>
34 : :
35 : : // ------------------
36 : : // - HelpTextWindow -
37 : : // ------------------
38 : :
39 : : class HelpTextWindow : public FloatingWindow
40 : : {
41 : : private:
42 : : Point maPos;
43 : : Rectangle maHelpArea; // If next Help for the same rectangle w/ same text, then keep window
44 : :
45 : : Rectangle maTextRect; // For wrapped text in QuickHelp
46 : :
47 : : String maHelpText;
48 : : String maStatusText;
49 : :
50 : : Timer maShowTimer;
51 : : Timer maHideTimer;
52 : :
53 : : sal_uInt16 mnHelpWinStyle;
54 : : sal_uInt16 mnStyle;
55 : :
56 : : protected:
57 : : DECL_LINK( TimerHdl, Timer* );
58 : : virtual void Paint( const Rectangle& );
59 : : virtual void RequestHelp( const HelpEvent& rHEvt );
60 : : virtual String GetText() const;
61 : : void ImplShow();
62 : :
63 : : public:
64 : : HelpTextWindow( Window* pParent, const String& rText, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle );
65 : : ~HelpTextWindow();
66 : :
67 : 0 : const String& GetHelpText() const { return maHelpText; }
68 : : void SetHelpText( const String& rHelpText );
69 : 0 : sal_uInt16 GetWinStyle() const { return mnHelpWinStyle; }
70 : 0 : sal_uInt16 GetStyle() const { return mnStyle; }
71 : :
72 : : // Nur merken:
73 : 0 : void SetStatusText( const String& rStatusText ) { maStatusText = rStatusText; }
74 : 0 : void SetHelpArea( const Rectangle& rRect ) { maHelpArea = rRect; }
75 : :
76 : : void ShowHelp( sal_uInt16 nDelayMode );
77 : :
78 : : Size CalcOutSize() const;
79 : 0 : const Rectangle& GetHelpArea() const { return maHelpArea; }
80 : :
81 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
82 : : };
83 : :
84 : : void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
85 : : const String& rHelpText, const String& rStatusText,
86 : : const Point& rScreenPos, const Rectangle* pHelpArea = NULL );
87 : : void ImplDestroyHelpWindow( bool bUpdateHideTime );
88 : : void ImplSetHelpWindowPos( Window* pHelpWindow, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
89 : : const Point& rPos, const Rectangle* pHelpArea );
90 : :
91 : : #endif // _SV_HELPWIN_HXX
92 : :
93 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|