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 INCLUDED_SC_SOURCE_UI_INC_FUPOOR_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_FUPOOR_HXX
23 #include <vcl/event.hxx>
24 #include <vcl/timer.hxx>
25 #include <sfx2/request.hxx>
29 namespace vcl
{ class Window
; }
33 // Create default drawing objects via keyboard
36 // Return values for command
40 /** Base class for all functions */
45 ScTabViewShell
* pViewShell
;
46 VclPtr
<vcl::Window
> pWindow
;
49 SfxRequest aSfxRequest
;
50 VclPtr
<Dialog
> pDialog
;
52 Timer aScrollTimer
; // for Autoscrolling
53 DECL_LINK_TYPED( ScrollHdl
, Timer
*, void );
54 void ForceScroll(const Point
& aPixPos
);
56 Timer aDragTimer
; // for Drag&Drop
57 DECL_LINK_TYPED( DragTimerHdl
, Timer
*, void );
58 DECL_LINK( DragHdl
, void * );
60 Point aMDPos
; // Position of MouseButtonDown
62 // member to hold state of the mouse buttons for creation
63 // of own MouseEvents (like in ScrollHdl)
68 FuPoor(ScTabViewShell
* pViewSh
, vcl::Window
* pWin
, ScDrawView
* pView
,
69 SdrModel
* pDoc
, SfxRequest
& rReq
);
73 void SetMouseButtonCode(sal_uInt16 nNew
) { if(nNew
!= mnCode
) mnCode
= nNew
; }
74 sal_uInt16
GetMouseButtonCode() const { return mnCode
; }
76 // Mouse- & Key-Events; return value=TRUE: Event was processed
77 virtual bool KeyInput(const KeyEvent
& rKEvt
);
78 virtual bool MouseMove(const MouseEvent
&) { return false; }
80 // moved from inline to *.cxx
81 virtual bool MouseButtonUp(const MouseEvent
& rMEvt
); // { return FALSE; }
83 // moved from inline to *.cxx
84 virtual bool MouseButtonDown(const MouseEvent
& rMEvt
); // { return FALSE; }
86 virtual sal_uInt8
Command(const CommandEvent
& rCEvt
);
88 virtual void Activate();
89 virtual void Deactivate();
91 void SetWindow(vcl::Window
* pWin
) { pWindow
= pWin
; }
93 sal_uInt16
GetSlotID() const { return( aSfxRequest
.GetSlot() ); }
95 bool IsDetectiveHit( const Point
& rLogicPos
);
99 // Create default drawing objects via keyboard
100 virtual SdrObject
* CreateDefaultObject(const sal_uInt16 nID
, const Rectangle
& rRectangle
);
103 static void ImpForceQuadratic(Rectangle
& rRect
);
107 virtual bool doConstructOrthogonal() const;
110 #endif // _SD_FUPOOR_HXX
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */