LibreOffice Module sc (master) 1
fupoor.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 <vcl/timer.hxx>
23#include <sfx2/request.hxx>
24#include <svx/svdobj.hxx>
25#include <vcl/window.hxx>
26
27class ScDrawView;
28class ScTabViewShell;
29class SdrModel;
30class CommandEvent;
31class KeyEvent;
32class MouseEvent;
33
34// Return values for command
35#define SC_CMD_NONE 0
36#define SC_CMD_USED 1
37
39class FuPoor
40{
41protected:
46
48
49 Timer aScrollTimer; // for Autoscrolling
50 DECL_LINK( ScrollHdl, Timer *, void );
51 void ForceScroll(const Point& aPixPos);
52
53 Timer aDragTimer; // for Drag&Drop
54 DECL_LINK( DragTimerHdl, Timer *, void );
55 DECL_LINK( DragHdl, void *, void );
57 Point aMDPos; // Position of MouseButtonDown
58
59 // member to hold state of the mouse buttons for creation
60 // of own MouseEvents (like in ScrollHdl)
61private:
62 sal_uInt16 mnCode;
63
64public:
66 SdrModel* pDoc, const SfxRequest& rReq);
67 virtual ~FuPoor();
68
69 // see member
70 void SetMouseButtonCode(sal_uInt16 nNew) { if(nNew != mnCode) mnCode = nNew; }
71 sal_uInt16 GetMouseButtonCode() const { return mnCode; }
72
73 // Mouse- & Key-Events; return value=TRUE: Event was processed
74 virtual bool KeyInput(const KeyEvent& rKEvt);
75 virtual bool MouseMove(const MouseEvent&) { return false; }
76
77 // moved from inline to *.cxx
78 virtual bool MouseButtonUp(const MouseEvent& rMEvt); // { return FALSE; }
79
80 // moved from inline to *.cxx
81 virtual bool MouseButtonDown(const MouseEvent& rMEvt); // { return FALSE; }
82
83 sal_uInt8 Command(const CommandEvent& rCEvt);
84
85 virtual void Activate();
86 virtual void Deactivate();
87
88 void SetWindow(vcl::Window* pWin) { pWindow = pWin; }
89
90 sal_uInt16 GetSlotID() const { return aSfxRequest.GetSlot(); }
91
92 bool IsDetectiveHit( const Point& rLogicPos );
93
94 void StopDragTimer();
95
96 // Create default drawing objects via keyboard
97 virtual rtl::Reference<SdrObject> CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle);
98
99protected:
100 static void ImpForceQuadratic(tools::Rectangle& rRect);
101
102public:
103 // #i33136#
104 virtual bool doConstructOrthogonal() const;
105};
106
107/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class for all functions.
Definition: fupoor.hxx:40
virtual bool doConstructOrthogonal() const
Definition: fupoor.cxx:241
Point aMDPos
Definition: fupoor.hxx:57
ScDrawView * pView
Definition: fupoor.hxx:42
DECL_LINK(DragTimerHdl, Timer *, void)
void StopDragTimer()
Definition: fupoor.cxx:211
sal_uInt16 mnCode
Definition: fupoor.hxx:62
bool IsDetectiveHit(const Point &rLogicPos)
Definition: fupoor.cxx:186
virtual bool MouseButtonDown(const MouseEvent &rMEvt)
Definition: fupoor.cxx:128
DECL_LINK(ScrollHdl, Timer *, void)
sal_uInt16 GetMouseButtonCode() const
Definition: fupoor.hxx:71
bool bIsInDragMode
Definition: fupoor.hxx:56
virtual bool MouseButtonUp(const MouseEvent &rMEvt)
Definition: fupoor.cxx:120
DECL_LINK(DragHdl, void *, void)
virtual bool KeyInput(const KeyEvent &rKEvt)
Definition: fupoor.cxx:137
virtual rtl::Reference< SdrObject > CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle &rRectangle)
Definition: fupoor.cxx:218
virtual bool MouseMove(const MouseEvent &)
Definition: fupoor.hxx:75
sal_uInt8 Command(const CommandEvent &rCEvt)
Definition: fupoor.cxx:142
sal_uInt16 GetSlotID() const
Definition: fupoor.hxx:90
virtual void Activate()
Definition: fupoor.cxx:61
Timer aScrollTimer
Definition: fupoor.hxx:49
void SetMouseButtonCode(sal_uInt16 nNew)
Definition: fupoor.hxx:70
SfxRequest aSfxRequest
Definition: fupoor.hxx:47
void SetWindow(vcl::Window *pWin)
Definition: fupoor.hxx:88
static void ImpForceQuadratic(tools::Rectangle &rRect)
Definition: fupoor.cxx:224
SdrModel * pDrDoc
Definition: fupoor.hxx:45
void ForceScroll(const Point &aPixPos)
Definition: fupoor.cxx:72
FuPoor(ScTabViewShell &rViewSh, vcl::Window *pWin, ScDrawView *pView, SdrModel *pDoc, const SfxRequest &rReq)
Definition: fupoor.cxx:35
virtual void Deactivate()
Definition: fupoor.cxx:65
virtual ~FuPoor()
Definition: fupoor.cxx:55
ScTabViewShell & rViewShell
Definition: fupoor.hxx:43
Timer aDragTimer
Definition: fupoor.hxx:53
VclPtr< vcl::Window > pWindow
Definition: fupoor.hxx:44
sal_uInt16 GetSlot() const
unsigned char sal_uInt8