update credits
[LibreOffice.git] / svtools / source / hatchwindow / ipwin.hxx
blob152c882611947ba1ee9f82d9f9bb9e27d1ae199a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 _IPWIN_HXX
21 #define _IPWIN_HXX
23 #include <tools/gen.hxx>
24 #include <vcl/window.hxx>
26 /********************** SvResizeHelper ***********************************
27 *************************************************************************/
28 class SvResizeHelper
30 Size aBorder;
31 Rectangle aOuter;
32 short nGrab; // -1 kein Grab, 0 - 7, 8 = Move, siehe FillHandle...
33 Point aSelPos;
34 sal_Bool bResizeable;
35 public:
36 SvResizeHelper();
38 void SetResizeable( sal_Bool b ) { bResizeable = b; }
39 short GetGrab() const { return nGrab; }
40 void SetBorderPixel( const Size & rBorderP )
41 { aBorder = rBorderP; }
42 const Size & GetBorderPixel() const { return aBorder; }
43 const Rectangle & GetOuterRectPixel() const
44 { return aOuter; }
45 void SetOuterRectPixel( const Rectangle & rRect )
46 { aOuter = rRect; }
47 Rectangle GetInnerRectPixel() const
49 Rectangle aRect( aOuter );
50 aRect.Top() += aBorder.Height();
51 aRect.Left() += aBorder.Width();
52 aRect.Bottom() -= aBorder.Height();
53 aRect.Right() -= aBorder.Width();
54 return aRect;
56 // Im Uhrzeigersinn, beginnend bei Linksoben
57 void FillHandleRectsPixel( Rectangle aRects[ 8 ] ) const;
58 void FillMoveRectsPixel( Rectangle aRects[ 4 ] ) const;
59 void Draw( OutputDevice * );
60 void InvalidateBorder( Window * );
61 sal_Bool SelectBegin( Window *, const Point & rPos );
62 short SelectMove( Window * pWin, const Point & rPos );
63 Point GetTrackPosPixel( const Rectangle & rRect ) const;
64 Rectangle GetTrackRectPixel( const Point & rTrackPos ) const;
65 void ValidateRect( Rectangle & rValidate ) const;
66 sal_Bool SelectRelease( Window *, const Point & rPos, Rectangle & rOutPosSize );
67 void Release( Window * pWin );
70 /********************** SvResizeWindow ***********************************
71 *************************************************************************/
72 class VCLXHatchWindow;
73 class SvResizeWindow : public Window
75 Pointer m_aOldPointer;
76 short m_nMoveGrab; // Letzer Pointertyp
77 SvResizeHelper m_aResizer;
78 sal_Bool m_bActive;
80 VCLXHatchWindow* m_pWrapper;
81 public:
82 SvResizeWindow( Window* pParent, VCLXHatchWindow* pWrapper );
84 void SetHatchBorderPixel( const Size & rSize );
86 void SelectMouse( const Point & rPos );
87 virtual void MouseButtonUp( const MouseEvent & rEvt );
88 virtual void MouseMove( const MouseEvent & rEvt );
89 virtual void MouseButtonDown( const MouseEvent & rEvt );
90 virtual void KeyInput( const KeyEvent & rEvt );
91 virtual void Resize();
92 virtual void Paint( const Rectangle & );
93 virtual long Notify( NotifyEvent& rNEvt );
94 virtual long PreNotify( NotifyEvent& rNEvt );
96 void QueryObjAreaPixel( Rectangle & );
97 void RequestObjAreaPixel( const Rectangle & );
100 #endif // _IPWIN_HXX
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */