1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVTOOLS_SOURCE_HATCHWINDOW_IPWIN_HXX
21 #define INCLUDED_SVTOOLS_SOURCE_HATCHWINDOW_IPWIN_HXX
23 #include <tools/gen.hxx>
24 #include <vcl/window.hxx>
26 /********************** SvResizeHelper ***********************************
27 *************************************************************************/
32 short nGrab
; // -1 no Grab, 0 - 7, 8 = Move, see FillHandle...
38 void SetResizeable(bool b
)
46 void SetBorderPixel(const Size
& rBorderP
)
50 const Size
& GetBorderPixel() const
54 const Rectangle
& GetOuterRectPixel() const
58 void SetOuterRectPixel(const Rectangle
& rRect
)
62 Rectangle
GetInnerRectPixel() const
64 Rectangle
aRect( aOuter
);
65 aRect
.Top() += aBorder
.Height();
66 aRect
.Left() += aBorder
.Width();
67 aRect
.Bottom() -= aBorder
.Height();
68 aRect
.Right() -= aBorder
.Width();
71 // Clockwise, start at upper left
73 void FillHandleRectsPixel( Rectangle aRects
[ 8 ] ) const;
74 void FillMoveRectsPixel( Rectangle aRects
[ 4 ] ) const;
75 void Draw(vcl::RenderContext
& rRenderContext
);
76 void InvalidateBorder( vcl::Window
* );
77 bool SelectBegin( vcl::Window
*, const Point
& rPos
);
78 short SelectMove( vcl::Window
* pWin
, const Point
& rPos
);
79 Point
GetTrackPosPixel( const Rectangle
& rRect
) const;
80 Rectangle
GetTrackRectPixel( const Point
& rTrackPos
) const;
81 void ValidateRect( Rectangle
& rValidate
) const;
82 bool SelectRelease( vcl::Window
*, const Point
& rPos
, Rectangle
& rOutPosSize
);
83 void Release( vcl::Window
* pWin
);
86 /********************** SvResizeWindow ***********************************
87 *************************************************************************/
88 class VCLXHatchWindow
;
89 class SvResizeWindow
: public vcl::Window
91 Pointer m_aOldPointer
;
92 short m_nMoveGrab
; // last pointer type
93 SvResizeHelper m_aResizer
;
96 VCLXHatchWindow
* m_pWrapper
;
98 SvResizeWindow( vcl::Window
* pParent
, VCLXHatchWindow
* pWrapper
);
100 void SetHatchBorderPixel( const Size
& rSize
);
102 void SelectMouse( const Point
& rPos
);
103 virtual void MouseButtonUp( const MouseEvent
& rEvt
) SAL_OVERRIDE
;
104 virtual void MouseMove( const MouseEvent
& rEvt
) SAL_OVERRIDE
;
105 virtual void MouseButtonDown( const MouseEvent
& rEvt
) SAL_OVERRIDE
;
106 virtual void KeyInput( const KeyEvent
& rEvt
) SAL_OVERRIDE
;
107 virtual void Resize() SAL_OVERRIDE
;
108 virtual void Paint( vcl::RenderContext
& /*rRenderContext*/, const Rectangle
& ) SAL_OVERRIDE
;
109 virtual bool Notify( NotifyEvent
& rNEvt
) SAL_OVERRIDE
;
110 virtual bool PreNotify( NotifyEvent
& rNEvt
) SAL_OVERRIDE
;
112 void QueryObjAreaPixel( Rectangle
& );
113 void RequestObjAreaPixel( const Rectangle
& );
116 #endif // INCLUDED_SVTOOLS_SOURCE_HATCHWINDOW_IPWIN_HXX
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */