1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: drawbase.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SW_DRAWBASE_HXX
31 #define _SW_DRAWBASE_HXX
33 #include <tools/gen.hxx>
41 #define MIN_FREEHAND_DISTANCE 10
43 /*************************************************************************
45 |* Basisklasse fuer alle Funktionen
47 \************************************************************************/
55 Point m_aStartPos
; // Position von BeginCreate
56 Point m_aMDPos
; // Position von MouseButtonDown
61 Point
GetDefaultCenterPos();
63 SwDrawBase(SwWrtShell
*pSh
, SwEditWin
* pWin
, SwView
* pView
);
64 virtual ~SwDrawBase();
66 void SetDrawPointer();
67 void EnterSelectMode(const MouseEvent
& rMEvt
);
68 inline BOOL
IsInsertForm() const { return m_bInsForm
; }
69 inline BOOL
IsCreateObj() const { return m_bCreateObj
; }
71 // Mouse- & Key-Events; Returnwert=TRUE: Event wurde bearbeitet
72 virtual BOOL
KeyInput(const KeyEvent
& rKEvt
);
73 virtual BOOL
MouseMove(const MouseEvent
& rMEvt
);
74 virtual BOOL
MouseButtonUp(const MouseEvent
& rMEvt
);
75 virtual BOOL
MouseButtonDown(const MouseEvent
& rMEvt
);
78 void SetSlotId(USHORT nSlot
) {m_nSlotId
= nSlot
;}
79 USHORT
GetSlotId() { return m_nSlotId
;}
81 virtual void Activate(const USHORT nSlotId
); // Function aktivieren
82 virtual void Deactivate(); // Function deaktivieren
84 virtual void CreateDefaultObject();
87 virtual bool doConstructOrthogonal() const;
92 #endif // _SW_DRAWBASE_HXX