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