update dev300-m58
[ooovba.git] / sw / source / ui / inc / drawbase.hxx
blob5887c16702eed8d2a1f0a75c57681be19a38cd68
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: drawbase.hxx,v $
10 * $Revision: 1.9 $
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>
35 class SwView;
36 class SwWrtShell;
37 class SwEditWin;
38 class KeyEvent;
39 class MouseEvent;
41 #define MIN_FREEHAND_DISTANCE 10
43 /*************************************************************************
45 |* Basisklasse fuer alle Funktionen
47 \************************************************************************/
49 class SwDrawBase
51 protected:
52 SwView* m_pView;
53 SwWrtShell* m_pSh;
54 SwEditWin* m_pWin;
55 Point m_aStartPos; // Position von BeginCreate
56 Point m_aMDPos; // Position von MouseButtonDown
57 USHORT m_nSlotId;
58 BOOL m_bCreateObj :1;
59 BOOL m_bInsForm :1;
61 Point GetDefaultCenterPos();
62 public:
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);
77 void BreakCreate();
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();
86 // #i33136#
87 virtual bool doConstructOrthogonal() const;
92 #endif // _SW_DRAWBASE_HXX