xref: /AOO41X/main/vcl/inc/helpwin.hxx (revision ebfcd9af2ce496a86a62eef7379364d0a42a7f96)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SV_HELPWIN_HXX
25 #define _SV_HELPWIN_HXX
26 
27 #include <vcl/floatwin.hxx>
28 #include <vcl/timer.hxx>
29 
30 // ------------------
31 // - HelpTextWindow -
32 // ------------------
33 
34 class HelpTextWindow : public FloatingWindow
35 {
36 private:
37     Point               maPos;
38     Rectangle           maHelpArea; // Wenn naechste Hilfe fuers gleiche Rectangle, gleicher Text, dann Fenster stehen lassen
39 
40     Rectangle           maTextRect; // Bei umgebrochenen Text in QuickHelp
41 
42     String              maHelpText;
43     String              maStatusText;
44 
45     Timer               maShowTimer;
46     Timer               maHideTimer;
47 
48     sal_uInt16              mnHelpWinStyle;
49     sal_uInt16              mnStyle;
50 
51 protected:
52                         DECL_LINK( TimerHdl, Timer* );
53     virtual void        Paint( const Rectangle& );
54     virtual void        RequestHelp( const HelpEvent& rHEvt );
55     virtual String      GetText() const;
56     void                ImplShow();
57 
58 public:
59                         HelpTextWindow( Window* pParent, const String& rText, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle );
60                         ~HelpTextWindow();
61 
GetHelpText() const62     const String&       GetHelpText() const { return maHelpText; }
63     void                SetHelpText( const String& rHelpText );
GetWinStyle() const64     sal_uInt16          GetWinStyle() const { return mnHelpWinStyle; }
GetStyle() const65     sal_uInt16          GetStyle() const { return mnStyle; }
66 
67     // Nur merken:
SetStatusText(const String & rStatusText)68     void                SetStatusText( const String& rStatusText ) { maStatusText = rStatusText; }
SetHelpArea(const Rectangle & rRect)69     void                SetHelpArea( const Rectangle& rRect ) { maHelpArea = rRect; }
70 
71     void                ShowHelp( sal_uInt16 nDelayMode );
72 
73     Size                CalcOutSize() const;
GetHelpArea() const74     const Rectangle&    GetHelpArea() const { return maHelpArea; }
75 
76     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
77 
78     sal_Bool                RegisterAccessibleParent();
79     void                RevokeAccessibleParent();
80 };
81 
82 void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
83         const String& rHelpText, const String& rStatusText,
84         const Point& rScreenPos, const Rectangle* pHelpArea = NULL );
85 void ImplDestroyHelpWindow( bool bUpdateHideTime );
86 void ImplSetHelpWindowPos( Window* pHelpWindow, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
87                             const Point& rPos, const Rectangle* pHelpArea );
88 
89 #endif // _SV_HELPWIN_HXX
90