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 #ifndef _GEN_HXX //autogen
35 #include <tools/gen.hxx>
38 #ifndef _WINDOW_HXX //autogen
39 #include <vcl/window.hxx>
41 #include <bf_so3/so2ref.hxx>
42 #include <bf_so3/iface.hxx>
44 #ifndef INCLUDED_SO3DLLAPI_H
45 #include "bf_so3/so3dllapi.h"
50 /********************** SvResizeHelper ***********************************
51 *************************************************************************/
52 class SO3_DLLPUBLIC SvResizeHelper
57 short nGrab
; // -1 kein Grab, 0 - 7, 8 = Move, siehe FillHandle...
63 void SetResizeable( BOOL b
) { bResizeable
= b
; }
64 short GetGrab() const { return nGrab
; }
65 void SetBorderPixel( const Size
& rBorderP
)
66 { aBorder
= rBorderP
; }
67 const Size
& GetBorderPixel() const { return aBorder
; }
68 const Rectangle
& GetOuterRectPixel() const
70 void SetOuterRectPixel( const Rectangle
& rRect
)
72 Rectangle
GetInnerRectPixel() const
74 Rectangle
aRect( aOuter
);
75 aRect
.Top() += aBorder
.Height();
76 aRect
.Left() += aBorder
.Width();
77 aRect
.Bottom() -= aBorder
.Height();
78 aRect
.Right() -= aBorder
.Width();
81 // Im Uhrzeigersinn, beginnend bei Linksoben
82 void FillHandleRectsPixel( Rectangle aRects
[ 8 ] ) const;
83 void FillMoveRectsPixel( Rectangle aRects
[ 4 ] ) const;
84 void Draw( OutputDevice
* );
85 void InvalidateBorder( Window
* );
86 BOOL
SelectBegin( Window
*, const Point
& rPos
);
87 short SelectMove( Window
* pWin
, const Point
& rPos
);
88 Point
GetTrackPosPixel( const Rectangle
& rRect
) const;
89 Rectangle
GetTrackRectPixel( const Point
& rTrackPos
) const;
90 void ValidateRect( Rectangle
& rValidate
) const;
91 BOOL
SelectRelease( Window
*, const Point
& rPos
, Rectangle
& rOutPosSize
);
92 void Release( Window
* pWin
);
95 /********************** SvResizeWindow ***********************************
96 *************************************************************************/
97 class SO3_DLLPUBLIC SvResizeWindow
: public Window
101 short nMoveGrab
; // Letzer Pointertyp
103 Point aPosCorrection
;
106 SvResizeHelper aResizer
;
107 SO3_DLLPRIVATE
void AdjustObjWin();
109 SvResizeWindow( Window
* pParent
);
111 void SetObjWin( Window
* pNewWin
);
112 Window
* GetObjWin() const
115 void SetHatchBorderPixel( const Size
& rSize
)
117 aResizer
.SetBorderPixel( rSize
);
120 const Size
& GetHatchBorderPixel() const
121 { return aResizer
.GetBorderPixel(); }
123 const SvBorder
& GetBorderPixel() const
126 SvBorder
GetAllBorderPixel() const
128 SvBorder
aB( aBorder
);
129 return aB
+= GetHatchBorderPixel();
132 void SetPosCorrectionPixel( const Point
& rNewCorr
)
133 { aPosCorrection
= rNewCorr
; }
134 const Point
& GetPosCorrectionPixel() const
135 { return aPosCorrection
; }
137 Rectangle
CalcInnerRectPixel( const Point
& rPos
, const Size
& rSize
) const;
138 Rectangle
GetInnerRectPixel() const;
140 void SetInnerPosSizePixel( const Point
&, const Size
& );
142 void TerminateResizing() { aResizer
.Release( this ); }
144 void SelectMouse( const Point
& rPos
);
145 void MouseButtonUp( const MouseEvent
& rEvt
);
146 void MouseMove( const MouseEvent
& rEvt
);
147 void MouseButtonDown( const MouseEvent
& rEvt
);
148 void KeyInput( const KeyEvent
& rEvt
);
150 void Paint( const Rectangle
& );
151 virtual void QueryObjAreaPixel( Rectangle
& );
152 virtual void RequestObjAreaPixel( const Rectangle
& );
155 /********************** SvInPlaceWindow **********************************
156 *************************************************************************/
157 class SvInPlaceEnvironment
;
158 class SO3_DLLPUBLIC SvInPlaceWindow
: public SvResizeWindow
161 SvInPlaceEnvironment
* pIPEnv
;
163 SvInPlaceWindow( Window
* pParent
, SvInPlaceEnvironment
* );
164 void KeyInput( const KeyEvent
& rEvt
);
165 virtual void QueryObjAreaPixel( Rectangle
& );
166 virtual void RequestObjAreaPixel( const Rectangle
& );
169 /********************** SvInPlaceClipWindow ******************************
170 *************************************************************************/
171 class SO3_DLLPUBLIC SvInPlaceClipWindow
: public Window
174 SvResizeWindow
* pResizeWin
;
177 SvInPlaceClipWindow( Window
* pParent
);
179 void SetResizeWin( SvResizeWindow
* pNewWin
)
180 { pResizeWin
= pNewWin
; }
181 SvResizeWindow
* GetResizeWin() const
182 { return pResizeWin
; }
184 void SetRectsPixel( const Rectangle
& rObjRect
,
185 const Rectangle
& rInPlaceWinMaxRect
);