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 _SCRWIN_HXX
30 : : #define _SCRWIN_HXX
31 : :
32 : : #include "svtools/svtdllapi.h"
33 : :
34 : : #include <vcl/scrbar.hxx>
35 : :
36 : : class DataChangedEvent;
37 : :
38 : : // -------------------------
39 : : // - ScrollableWindow-Type -
40 : : // -------------------------
41 : :
42 : : typedef sal_uInt16 ScrollableWindowFlags;
43 : :
44 : : #define SCRWIN_THUMBDRAGGING 1
45 : : #define SCRWIN_VCENTER 2
46 : : #define SCRWIN_HCENTER 4
47 : : #define SCRWIN_DEFAULT (SCRWIN_THUMBDRAGGING | SCRWIN_VCENTER | SCRWIN_HCENTER)
48 : :
49 : : // --------------------
50 : : // - ScrollableWindow -
51 : : // --------------------
52 : :
53 [ + - ][ + - ]: 34 : class SVT_DLLPUBLIC ScrollableWindow: public Window
[ + - ][ - + ]
54 : : {
55 : : private:
56 : : Point aPixOffset; // offset to virtual window (pixel)
57 : : Size aTotPixSz; // total size of virtual window (pixel)
58 : : long nLinePixH; // size of a line/column (pixel)
59 : : long nColumnPixW;
60 : :
61 : : ScrollBar aVScroll; // the scrollbars
62 : : ScrollBar aHScroll;
63 : : ScrollBarBox aCornerWin; // window in the bottom right corner
64 : : sal_Bool bScrolling:1, // user controlled scrolling
65 : : bHandleDragging:1, // scroll window while dragging
66 : : bHCenter:1,
67 : : bVCenter:1;
68 : :
69 : : #ifdef _SVT_SCRWIN_CXX
70 : : SVT_DLLPRIVATE void ImpInitialize( ScrollableWindowFlags nFlags );
71 : : DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar * );
72 : : DECL_DLLPRIVATE_LINK( EndScrollHdl, ScrollBar * );
73 : : #endif
74 : :
75 : : public:
76 : : ScrollableWindow( Window* pParent, WinBits nBits = 0,
77 : : ScrollableWindowFlags = SCRWIN_DEFAULT );
78 : :
79 : : virtual void Resize();
80 : : virtual void Command( const CommandEvent& rCEvt );
81 : : virtual void DataChanged( const DataChangedEvent& rDEvt );
82 : :
83 : : virtual void StartScroll();
84 : : virtual void EndScroll( long nDeltaX, long nDeltaY );
85 : :
86 : : using OutputDevice::SetMapMode;
87 : : virtual void SetMapMode( const MapMode& rNewMapMode );
88 : : virtual MapMode GetMapMode() const;
89 : :
90 : : void SetTotalSize( const Size& rNewSize );
91 : 41 : Size GetTotalSize() { return PixelToLogic( aTotPixSz ); }
92 : :
93 : : using Window::Scroll;
94 : : virtual void Scroll( long nDeltaX, long nDeltaY, sal_uInt16 nFlags = 0 );
95 : :
96 : : private:
97 : : SVT_DLLPRIVATE Size GetOutputSizePixel() const;
98 : : };
99 : :
100 : : #endif
101 : :
102 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|