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 .
19 #ifndef _SW_DRAWBASE_HXX
20 #define _SW_DRAWBASE_HXX
22 #include <tools/gen.hxx>
30 /*************************************************************************
32 |* base class for all functions
34 \************************************************************************/
42 Point m_aStartPos
; // position of BeginCreate
43 Point m_aMDPos
; // position of MouseButtonDown
48 Point
GetDefaultCenterPos();
50 SwDrawBase(SwWrtShell
*pSh
, SwEditWin
* pWin
, SwView
* pView
);
51 virtual ~SwDrawBase();
53 void SetDrawPointer();
54 void EnterSelectMode(const MouseEvent
& rMEvt
);
55 inline bool IsInsertForm() const { return m_bInsForm
; }
56 inline bool IsCreateObj() const { return m_bCreateObj
; }
58 // mouse- & key events; return value=sal_True: event was edited
59 virtual sal_Bool
KeyInput(const KeyEvent
& rKEvt
);
60 virtual sal_Bool
MouseMove(const MouseEvent
& rMEvt
);
61 virtual sal_Bool
MouseButtonUp(const MouseEvent
& rMEvt
);
62 virtual sal_Bool
MouseButtonDown(const MouseEvent
& rMEvt
);
65 void SetSlotId(sal_uInt16 nSlot
) {m_nSlotId
= nSlot
;}
66 sal_uInt16
GetSlotId() { return m_nSlotId
;}
68 virtual void Activate(const sal_uInt16 nSlotId
); // activate function
69 virtual void Deactivate(); // deactivate function
71 virtual void CreateDefaultObject();
74 virtual bool doConstructOrthogonal() const;
79 #endif // _SW_DRAWBASE_HXX
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */