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 <vcl/timer.hxx>
23 #include <sfx2/request.hxx>
24 #include <svx/svdobj.hxx>
25 #include <vcl/window.hxx>
34 // Return values for command
38 /** Base class for all functions */
43 ScTabViewShell
& rViewShell
;
44 VclPtr
<vcl::Window
> pWindow
;
47 SfxRequest aSfxRequest
;
49 Timer aScrollTimer
; // for Autoscrolling
50 DECL_LINK( ScrollHdl
, Timer
*, void );
51 void ForceScroll(const Point
& aPixPos
);
53 Timer aDragTimer
; // for Drag&Drop
54 DECL_LINK( DragTimerHdl
, Timer
*, void );
55 DECL_LINK( DragHdl
, void *, void );
57 Point aMDPos
; // Position of MouseButtonDown
59 // member to hold state of the mouse buttons for creation
60 // of own MouseEvents (like in ScrollHdl)
65 FuPoor(ScTabViewShell
& rViewSh
, vcl::Window
* pWin
, ScDrawView
* pView
,
66 SdrModel
* pDoc
, const SfxRequest
& rReq
);
70 void SetMouseButtonCode(sal_uInt16 nNew
) { if(nNew
!= mnCode
) mnCode
= nNew
; }
71 sal_uInt16
GetMouseButtonCode() const { return mnCode
; }
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; }
77 // moved from inline to *.cxx
78 virtual bool MouseButtonUp(const MouseEvent
& rMEvt
); // { return FALSE; }
80 // moved from inline to *.cxx
81 virtual bool MouseButtonDown(const MouseEvent
& rMEvt
); // { return FALSE; }
83 sal_uInt8
Command(const CommandEvent
& rCEvt
);
85 virtual void Activate();
86 virtual void Deactivate();
88 void SetWindow(vcl::Window
* pWin
) { pWindow
= pWin
; }
90 sal_uInt16
GetSlotID() const { return aSfxRequest
.GetSlot(); }
92 bool IsDetectiveHit( const Point
& rLogicPos
);
96 // Create default drawing objects via keyboard
97 virtual rtl::Reference
<SdrObject
> CreateDefaultObject(const sal_uInt16 nID
, const tools::Rectangle
& rRectangle
);
100 static void ImpForceQuadratic(tools::Rectangle
& rRect
);
104 virtual bool doConstructOrthogonal() const;
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */