LibreOffice Module sw (master) 1
drawbase.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_DRAWBASE_HXX
20#define INCLUDED_SW_SOURCE_UIBASE_INC_DRAWBASE_HXX
21
22#include <tools/gen.hxx>
23#include <vcl/vclptr.hxx>
24
25class SwView;
26class SwWrtShell;
27class SwEditWin;
28class KeyEvent;
29class MouseEvent;
30
31// base class for all functions
33{
34protected:
38 Point m_aStartPos; // position of BeginCreate
39 sal_uInt16 m_nSlotId;
40 bool m_bCreateObj :1;
41 bool m_bInsForm :1;
42
44public:
45 SwDrawBase(SwWrtShell *pSh, SwEditWin* pWin, SwView* pView);
46 virtual ~SwDrawBase();
47
48 void SetDrawPointer();
49 void EnterSelectMode(const MouseEvent& rMEvt);
50 bool IsInsertForm() const { return m_bInsForm; }
51 bool IsCreateObj() const { return m_bCreateObj; }
52
53 // mouse- & key events; return value=true: event was edited
54 bool MouseMove(const MouseEvent& rMEvt);
55 virtual bool MouseButtonUp(const MouseEvent& rMEvt);
56 virtual bool MouseButtonDown(const MouseEvent& rMEvt);
57
58 void BreakCreate();
59 void SetSlotId(sal_uInt16 nSlot) {m_nSlotId = nSlot;}
60 sal_uInt16 GetSlotId() const { return m_nSlotId;}
61
62 virtual void Activate(const sal_uInt16 nSlotId); // activate function
63 virtual void Deactivate(); // deactivate function
64
65 virtual void CreateDefaultObject();
66 virtual void CreateDefaultObjectAtPosWithSize(Point aPos, Size aSize);
67
68 // #i33136#
69 virtual bool doConstructOrthogonal() const;
70};
71
72#endif // INCLUDED_SW_SOURCE_UIBASE_INC_DRAWBASE_HXX
73
74/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool m_bCreateObj
Definition: drawbase.hxx:40
SwDrawBase(SwWrtShell *pSh, SwEditWin *pWin, SwView *pView)
Definition: drawbase.cxx:44
virtual void Activate(const sal_uInt16 nSlotId)
Definition: drawbase.cxx:432
SwWrtShell * m_pSh
Definition: drawbase.hxx:36
SwView * m_pView
Definition: drawbase.hxx:35
void BreakCreate()
Definition: drawbase.cxx:469
VclPtr< SwEditWin > m_pWin
Definition: drawbase.hxx:37
virtual ~SwDrawBase()
Definition: drawbase.cxx:56
void SetSlotId(sal_uInt16 nSlot)
Definition: drawbase.hxx:59
virtual void CreateDefaultObjectAtPosWithSize(Point aPos, Size aSize)
Definition: drawbase.cxx:531
virtual void Deactivate()
Definition: drawbase.cxx:444
virtual bool MouseButtonDown(const MouseEvent &rMEvt)
Definition: drawbase.cxx:62
virtual bool doConstructOrthogonal() const
Definition: drawbase.cxx:571
Point m_aStartPos
Definition: drawbase.hxx:38
void SetDrawPointer()
Definition: drawbase.cxx:478
bool m_bInsForm
Definition: drawbase.hxx:41
virtual bool MouseButtonUp(const MouseEvent &rMEvt)
Definition: drawbase.cxx:239
Point GetDefaultCenterPos() const
Definition: drawbase.cxx:546
bool IsCreateObj() const
Definition: drawbase.hxx:51
sal_uInt16 m_nSlotId
Definition: drawbase.hxx:39
bool IsInsertForm() const
Definition: drawbase.hxx:50
bool MouseMove(const MouseEvent &rMEvt)
Definition: drawbase.cxx:215
virtual void CreateDefaultObject()
Definition: drawbase.cxx:517
sal_uInt16 GetSlotId() const
Definition: drawbase.hxx:60
void EnterSelectMode(const MouseEvent &rMEvt)
Definition: drawbase.cxx:489
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:61
Definition: view.hxx:146
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97