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 .
22 #include <tools/gen.hxx>
23 #include <vcl/window.hxx>
26 /********************** SvResizeHelper ***********************************
27 *************************************************************************/
31 tools::Rectangle aOuter
;
32 short nGrab
; // -1 no Grab, 0 - 7, 8 = Move, see FillHandle...
41 void SetBorderPixel(const Size
& rBorderP
)
45 void SetOuterRectPixel(const tools::Rectangle
& rRect
)
49 // Clockwise, start at upper left
51 std::array
<tools::Rectangle
,8> FillHandleRectsPixel() const;
52 std::array
<tools::Rectangle
,4> FillMoveRectsPixel() const;
53 void Draw(vcl::RenderContext
& rRenderContext
);
54 void InvalidateBorder( vcl::Window
* );
55 bool SelectBegin( vcl::Window
*, const Point
& rPos
);
56 short SelectMove( vcl::Window
* pWin
, const Point
& rPos
);
57 Point
GetTrackPosPixel( const tools::Rectangle
& rRect
) const;
58 tools::Rectangle
GetTrackRectPixel( const Point
& rTrackPos
) const;
59 void ValidateRect( tools::Rectangle
& rValidate
) const;
60 bool SelectRelease( vcl::Window
*, const Point
& rPos
, tools::Rectangle
& rOutPosSize
);
61 void Release( vcl::Window
* pWin
);
64 /********************** SvResizeWindow ***********************************
65 *************************************************************************/
66 class VCLXHatchWindow
;
67 class SvResizeWindow
: public vcl::Window
69 PointerStyle m_aOldPointer
;
70 short m_nMoveGrab
; // last pointer type
71 SvResizeHelper m_aResizer
;
74 VCLXHatchWindow
* m_pWrapper
;
76 SvResizeWindow( vcl::Window
* pParent
, VCLXHatchWindow
* pWrapper
);
78 void SetHatchBorderPixel( const Size
& rSize
);
80 void SelectMouse( const Point
& rPos
);
81 virtual void MouseButtonUp( const MouseEvent
& rEvt
) override
;
82 virtual void MouseMove( const MouseEvent
& rEvt
) override
;
83 virtual void MouseButtonDown( const MouseEvent
& rEvt
) override
;
84 virtual void KeyInput( const KeyEvent
& rEvt
) override
;
85 virtual void Resize() override
;
86 virtual void Paint( vcl::RenderContext
& /*rRenderContext*/, const tools::Rectangle
& ) override
;
87 virtual bool EventNotify( NotifyEvent
& rNEvt
) override
;
88 virtual bool PreNotify( NotifyEvent
& rNEvt
) override
;
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */