1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ipwin.hxx,v $
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 ************************************************************************/
34 #include <tools/gen.hxx>
35 #include <vcl/window.hxx>
36 #include <tools/svborder.hxx>
38 /********************** SvResizeHelper ***********************************
39 *************************************************************************/
44 short nGrab
; // -1 kein Grab, 0 - 7, 8 = Move, siehe FillHandle...
50 void SetResizeable( BOOL b
) { bResizeable
= b
; }
51 short GetGrab() const { return nGrab
; }
52 void SetBorderPixel( const Size
& rBorderP
)
53 { aBorder
= rBorderP
; }
54 const Size
& GetBorderPixel() const { return aBorder
; }
55 const Rectangle
& GetOuterRectPixel() const
57 void SetOuterRectPixel( const Rectangle
& rRect
)
59 Rectangle
GetInnerRectPixel() const
61 Rectangle
aRect( aOuter
);
62 aRect
.Top() += aBorder
.Height();
63 aRect
.Left() += aBorder
.Width();
64 aRect
.Bottom() -= aBorder
.Height();
65 aRect
.Right() -= aBorder
.Width();
68 // Im Uhrzeigersinn, beginnend bei Linksoben
69 void FillHandleRectsPixel( Rectangle aRects
[ 8 ] ) const;
70 void FillMoveRectsPixel( Rectangle aRects
[ 4 ] ) const;
71 void Draw( OutputDevice
* );
72 void InvalidateBorder( Window
* );
73 BOOL
SelectBegin( Window
*, const Point
& rPos
);
74 short SelectMove( Window
* pWin
, const Point
& rPos
);
75 Point
GetTrackPosPixel( const Rectangle
& rRect
) const;
76 Rectangle
GetTrackRectPixel( const Point
& rTrackPos
) const;
77 void ValidateRect( Rectangle
& rValidate
) const;
78 BOOL
SelectRelease( Window
*, const Point
& rPos
, Rectangle
& rOutPosSize
);
79 void Release( Window
* pWin
);
82 /********************** SvResizeWindow ***********************************
83 *************************************************************************/
84 class VCLXHatchWindow
;
85 class SvResizeWindow
: public Window
87 Pointer m_aOldPointer
;
88 short m_nMoveGrab
; // Letzer Pointertyp
89 SvResizeHelper m_aResizer
;
92 VCLXHatchWindow
* m_pWrapper
;
94 SvResizeWindow( Window
* pParent
, VCLXHatchWindow
* pWrapper
);
96 void SetHatchBorderPixel( const Size
& rSize
);
98 void SelectMouse( const Point
& rPos
);
99 virtual void MouseButtonUp( const MouseEvent
& rEvt
);
100 virtual void MouseMove( const MouseEvent
& rEvt
);
101 virtual void MouseButtonDown( const MouseEvent
& rEvt
);
102 virtual void KeyInput( const KeyEvent
& rEvt
);
103 virtual void Resize();
104 virtual void Paint( const Rectangle
& );
105 virtual long Notify( NotifyEvent
& rNEvt
);
106 virtual long PreNotify( NotifyEvent
& rNEvt
);
108 void QueryObjAreaPixel( Rectangle
& );
109 void RequestObjAreaPixel( const Rectangle
& );