fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / inc / fupoor.hxx
blob6ea7f7602a4eeacf99618d0286d5c1f96f03a4a8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
27 class ScDrawView;
28 class ScTabViewShell;
29 namespace vcl { class Window; }
30 class SdrModel;
31 class Dialog;
33 // Create default drawing objects via keyboard
34 class SdrObject;
36 // Return values for command
37 #define SC_CMD_NONE 0
38 #define SC_CMD_USED 1
40 /** Base class for all functions */
41 class FuPoor
43 protected:
44 ScDrawView* pView;
45 ScTabViewShell* pViewShell;
46 VclPtr<vcl::Window> pWindow;
47 SdrModel* pDrDoc;
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 * );
59 bool bIsInDragMode;
60 Point aMDPos; // Position of MouseButtonDown
62 // member to hold state of the mouse buttons for creation
63 // of own MouseEvents (like in ScrollHdl)
64 private:
65 sal_uInt16 mnCode;
67 public:
68 FuPoor(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView* pView,
69 SdrModel* pDoc, SfxRequest& rReq);
70 virtual ~FuPoor();
72 // see member
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 );
97 void StopDragTimer();
99 // Create default drawing objects via keyboard
100 virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
102 protected:
103 static void ImpForceQuadratic(Rectangle& rRect);
105 public:
106 // #i33136#
107 virtual bool doConstructOrthogonal() const;
110 #endif // _SD_FUPOOR_HXX
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */