merge the formfield patch from ooo-build
[ooovba.git] / svtools / inc / sectctr.hxx
blobe9d39dfaf116470ac4f22ec6c13f47d1f9839d2e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sectctr.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SV_SECTCTR_HXX
32 #define _SV_SECTCTR_HXX
34 #include <vcl/sv.h>
35 #include <vcl/ctrl.hxx>
37 class ImplSplitWindow;
38 class ScrollBar;
39 class ScrollBarBox;
40 class SvSection;
42 #define SECTION_APPEND ((USHORT)0xFFFF)
43 #define SECTION_NOTFOUND ((USHORT)0xFFFF)
45 #define WB_SECTION_STYLE WB_VSCROLL | WB_HSCROLL | WB_TABSTOP
47 class SvSectionControl : public Control
49 private:
51 Window aSplitWinContainer;
52 ImplSplitWindow* pSplitWin;
53 ScrollBar* pVScrollBar;
54 ScrollBar* pHScrollBar;
55 ScrollBarBox* pScrollBarBox;
56 DockingWindow* pDummy;
57 long nRealHeight;
58 long nMaxHeight;
59 long nMinWidth;
60 Wallpaper aWallpaper;
62 DECL_LINK( ScrollHdl, ScrollBar* );
63 DECL_LINK( EndScrollHdl, ScrollBar* );
66 protected:
68 virtual void Resize();
69 virtual void Paint( const Rectangle& rRect );
70 virtual void StateChanged( StateChangedType nStateChange );
71 virtual void DataChanged( const DataChangedEvent& rDCEvt );
72 virtual void Command( const CommandEvent& rCEvt );
73 virtual long PreNotify( NotifyEvent& rNEvt );
74 virtual long Notify( NotifyEvent& rNEvt );
75 virtual long KeyEventNotify( const KeyEvent& rKEvt );
76 using Control::SetPosSizePixel;
77 virtual void SetPosSizePixel( long nX, long nY,long nWidth, long nHeight,USHORT nFlags);
81 long CalcMaxHeight();
82 long CalcRealHeight();
83 long CalcSectionWidth();
85 void SetScrollBars(BOOL bVert,BOOL bHorz);
86 void ShowScrollBarBox();
87 void UpdateScrollBars();
89 BOOL VScrollResize(Size &aSize);
90 BOOL HScrollResize(Size &aSize);
91 void SetChildPos(long nPos, BOOL bScrolling = TRUE);
93 public:
94 SvSectionControl( Window* pParent,WinBits nStyle = WB_SECTION_STYLE);
95 SvSectionControl( Window* pParent, const ResId& rResId );
96 ~SvSectionControl();
99 void InsertSection( USHORT nSectionId,SvSection* pSection,long nSize,USHORT nPos);
100 void InsertSection( USHORT nSectionId,SvSection* pSection,USHORT nPos);
101 void RemoveSection( USHORT nSectionId );
102 void Clear();
104 USHORT GetSectionCount() const;
105 USHORT GetSectionId( USHORT nPos ) const;
106 USHORT GetSectionPos( USHORT nSectionId ) const;
107 USHORT GetSectionId( const Point& rPos ) const;
109 void SetSectionSize( USHORT nId, long nNewSize );
110 long GetSectionSize( USHORT nId ) const;
113 void SetCurSectionId( USHORT nSectionId );
114 USHORT GetCurSectionId() const;
116 void SetFirstSectionId( USHORT nSectionId );
117 USHORT GetFirstSectionId() const { return GetSectionId( mnFirstSectionPos ); }
119 void MakeVisible( USHORT nSectionId );
122 void SetSectionWidth( USHORT nSectionId, long nWidth);
123 long GetSectionWidth( USHORT nSectionId ) const;
125 void SetSection( USHORT nSectionId, SvSection* pPage );
126 SvSection* GetSection( USHORT nSectionId ) const;
128 void SetSectionText( USHORT nSectionId, const XubString& rText );
129 XubString GetSectionText( USHORT nSectionId ) const;
131 void SetHelpText( USHORT nSectionId, const XubString& rText );
132 const XubString& GetHelpText( USHORT nSectionId ) const;
134 void SetHelpId( USHORT nSectionId, ULONG nHelpId );
135 ULONG GetHelpId( USHORT nSectionId ) const;
137 void SetHelpText( const XubString& rText )
138 { Control::SetHelpText( rText ); }
139 const XubString& GetHelpText() const
140 { return Control::GetHelpText(); }
142 void SetHelpId( ULONG nId )
143 { Control::SetHelpId( nId ); }
144 ULONG GetHelpId() const
145 { return Control::GetHelpId(); }
147 using Control::SetBackground;
148 void SetBackground( const Wallpaper& rBackground ){aWallpaper=rBackground; }
149 const Wallpaper& GetBackground() const { return aWallpaper; }
154 #endif