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 .
20 #ifndef _SC_FUPOOR_HXX
21 #define _SC_FUPOOR_HXX
23 #include <vcl/event.hxx>
24 #include <vcl/timer.hxx>
25 #include <sfx2/request.hxx>
33 // Create default drawing objects via keyboard
36 // Return values for command
39 #define SC_CMD_IGNORE 2
41 /** Base class for all functions */
46 ScTabViewShell
* pViewShell
;
50 SfxRequest aSfxRequest
;
53 Timer aScrollTimer
; // for Autoscrolling
54 DECL_LINK( ScrollHdl
, void * );
55 void ForceScroll(const Point
& aPixPos
);
57 Timer aDragTimer
; // for Drag&Drop
58 DECL_LINK( DragTimerHdl
, void * );
59 DECL_LINK( DragHdl
, void * );
60 sal_Bool bIsInDragMode
;
61 Point aMDPos
; // Position of MouseButtonDown
63 // member to hold state of the mouse buttons for creation
64 // of own MouseEvents (like in ScrollHdl)
69 FuPoor(ScTabViewShell
* pViewSh
, Window
* pWin
, ScDrawView
* pView
,
70 SdrModel
* pDoc
, SfxRequest
& rReq
);
74 void SetMouseButtonCode(sal_uInt16 nNew
) { if(nNew
!= mnCode
) mnCode
= nNew
; }
75 sal_uInt16
GetMouseButtonCode() const { return mnCode
; }
77 virtual void Paint(const Rectangle
&, Window
*) {}
80 virtual void DoCopy();
81 virtual void DoPaste();
83 // Mouse- & Key-Events; return value=TRUE: Event was processed
84 virtual sal_Bool
KeyInput(const KeyEvent
& rKEvt
);
85 virtual sal_Bool
MouseMove(const MouseEvent
&) { return false; }
87 // moved from inline to *.cxx
88 virtual sal_Bool
MouseButtonUp(const MouseEvent
& rMEvt
); // { return FALSE; }
90 // moved from inline to *.cxx
91 virtual sal_Bool
MouseButtonDown(const MouseEvent
& rMEvt
); // { return FALSE; }
93 virtual sal_uInt8
Command(const CommandEvent
& rCEvt
);
95 virtual void Activate();
96 virtual void Deactivate();
98 void SetWindow(Window
* pWin
) { pWindow
= pWin
; }
100 sal_uInt16
GetSlotID() const { return( aSfxRequest
.GetSlot() ); }
102 sal_Bool
IsDetectiveHit( const Point
& rLogicPos
);
104 void StopDragTimer();
106 // Create default drawing objects via keyboard
107 virtual SdrObject
* CreateDefaultObject(const sal_uInt16 nID
, const Rectangle
& rRectangle
);
110 void ImpForceQuadratic(Rectangle
& rRect
);
114 virtual bool doConstructOrthogonal() const;
119 #endif // _SD_FUPOOR_HXX
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */