LibreOffice Module sd (master) 1
fudspord.cxx
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
20#include <fudspord.hxx>
21
22#include <vcl/ptrstyle.hxx>
23
24#include <app.hrc>
25#include <fupoor.hxx>
26#include <ViewShell.hxx>
27#include <View.hxx>
28#include <Window.hxx>
29
30namespace sd {
31
32
34: FuPoor(pViewSh, pWin, pView, pDoc, rReq)
35, maPtr(PointerStyle::Arrow)
36, mpRefObj(nullptr)
37{
38}
39
41{
42}
43
45{
46 mpOverlay.reset();
47}
48
50{
51 rtl::Reference<FuPoor> xFunc( new FuDisplayOrder( pViewSh, pWin, pView, pDoc, rReq ) );
52 return xFunc;
53}
54
56{
57 // remember button state for creation of own MouseEvents
59
60 return true;
61}
62
64{
65 SdrPageView* pPV;
66 Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
67
68 SdrObject* pPickObj = mpView->PickObj(aPnt, mpView->getHitTolLog(), pPV);
69 if (pPickObj)
70 {
71 if (mpRefObj != pPickObj)
72 {
73 // delete current overlay
75
76 // create new one
77 mpOverlay.reset( new SdrDropMarkerOverlay(*mpView, *pPickObj) );
78
79 // remember referenced object
80 mpRefObj = pPickObj;
81 }
82 }
83 else
84 {
85 mpRefObj = nullptr;
87 }
88
89 return true;
90}
91
93{
94 // remember button state for creation of own MouseEvents
96
97 SdrPageView* pPV = nullptr;
98 Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
99
100 mpRefObj = mpView->PickObj(aPnt, mpView->getHitTolLog(), pPV);
101 if (mpRefObj)
102 {
103 if (nSlotId == SID_BEFORE_OBJ)
104 {
106 }
107 else
108 {
110 }
111 }
112
114
115 return true;
116}
117
119{
120 maPtr = mpWindow->GetPointer();
121 mpWindow->SetPointer( PointerStyle::RefHand );
122}
123
125{
126 mpWindow->SetPointer( maPtr );
127}
128
129} // end of namespace sd
130
131/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 GetButtons() const
const Point & GetPosPixel() const
void PutMarkedBehindObj(const SdrObject *pRefObj)
void PutMarkedInFrontOfObj(const SdrObject *pRefObj)
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
sal_uInt16 getHitTolLog() const
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
Definition: fudspord.cxx:55
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fudspord.cxx:49
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
Definition: fudspord.cxx:92
std::unique_ptr< SdrDropMarkerOverlay > mpOverlay
Definition: fudspord.hxx:50
FuDisplayOrder(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fudspord.cxx:33
void implClearOverlay()
Definition: fudspord.cxx:44
virtual void Deactivate() override
deactivates the function
Definition: fudspord.cxx:124
virtual ~FuDisplayOrder() override
Definition: fudspord.cxx:40
PointerStyle maPtr
Definition: fudspord.hxx:48
virtual void Activate() override
activates the function
Definition: fudspord.cxx:118
SdrObject * mpRefObj
Definition: fudspord.hxx:49
virtual bool MouseMove(const MouseEvent &rMEvt) override
Definition: fudspord.cxx:63
Base class for all functions.
Definition: fupoor.hxx:48
VclPtr< ::sd::Window > mpWindow
Definition: fupoor.hxx:146
ViewShell * mpViewShell
Definition: fupoor.hxx:145
void SetMouseButtonCode(sal_uInt16 nNew)
Definition: fupoor.hxx:57
sal_uInt16 nSlotId
Definition: fupoor.hxx:150
::sd::View * mpView
Definition: fupoor.hxx:144
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
void Cancel()
this method deactivates the current function.
Definition: viewshel.cxx:1442
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
PointerStyle