xref: /trunk/main/dbaccess/source/ui/inc/ScrollHelper.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef DBAUI_SCROLLHELPER_HXX
28 #define DBAUI_SCROLLHELPER_HXX
29 
30 #ifndef _LINK_HXX
31 #include <tools/link.hxx>
32 #endif
33 #ifndef _SV_GEN_HXX
34 #include <tools/gen.hxx>
35 #endif
36 #ifndef _SV_TIMER_HXX
37 #include <vcl/timer.hxx>
38 #endif
39 
40 namespace dbaui
41 {
42     class OScrollHelper
43     {
44         Link    m_aUpScroll;
45         Link    m_aDownScroll;
46     public:
47         /** default contructor
48         */
49         OScrollHelper();
50 
51         ~OScrollHelper();
52 
53         /** set the memthod which should be called when scrolling up
54             @param  _rUpScroll
55                 the method to set
56         */
57         inline void setUpScrollMethod( const Link& _rUpScroll )
58         {
59             m_aUpScroll = _rUpScroll;
60         }
61 
62         /** set the memthod which should be called when scrolling down
63             @param  _rDownScroll
64                 the method to set
65         */
66         inline void setDownScrollMethod( const Link& _rDownScroll )
67         {
68             m_aDownScroll = _rDownScroll;
69         }
70 
71         /** check if a scroll method has to be called
72             @param  _rPoint
73                 the current selection point
74             @param  _rOutputSize
75                 the output size of the window
76         */
77         void scroll(const Point& _rPoint, const Size& _rOutputSize);
78     };
79 }
80 #endif // DBAUI_SCROLLHELPER_HXX
81 
82