LibreOffice Module toolkit (master) 1
ipwin.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <tools/gen.hxx>
23#include <vcl/window.hxx>
24#include <array>
25
26/********************** SvResizeHelper ***********************************
27*************************************************************************/
29{
32 short nGrab; // -1 no Grab, 0 - 7, 8 = Move, see FillHandle...
34public:
36
37 short GetGrab() const
38 {
39 return nGrab;
40 }
41 void SetBorderPixel(const Size & rBorderP)
42 {
43 aBorder = rBorderP;
44 }
46 {
47 aOuter = rRect;
48 }
49 // Clockwise, start at upper left
50
51 std::array<tools::Rectangle,8> FillHandleRectsPixel() const;
52 std::array<tools::Rectangle,4> FillMoveRectsPixel() const;
53 void Draw(vcl::RenderContext& rRenderContext);
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 );
62};
63
64/********************** SvResizeWindow ***********************************
65*************************************************************************/
66class VCLXHatchWindow;
68{
70 short m_nMoveGrab; // last pointer type
73
75public:
76 SvResizeWindow( vcl::Window* pParent, VCLXHatchWindow* pWrapper );
77
78 void SetHatchBorderPixel( const Size & rSize );
79
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;
89};
90
91
92/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools::Rectangle GetTrackRectPixel(const Point &rTrackPos) const
Definition: ipwin.cxx:266
bool SelectRelease(vcl::Window *, const Point &rPos, tools::Rectangle &rOutPosSize)
Definition: ipwin.cxx:397
tools::Rectangle aOuter
Definition: ipwin.hxx:31
short SelectMove(vcl::Window *pWin, const Point &rPos)
Definition: ipwin.cxx:176
void ValidateRect(tools::Rectangle &rValidate) const
Definition: ipwin.cxx:339
std::array< tools::Rectangle, 8 > FillHandleRectsPixel() const
Definition: ipwin.cxx:47
Point aSelPos
Definition: ipwin.hxx:33
Point GetTrackPosPixel(const tools::Rectangle &rRect) const
Definition: ipwin.cxx:198
SvResizeHelper()
Definition: ipwin.cxx:36
std::array< tools::Rectangle, 4 > FillMoveRectsPixel() const
Definition: ipwin.cxx:92
void SetOuterRectPixel(const tools::Rectangle &rRect)
Definition: ipwin.hxx:45
void Draw(vcl::RenderContext &rRenderContext)
Definition: ipwin.cxx:119
short nGrab
Definition: ipwin.hxx:32
Size aBorder
Definition: ipwin.hxx:30
bool SelectBegin(vcl::Window *, const Point &rPos)
Definition: ipwin.cxx:156
void SetBorderPixel(const Size &rBorderP)
Definition: ipwin.hxx:41
void InvalidateBorder(vcl::Window *)
Definition: ipwin.cxx:144
short GetGrab() const
Definition: ipwin.hxx:37
void Release(vcl::Window *pWin)
Definition: ipwin.cxx:417
virtual void Paint(vcl::RenderContext &, const tools::Rectangle &) override
Definition: ipwin.cxx:590
virtual bool PreNotify(NotifyEvent &rNEvt) override
Definition: ipwin.cxx:595
virtual void MouseButtonDown(const MouseEvent &rEvt) override
Definition: ipwin.cxx:502
SvResizeWindow(vcl::Window *pParent, VCLXHatchWindow *pWrapper)
Definition: ipwin.cxx:433
virtual void KeyInput(const KeyEvent &rEvt) override
Definition: ipwin.cxx:564
virtual void MouseMove(const MouseEvent &rEvt) override
Definition: ipwin.cxx:513
void SetHatchBorderPixel(const Size &rSize)
Definition: ipwin.cxx:454
virtual void Resize() override
Definition: ipwin.cxx:578
virtual void MouseButtonUp(const MouseEvent &rEvt) override
Definition: ipwin.cxx:537
void SelectMouse(const Point &rPos)
Definition: ipwin.cxx:464
PointerStyle m_aOldPointer
Definition: ipwin.hxx:69
VCLXHatchWindow * m_pWrapper
Definition: ipwin.hxx:74
bool m_bActive
Definition: ipwin.hxx:72
SvResizeHelper m_aResizer
Definition: ipwin.hxx:71
short m_nMoveGrab
Definition: ipwin.hxx:70
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: ipwin.cxx:606
PointerStyle