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