LibreOffice Module sfx2 (master) 1
ipclient.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 <sal/config.h>
21
22#include <com/sun/star/awt/XVclWindowPeer.hpp>
23#include <com/sun/star/embed/Aspects.hpp>
24#include <com/sun/star/embed/EmbedStates.hpp>
25#include <com/sun/star/embed/UnreachableStateException.hpp>
26#include <com/sun/star/embed/XEmbeddedClient.hpp>
27#include <com/sun/star/embed/XInplaceClient.hpp>
28#include <com/sun/star/embed/XInplaceObject.hpp>
29#include <com/sun/star/embed/XWindowSupplier.hpp>
30#include <com/sun/star/embed/EmbedVerbs.hpp>
31#include <com/sun/star/embed/XEmbeddedOleObject.hpp>
32#include <com/sun/star/embed/XEmbeddedObject.hpp>
33#include <com/sun/star/beans/XPropertySet.hpp>
34#include <com/sun/star/beans/PropertyValue.hpp>
35#include <com/sun/star/embed/XStateChangeListener.hpp>
36#include <com/sun/star/embed/StateChangeInProgressException.hpp>
37#include <com/sun/star/embed/XLinkageSupport.hpp>
38#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
39#include <com/sun/star/task/ErrorCodeIOException.hpp>
40#include <com/sun/star/task/StatusIndicatorFactory.hpp>
41#include <com/sun/star/task/XStatusIndicator.hpp>
42
43#include <com/sun/star/embed/EmbedMisc.hpp>
44#include <svtools/embedhlp.hxx>
45#include <vcl/svapp.hxx>
46
47#include <sfx2/ipclient.hxx>
48#include <sfx2/viewsh.hxx>
49#include <sfx2/viewfrm.hxx>
50#include <sfx2/objsh.hxx>
51#include <guisaveas.hxx>
53#include <svtools/ehdl.hxx>
54
55#include <vcl/timer.hxx>
56#include <vcl/window.hxx>
59#include <tools/debug.hxx>
61#include <tools/fract.hxx>
62#include <tools/gen.hxx>
63#include <svtools/soerr.hxx>
64#include <comphelper/lok.hxx>
68
69#include <LibreOfficeKit/LibreOfficeKitEnums.h>
70
71#define SFX_CLIENTACTIVATE_TIMEOUT 100
72
73using namespace com::sun::star;
74
75namespace {
76
77// SfxEmbedResizeGuard
78class SfxBooleanFlagGuard
79{
80 bool& m_rFlag;
81public:
82 explicit SfxBooleanFlagGuard(bool& bFlag)
83 : m_rFlag( bFlag )
84 {
85 m_rFlag = true;
86 }
87
88 ~SfxBooleanFlagGuard()
89 {
90 m_rFlag = false;
91 }
92};
93
94tools::Rectangle lcl_negateRectX(const tools::Rectangle& rRect)
95{
96 return tools::Rectangle(
97 std::max(static_cast<tools::Long>(0l), -rRect.Right()),
98 rRect.Top(),
99 std::max(static_cast<tools::Long>(0l), -rRect.Left()),
100 rRect.Bottom());
101}
102
103}
104
105// SfxInPlaceClient_Impl
106
107
108class SfxInPlaceClient_Impl : public ::cppu::WeakImplHelper< embed::XEmbeddedClient,
109 embed::XInplaceClient,
110 document::XEventListener,
111 embed::XStateChangeListener,
112 embed::XWindowSupplier >
113{
114public:
115 Timer m_aTimer { "sfx::SfxInPlaceClient m_xImpl::m_aTimer" }; // activation timeout, starts after object connection
116 tools::Rectangle m_aObjArea; // area of object in coordinate system of the container (without scaling)
117 Fraction m_aScaleWidth; // scaling that was applied to the object when it was not active
120 sal_Int64 m_nAspect; // ViewAspect that is assigned from the container
122 bool m_bUIActive; // set and cleared when notification for UI (de)activation is sent
125
126 uno::Reference < embed::XEmbeddedObject > m_xObject;
127
128
130 : m_pClient( nullptr )
131 , m_nAspect( 0 )
132 , m_bStoreObject( true )
133 , m_bUIActive( false )
134 , m_bResizeNoScale( false )
135 , m_bNegativeX( false )
136 {}
137
138 void SizeHasChanged();
139 DECL_LINK(TimerHdl, Timer *, void);
140 uno::Reference < frame::XFrame > const & GetFrame() const;
141
142 // XEmbeddedClient
143 virtual void SAL_CALL saveObject() override;
144 virtual void SAL_CALL visibilityChanged( sal_Bool bVisible ) override;
145
146 // XInplaceClient
147 virtual sal_Bool SAL_CALL canInplaceActivate() override;
148 virtual void SAL_CALL activatingInplace() override;
149 virtual void SAL_CALL activatingUI() override;
150 virtual void SAL_CALL deactivatedInplace() override;
151 virtual void SAL_CALL deactivatedUI() override;
152 virtual uno::Reference< css::frame::XLayoutManager > SAL_CALL getLayoutManager() override;
153 virtual uno::Reference< frame::XDispatchProvider > SAL_CALL getInplaceDispatchProvider() override;
154 virtual awt::Rectangle SAL_CALL getPlacement() override;
155 virtual awt::Rectangle SAL_CALL getClipRectangle() override;
156 virtual void SAL_CALL translateAccelerators( const uno::Sequence< awt::KeyEvent >& aKeys ) override;
157 virtual void SAL_CALL scrollObject( const awt::Size& aOffset ) override;
158 virtual void SAL_CALL changedPlacement( const awt::Rectangle& aPosRect ) override;
159
160 // XComponentSupplier
161 virtual uno::Reference< util::XCloseable > SAL_CALL getComponent() override;
162
163 // XWindowSupplier
164 virtual uno::Reference< awt::XWindow > SAL_CALL getWindow() override;
165
166 // document::XEventListener
167 virtual void SAL_CALL notifyEvent( const document::EventObject& aEvent ) override;
168
169 // XStateChangeListener
170 virtual void SAL_CALL changingState( const css::lang::EventObject& aEvent, ::sal_Int32 nOldState, ::sal_Int32 nNewState ) override;
171 virtual void SAL_CALL stateChanged( const css::lang::EventObject& aEvent, ::sal_Int32 nOldState, ::sal_Int32 nNewState ) override;
172 virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) override;
173};
174
176 const css::lang::EventObject& /*aEvent*/,
177 ::sal_Int32 /*nOldState*/,
178 ::sal_Int32 /*nNewState*/ )
179{
180}
181
183 const css::lang::EventObject& /*aEvent*/,
184 ::sal_Int32 nOldState,
185 ::sal_Int32 nNewState )
186{
187 if ( m_pClient && nOldState != embed::EmbedStates::LOADED && nNewState == embed::EmbedStates::RUNNING )
188 {
189 // deactivation of object
190 uno::Reference< frame::XModel > xDocument;
192 xDocument = m_pClient->GetViewShell()->GetObjectShell()->GetModel();
194 }
195}
196
197void SAL_CALL SfxInPlaceClient_Impl::notifyEvent( const document::EventObject& aEvent )
198{
199 SolarMutexGuard aGuard;
200
201 if ( m_pClient && aEvent.EventName == "OnVisAreaChanged" && m_nAspect != embed::Aspects::MSOLE_ICON )
202 {
203 m_pClient->FormatChanged(); // for Writer when format of the object is changed with the area
206 }
207}
208
209void SAL_CALL SfxInPlaceClient_Impl::disposing( const css::lang::EventObject& /*aEvent*/ )
210{
211 delete m_pClient;
212 m_pClient = nullptr;
213}
214
215// XEmbeddedClient
216
217uno::Reference < frame::XFrame > const & SfxInPlaceClient_Impl::GetFrame() const
218{
219 if ( !m_pClient )
220 throw uno::RuntimeException();
222}
223
225{
227 // client wants to discard the object (usually it means the container document is closed while an object is active
228 // and the user didn't request saving the changes
229 return;
230
231 // the common persistence is supported by objects and links
232 uno::Reference< embed::XCommonEmbedPersist > xPersist( m_xObject, uno::UNO_QUERY_THROW );
233
234 uno::Reference< frame::XFrame > xFrame;
235 uno::Reference< task::XStatusIndicator > xStatusIndicator;
236 uno::Reference< frame::XModel > xModel( m_xObject->getComponent(), uno::UNO_QUERY );
237 uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
238
239 if ( xModel.is() )
240 {
241 uno::Reference< frame::XController > xController = xModel->getCurrentController();
242 if ( xController.is() )
243 xFrame = xController->getFrame();
244 }
245
246 if ( xFrame.is() )
247 {
248 // set non-reschedule progress to prevent problems when asynchronous calls are made
249 // during storing of the embedded object
250 uno::Reference< task::XStatusIndicatorFactory > xStatusIndicatorFactory =
251 task::StatusIndicatorFactory::createWithFrame( xContext, xFrame, true/*DisableReschedule*/, false/*AllowParentShow*/ );
252
253 uno::Reference< beans::XPropertySet > xPropSet( xFrame, uno::UNO_QUERY );
254 if ( xPropSet.is() )
255 {
256 try
257 {
258 xStatusIndicator = xStatusIndicatorFactory->createStatusIndicator();
259 xPropSet->setPropertyValue( "IndicatorInterception" , uno::Any( xStatusIndicator ));
260 }
261 catch ( const uno::RuntimeException& )
262 {
263 throw;
264 }
265 catch ( uno::Exception& )
266 {
267 }
268 }
269 }
270
271 try
272 {
273 xPersist->storeOwn();
274 m_xObject->update();
275 }
276 catch ( uno::Exception& )
277 {
278 //TODO/LATER: what should happen if object can't be saved?!
279 }
280
281 // reset status indicator interception after storing
282 try
283 {
284 uno::Reference< beans::XPropertySet > xPropSet( xFrame, uno::UNO_QUERY );
285 if ( xPropSet.is() )
286 {
287 xStatusIndicator.clear();
288 xPropSet->setPropertyValue( "IndicatorInterception" , uno::Any( xStatusIndicator ));
289 }
290 }
291 catch ( const uno::RuntimeException& )
292 {
293 throw;
294 }
295 catch ( uno::Exception& )
296 {
297 }
298
299 // the client can exist only in case there is a view shell
300 if ( !m_pClient || !m_pClient->GetViewShell() )
301 throw uno::RuntimeException();
302
304 if ( !pDocShell )
305 throw uno::RuntimeException();
306
307 pDocShell->SetModified();
308
309 //TODO/LATER: invalidation might be necessary when object was modified, but is not
310 //saved through this method
311 // m_pClient->Invalidate();
312}
313
314
316{
317 SolarMutexGuard aGuard;
318
319 if ( !m_pClient || !m_pClient->GetViewShell() )
320 throw uno::RuntimeException();
321
323 if (m_pClient) // it can change in the above code
325}
326
327
328// XInplaceClient
329
331{
332 if ( !m_xObject.is() )
333 throw uno::RuntimeException();
334
335 // we don't want to switch directly from outplace to inplace mode
336 if ( m_xObject->getCurrentState() == embed::EmbedStates::ACTIVE || m_nAspect == embed::Aspects::MSOLE_ICON )
337 return false;
338
339 return true;
340}
341
342
344{
345 if ( !m_pClient || !m_pClient->GetViewShell() )
346 throw uno::RuntimeException();
347
349 return;
350
351 if ( SfxViewShell* pViewShell = m_pClient->GetViewShell() )
352 {
354
355 if (m_pClient->GetEditWin())
356 {
357 if (m_pClient->GetEditWin()->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
359 }
360
361 OString str = (m_bNegativeX ? lcl_negateRectX(aRect) : aRect).toString() + ", \"INPLACE\"";
362 pViewShell->libreOfficeKitViewCallback( LOK_CALLBACK_GRAPHIC_SELECTION, str );
363 }
364
365}
366
367
369{
370 if ( !m_pClient || !m_pClient->GetViewShell() )
371 throw uno::RuntimeException();
372
374 m_bUIActive = true;
376}
377
378
380{
381 if ( !m_pClient || !m_pClient->GetViewShell() )
382 throw uno::RuntimeException();
383
385 {
386 if ( SfxViewShell* pViewShell = m_pClient->GetViewShell() ) {
387 pViewShell->libreOfficeKitViewCallback( LOK_CALLBACK_GRAPHIC_SELECTION, "INPLACE EXIT" );
388 }
389 }
390}
391
392
394{
395 if ( !m_pClient || !m_pClient->GetViewShell() )
396 throw uno::RuntimeException();
397
399 m_bUIActive = false;
400}
401
402
403uno::Reference< css::frame::XLayoutManager > SAL_CALL SfxInPlaceClient_Impl::getLayoutManager()
404{
405 uno::Reference < beans::XPropertySet > xFrame( GetFrame(), uno::UNO_QUERY_THROW );
406
407 uno::Reference< css::frame::XLayoutManager > xMan;
408 try
409 {
410 uno::Any aAny = xFrame->getPropertyValue( "LayoutManager" );
411 aAny >>= xMan;
412 }
413 catch ( uno::Exception& ex )
414 {
415 css::uno::Any anyEx = cppu::getCaughtException();
416 throw css::lang::WrappedTargetRuntimeException( ex.Message,
417 nullptr, anyEx );
418 }
419
420 return xMan;
421}
422
423
424uno::Reference< frame::XDispatchProvider > SAL_CALL SfxInPlaceClient_Impl::getInplaceDispatchProvider()
425{
426 return uno::Reference < frame::XDispatchProvider >( GetFrame(), uno::UNO_QUERY_THROW );
427}
428
429
430awt::Rectangle SAL_CALL SfxInPlaceClient_Impl::getPlacement()
431{
432 if ( !m_pClient || !m_pClient->GetViewShell() )
433 throw uno::RuntimeException();
434
435 // apply scaling to object area and convert to pixels
436 tools::Rectangle aRealObjArea( m_aObjArea );
437 aRealObjArea.SetSize( Size( tools::Long( aRealObjArea.GetWidth() * m_aScaleWidth),
438 tools::Long( aRealObjArea.GetHeight() * m_aScaleHeight) ) );
439
440 vcl::Window* pEditWin = m_pClient->GetEditWin();
441 // In Writer and Impress the map mode is disabled. So when a chart is
442 // activated (for in place editing) we get the chart win size in 100th mm
443 // and any method that should return pixels returns 100th mm and the chart
444 // window map mode has a ~26.485 scale factor.
445 // All that does not fit with current implementation for handling chart
446 // editing in LOK.
448 {
449 bool bMapModeEnabled = pEditWin->IsMapModeEnabled();
450 if (!bMapModeEnabled)
451 pEditWin->EnableMapMode();
452 aRealObjArea = pEditWin->LogicToPixel(aRealObjArea);
453 if (!bMapModeEnabled && pEditWin->IsMapModeEnabled())
454 pEditWin->EnableMapMode(false);
455 }
456 else
457 {
458 aRealObjArea = pEditWin->LogicToPixel(aRealObjArea);
459 }
460
461 return AWTRectangle( aRealObjArea );
462}
463
464
466{
467 if ( !m_pClient || !m_pClient->GetViewShell() )
468 throw uno::RuntimeException();
469
470 // currently(?) same as placement
471 tools::Rectangle aRealObjArea( m_aObjArea );
472 aRealObjArea.SetSize( Size( tools::Long( aRealObjArea.GetWidth() * m_aScaleWidth),
473 tools::Long( aRealObjArea.GetHeight() * m_aScaleHeight) ) );
474
475 vcl::Window* pEditWin = m_pClient->GetEditWin();
476 // See comment for SfxInPlaceClient_Impl::getPlacement.
478 {
479 bool bMapModeEnabled = pEditWin->IsMapModeEnabled();
480 if (!bMapModeEnabled)
481 pEditWin->EnableMapMode();
482 aRealObjArea = pEditWin->LogicToPixel(aRealObjArea);
483 if (!bMapModeEnabled && pEditWin->IsMapModeEnabled())
484 pEditWin->EnableMapMode(false);
485 }
486 else
487 {
488 aRealObjArea = pEditWin->LogicToPixel(aRealObjArea);
489 }
490
491 return AWTRectangle( aRealObjArea );
492}
493
494
495void SAL_CALL SfxInPlaceClient_Impl::translateAccelerators( const uno::Sequence< awt::KeyEvent >& /*aKeys*/ )
496{
497 if ( !m_pClient || !m_pClient->GetViewShell() )
498 throw uno::RuntimeException();
499
500 // TODO/MBA: keyboard accelerators
501}
502
503
504void SAL_CALL SfxInPlaceClient_Impl::scrollObject( const awt::Size& /*aOffset*/ )
505{
506 if ( !m_pClient || !m_pClient->GetViewShell() )
507 throw uno::RuntimeException();
508}
509
510
511void SAL_CALL SfxInPlaceClient_Impl::changedPlacement( const awt::Rectangle& aPosRect )
512{
513 uno::Reference< embed::XInplaceObject > xInplace( m_xObject, uno::UNO_QUERY_THROW );
515 throw uno::RuntimeException();
516
517 // check if the change is at least one pixel in size
518 awt::Rectangle aOldRect = getPlacement();
519 tools::Rectangle aNewPixelRect = VCLRectangle( aPosRect );
520 tools::Rectangle aOldPixelRect = VCLRectangle( aOldRect );
521 if ( aOldPixelRect == aNewPixelRect )
522 // nothing has changed
523 return;
524
525 // new scaled object area
526 tools::Rectangle aNewLogicRect = m_pClient->GetEditWin()->PixelToLogic( aNewPixelRect );
527
528 // all the size changes in this method should happen without scaling
529 // SfxBooleanFlagGuard aGuard( m_bResizeNoScale, sal_True );
530
531 // allow container to apply restrictions on the requested new area;
532 // the container might change the object view during size calculation;
533 // currently only writer does it
534 m_pClient->RequestNewObjectArea( aNewLogicRect);
535
536 if ( aNewLogicRect != m_pClient->GetScaledObjArea() )
537 {
538 // the calculation of the object area has not changed the object size
539 // it should be done here then
540 SfxBooleanFlagGuard aGuard( m_bResizeNoScale );
541
542 // new size of the object area without scaling
543 Size aNewObjSize( tools::Long( aNewLogicRect.GetWidth() / m_aScaleWidth ),
544 tools::Long( aNewLogicRect.GetHeight() / m_aScaleHeight ) );
545
546 // now remove scaling from new placement and keep this at the new object area
547 aNewLogicRect.SetSize( aNewObjSize );
548 m_aObjArea = aNewLogicRect;
549
550 // let the window size be recalculated
552 }
553
554 // notify container view about changes
556}
557
558// XComponentSupplier
559
560uno::Reference< util::XCloseable > SAL_CALL SfxInPlaceClient_Impl::getComponent()
561{
562 if ( !m_pClient || !m_pClient->GetViewShell() )
563 throw uno::RuntimeException();
564
566 if ( !pDocShell )
567 throw uno::RuntimeException();
568
569 // all the components must implement XCloseable
570 uno::Reference< util::XCloseable > xComp( pDocShell->GetModel(), uno::UNO_QUERY_THROW );
571 return xComp;
572}
573
574
575// XWindowSupplier
576
577uno::Reference< awt::XWindow > SAL_CALL SfxInPlaceClient_Impl::getWindow()
578{
579 if ( !m_pClient || !m_pClient->GetEditWin() )
580 throw uno::RuntimeException();
581
582 uno::Reference< awt::XWindow > xWin( m_pClient->GetEditWin()->GetComponentInterface(), uno::UNO_QUERY );
583 return xWin;
584}
585
586
587// notification to the client implementation that either the object area or the scaling has been changed
588// as a result the logical size of the window has changed also
590{
591 if ( !m_pClient || !m_pClient->GetViewShell() )
592 throw uno::RuntimeException();
593
594 try {
595 if ( m_xObject.is()
596 && ( m_xObject->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE
597 || m_xObject->getCurrentState() == embed::EmbedStates::UI_ACTIVE ) )
598 {
599 // only possible in active states
600 uno::Reference< embed::XInplaceObject > xInplace( m_xObject, uno::UNO_QUERY_THROW );
601
602 if ( m_bResizeNoScale )
603 {
604 // the resizing should be done without scaling
605 // set the correct size to the object to avoid the scaling
606 MapMode aObjectMap( VCLUnoHelper::UnoEmbed2VCLMapUnit( m_xObject->getMapUnit( m_nAspect ) ) );
607 MapMode aClientMap( m_pClient->GetEditWin()->GetMapMode().GetMapUnit() );
608
609 // convert to logical coordinates of the embedded object
610 Size aNewSize = m_pClient->GetEditWin()->LogicToLogic( m_aObjArea.GetSize(), &aClientMap, &aObjectMap );
611 m_xObject->setVisualAreaSize( m_nAspect, awt::Size( aNewSize.Width(), aNewSize.Height() ) );
612 }
613
614 xInplace->setObjectRectangles( getPlacement(), getClipRectangle() );
615 }
616 }
617 catch( uno::Exception& )
618 {
619 // TODO/LATER: handle error
620 }
621}
622
623
625{
626 if ( m_pClient && m_xObject.is() )
627 {
628 m_pClient->GetViewShell()->CheckIPClient_Impl(m_pClient,
629 m_pClient->GetViewShell()->GetObjectShell()->GetVisArea());
630 }
631}
632
633
634// SfxInPlaceClient
635
636
637SfxInPlaceClient::SfxInPlaceClient( SfxViewShell* pViewShell, vcl::Window *pDraw, sal_Int64 nAspect ) :
638 m_xImp( new SfxInPlaceClient_Impl ),
639 m_pViewSh( pViewShell ),
640 m_pEditWin( pDraw )
641{
642 m_xImp->m_pClient = this;
643 m_xImp->m_nAspect = nAspect;
644 m_xImp->m_aScaleWidth = m_xImp->m_aScaleHeight = Fraction(1,1);
645 pViewShell->NewIPClient_Impl(this);
646 m_xImp->m_aTimer.SetTimeout( SFX_CLIENTACTIVATE_TIMEOUT );
647 m_xImp->m_aTimer.SetInvokeHandler( LINK( m_xImp.get(), SfxInPlaceClient_Impl, TimerHdl ) );
648}
649
650
652{
654
655 // deleting the client before storing the object means discarding all changes
656 m_xImp->m_bStoreObject = false;
657 SetObject(nullptr);
658
659 m_xImp->m_pClient = nullptr;
660
661 // the next call will destroy m_xImp if no other reference to it exists
662 m_xImp.clear();
663
664 // TODO/LATER:
665 // the class is not intended to be used in multithreaded environment;
666 // if it will this disconnection and all the parts that use the m_pClient
667 // must be guarded with mutex
668}
669
670
671void SfxInPlaceClient::SetObjectState( sal_Int32 nState )
672{
673 if ( !GetObject().is() )
674 return;
675
676 if ( m_xImp->m_nAspect == embed::Aspects::MSOLE_ICON
677 && ( nState == embed::EmbedStates::UI_ACTIVE || nState == embed::EmbedStates::INPLACE_ACTIVE ) )
678 {
679 OSL_FAIL( "Iconified object should not be activated inplace!" );
680 return;
681 }
682
683 try
684 {
685 GetObject()->changeState( nState );
686 }
687 catch ( uno::Exception& )
688 {}
689}
690
691
693{
694 if ( GetObject().is() )
695 return GetObject()->getStatus( m_xImp->m_nAspect );
696 return 0;
697}
698
699
700const uno::Reference < embed::XEmbeddedObject >& SfxInPlaceClient::GetObject() const
701{
702 return m_xImp->m_xObject;
703}
704
705
706void SfxInPlaceClient::SetObject( const uno::Reference < embed::XEmbeddedObject >& rObject )
707{
708 if ( m_xImp->m_xObject.is() && rObject != m_xImp->m_xObject )
709 {
710 DBG_ASSERT( GetObject()->getClientSite() == getXWeak(m_xImp.get()), "Wrong ClientSite!" );
711 if ( GetObject()->getClientSite() == getXWeak(m_xImp.get()) )
712 {
713 if ( GetObject()->getCurrentState() != embed::EmbedStates::LOADED )
714 SetObjectState( embed::EmbedStates::RUNNING );
715 m_xImp->m_xObject->removeEventListener( m_xImp );
716 m_xImp->m_xObject->removeStateChangeListener( m_xImp );
717 try
718 {
719 m_xImp->m_xObject->setClientSite( nullptr );
720 }
721 catch( uno::Exception& )
722 {
723 OSL_FAIL( "Can not clean the client site!" );
724 }
725 }
726 }
727
729 // sometimes applications reconnect clients on shutting down because it happens in their Paint methods
730 return;
731
732 m_xImp->m_xObject = rObject;
733
734 if ( rObject.is() )
735 {
736 // as soon as an object was connected to a client it has to be checked whether the object wants
737 // to be activated
738 rObject->addStateChangeListener( m_xImp );
739 rObject->addEventListener( m_xImp );
740
741 try
742 {
743 rObject->setClientSite( m_xImp );
744 }
745 catch( uno::Exception& )
746 {
747 OSL_FAIL( "Can not set the client site!" );
748 }
749
750 m_xImp->m_aTimer.Start();
751 }
752 else
753 m_xImp->m_aTimer.Stop();
754}
755
756
758{
759 if( rArea != m_xImp->m_aObjArea )
760 {
761 m_xImp->m_aObjArea = rArea;
762 m_xImp->SizeHasChanged();
763
764 Invalidate();
765 return true;
766 }
767
768 return false;
769}
770
771
773{
774 return m_xImp->m_aObjArea;
775}
776
778{
779 tools::Rectangle aRealObjArea( m_xImp->m_aObjArea );
780 aRealObjArea.SetSize( Size( tools::Long( aRealObjArea.GetWidth() * m_xImp->m_aScaleWidth ),
781 tools::Long( aRealObjArea.GetHeight() * m_xImp->m_aScaleHeight ) ) );
782 return aRealObjArea;
783}
784
785
786void SfxInPlaceClient::SetSizeScale( const Fraction & rScaleWidth, const Fraction & rScaleHeight )
787{
788 if ( m_xImp->m_aScaleWidth != rScaleWidth || m_xImp->m_aScaleHeight != rScaleHeight )
789 {
790 m_xImp->m_aScaleWidth = rScaleWidth;
791 m_xImp->m_aScaleHeight = rScaleHeight;
792
793 m_xImp->SizeHasChanged();
794
795 // TODO/LATER: Invalidate seems to trigger (wrong) recalculations of the ObjArea, so it's better
796 // not to call it here, but maybe it sounds reasonable to do so.
797 //Invalidate();
798 }
799}
800
801
802void SfxInPlaceClient::SetObjAreaAndScale( const tools::Rectangle& rArea, const Fraction& rScaleWidth, const Fraction& rScaleHeight )
803{
804 if( rArea != m_xImp->m_aObjArea || m_xImp->m_aScaleWidth != rScaleWidth || m_xImp->m_aScaleHeight != rScaleHeight )
805 {
806 m_xImp->m_aObjArea = rArea;
807 m_xImp->m_aScaleWidth = rScaleWidth;
808 m_xImp->m_aScaleHeight = rScaleHeight;
809
810 m_xImp->SizeHasChanged();
811
812 Invalidate();
813 }
814}
815
816
818{
819 return m_xImp->m_aScaleWidth;
820}
821
822
824{
825 return m_xImp->m_aScaleHeight;
826}
827
828
830{
831 // TODO/LATER: do we need both?
832
833 // the object area is provided in logical coordinates of the window but without scaling applied
834 tools::Rectangle aRealObjArea( m_xImp->m_aObjArea );
835 aRealObjArea.SetSize( Size( tools::Long( aRealObjArea.GetWidth() * m_xImp->m_aScaleWidth ),
836 tools::Long( aRealObjArea.GetHeight() * m_xImp->m_aScaleHeight ) ) );
837
838 m_pEditWin->Invalidate( IsNegativeX() ? lcl_negateRectX(aRealObjArea) : aRealObjArea );
839
840 ViewChanged();
841}
842
843
845{
846 try {
847 return ( m_xImp->m_xObject.is() && ( m_xImp->m_xObject->getCurrentState() == embed::EmbedStates::UI_ACTIVE ) );
848 }
849 catch( uno::Exception& )
850 {}
851
852 return false;
853}
854
855
857{
858 try {
859 return(
860 (
861 m_xImp->m_xObject.is() &&
862 (m_xImp->m_xObject->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE)
863 ) ||
864 (
865 m_xImp->m_xObject.is() &&
866 (m_xImp->m_xObject->getCurrentState() == embed::EmbedStates::UI_ACTIVE)
867 )
868 );
869 }
870 catch( uno::Exception& )
871 {}
872
873 return false;
874}
875
876
877SfxInPlaceClient* SfxInPlaceClient::GetClient( SfxObjectShell const * pDoc, const css::uno::Reference < css::embed::XEmbeddedObject >& xObject )
878{
879 for ( SfxViewFrame* pFrame = SfxViewFrame::GetFirst(pDoc); pFrame; pFrame=SfxViewFrame::GetNext(*pFrame,pDoc) )
880 {
881 if( pFrame->GetViewShell() )
882 {
883 SfxInPlaceClient* pClient = pFrame->GetViewShell()->FindIPClient( xObject, nullptr );
884 if ( pClient )
885 return pClient;
886 }
887 }
888
889 return nullptr;
890}
891
893{
894 return m_xImp->m_nAspect;
895}
896
898{
900 ErrCode nError = ERRCODE_NONE;
901
902 if ( m_xImp->m_xObject.is() )
903 {
904 bool bSaveCopyAs = false;
905 if ( nVerb == -8 ) // "Save Copy as..."
906 {
908 // TODO/LATER: this special verb should disappear when outplace activation is completely available
909 uno::Reference< frame::XModel > xEmbModel( m_xImp->m_xObject->getComponent(), uno::UNO_QUERY );
910 if ( xEmbModel.is() )
911 {
912 bSaveCopyAs = true;
913
914 try
915 {
917 uno::Sequence< beans::PropertyValue > aDispatchArgs{
918 comphelper::makePropertyValue("SaveTo", true)
919 };
920
921 aHelper.GUIStoreModel( xEmbModel,
922 u"SaveAs",
923 aDispatchArgs,
924 false,
926 false );
927 }
928 catch( const task::ErrorCodeIOException& aErrorEx )
929 {
930 nError = ErrCode(aErrorEx.ErrCode);
931 }
932 catch( uno::Exception& )
933 {
934 nError = ERRCODE_IO_GENERAL;
935 // TODO/LATER: better error handling
936 }
937 }
938 }
939
940 if ( !bSaveCopyAs )
941 {
942 if ( m_xImp->m_nAspect == embed::Aspects::MSOLE_ICON )
943 {
944 // the common persistence is supported by objects and links
945
946 uno::Reference< embed::XEmbeddedOleObject > xEmbeddedOleObject( m_xImp->m_xObject, uno::UNO_QUERY );
947
948 if ( xEmbeddedOleObject.is() && (nVerb == embed::EmbedVerbs::MS_OLEVERB_PRIMARY || nVerb == embed::EmbedVerbs::MS_OLEVERB_OPEN || nVerb == embed::EmbedVerbs::MS_OLEVERB_SHOW ))
949 nVerb = embed::EmbedVerbs::MS_OLEVERB_SHOW;
950 else if ( nVerb == embed::EmbedVerbs::MS_OLEVERB_PRIMARY || nVerb == embed::EmbedVerbs::MS_OLEVERB_SHOW )
951 nVerb = embed::EmbedVerbs::MS_OLEVERB_OPEN; // outplace activation
952 else if ( nVerb == embed::EmbedVerbs::MS_OLEVERB_UIACTIVATE
953 || nVerb == embed::EmbedVerbs::MS_OLEVERB_IPACTIVATE )
955 }
956
957 if ( !nError )
958 {
959 // See comment for SfxInPlaceClient_Impl::getPlacement.
960 vcl::Window* pEditWin = GetEditWin();
961 bool bMapModeEnabled = pEditWin->IsMapModeEnabled();
962 if (comphelper::LibreOfficeKit::isActive() && !bMapModeEnabled)
963 {
964 pEditWin->EnableMapMode();
965 }
967 try
968 {
969 m_xImp->m_xObject->setClientSite( m_xImp );
970
971 m_xImp->m_xObject->doVerb( nVerb );
972 }
973 catch ( embed::UnreachableStateException& )
974 {
975 if (nVerb == embed::EmbedVerbs::MS_OLEVERB_PRIMARY || nVerb == embed::EmbedVerbs::MS_OLEVERB_OPEN || nVerb == embed::EmbedVerbs::MS_OLEVERB_SHOW)
976 {
977 // a workaround for the default verb, usually makes sense for alien objects
978 try
979 {
980 m_xImp->m_xObject->doVerb( -9 ); // open own view, a workaround verb that is not visible
981
982 if ( m_xImp->m_xObject->getCurrentState() == embed::EmbedStates::UI_ACTIVE )
983 {
984 // the object was converted to OOo object
985 awt::Size aSize = m_xImp->m_xObject->getVisualAreaSize( m_xImp->m_nAspect );
986 MapMode aObjectMap( VCLUnoHelper::UnoEmbed2VCLMapUnit( m_xImp->m_xObject->getMapUnit( m_xImp->m_nAspect ) ) );
987 MapMode aClientMap( GetEditWin()->GetMapMode().GetMapUnit() );
988 Size aNewSize = GetEditWin()->LogicToLogic( Size( aSize.Width, aSize.Height ), &aObjectMap, &aClientMap );
989
990 tools::Rectangle aScaledArea = GetScaledObjArea();
991 m_xImp->m_aObjArea.SetSize( aNewSize );
992 m_xImp->m_aScaleWidth = Fraction( aScaledArea.GetWidth(), aNewSize.Width() );
993 m_xImp->m_aScaleHeight = Fraction( aScaledArea.GetHeight(), aNewSize.Height() );
994 }
995 }
996 catch (uno::Exception const&)
997 {
998 TOOLS_WARN_EXCEPTION("embeddedobj", "SfxInPlaceClient::DoVerb: -9 fallback path");
1000 }
1001 }
1002 }
1003 catch ( embed::StateChangeInProgressException& )
1004 {
1005 // TODO/LATER: it would be nice to be able to provide the current target state outside
1007 }
1008 catch (uno::Exception const&)
1009 {
1010 TOOLS_WARN_EXCEPTION("embeddedobj", "SfxInPlaceClient::DoVerb");
1011 nError = ERRCODE_SO_GENERALERROR;
1012 //TODO/LATER: better error handling
1013
1014 }
1015 if (comphelper::LibreOfficeKit::isActive() && !bMapModeEnabled
1016 && pEditWin->IsMapModeEnabled())
1017 {
1018 pEditWin->EnableMapMode(false);
1019 }
1020 SfxViewFrame& rFrame = m_pViewSh->GetViewFrame();
1021 rFrame.GetFrame().LockResize_Impl(false);
1022 rFrame.GetFrame().Resize();
1023 }
1024 }
1025 }
1026
1027 if( nError )
1028 ErrorHandler::HandleError( nError );
1029
1030 return nError;
1031}
1032
1034{
1035 uno::Reference < embed::XInplaceObject > xObj( m_xImp->m_xObject, uno::UNO_QUERY );
1036 if ( xObj.is() )
1037 m_xImp->SizeHasChanged();
1038}
1039
1041{
1042 // dummy implementation
1043}
1044
1046{
1047 // dummy implementation
1048}
1049
1051{
1052 // dummy implementation
1053}
1054
1056{
1057 // dummy implementation
1058}
1059
1060bool SfxInPlaceClient::IsProtected() const { return false; }
1061
1063{
1064 if ( !GetObject().is() )
1065 return;
1066
1067 try
1068 {
1069 m_xImp->m_bUIActive = false;
1070 bool bHasFocus = false;
1071 uno::Reference< frame::XModel > xModel( m_xImp->m_xObject->getComponent(), uno::UNO_QUERY );
1072 if ( xModel.is() )
1073 {
1074 uno::Reference< frame::XController > xController = xModel->getCurrentController();
1075 if ( xController.is() )
1076 {
1077 VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xController->getFrame()->getContainerWindow() );
1078 bHasFocus = pWindow->HasChildPathFocus( true );
1079 }
1080 }
1081
1083
1084 if ( m_xImp->m_xObject->getStatus( m_xImp->m_nAspect ) & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE )
1085 {
1086 m_xImp->m_xObject->changeState( embed::EmbedStates::INPLACE_ACTIVE );
1087 if (bHasFocus)
1089 }
1090 else
1091 {
1092 // the links should not stay in running state for long time because of locking
1093 uno::Reference< embed::XLinkageSupport > xLink( m_xImp->m_xObject, uno::UNO_QUERY );
1094 if ( xLink.is() && xLink->isLink() )
1095 m_xImp->m_xObject->changeState( embed::EmbedStates::LOADED );
1096 else
1097 m_xImp->m_xObject->changeState( embed::EmbedStates::RUNNING );
1098 }
1099
1100 SfxViewFrame& rFrame = m_pViewSh->GetViewFrame();
1101 SfxViewFrame::SetViewFrame( &rFrame );
1102 rFrame.GetFrame().LockResize_Impl(false);
1103 rFrame.GetFrame().Resize();
1104 }
1105 catch (css::uno::Exception& )
1106 {}
1107}
1108
1110{
1111 if ( !GetObject().is() )
1112 return;
1113
1114 try
1115 {
1116 m_xImp->m_bUIActive = false;
1117 if ( m_xImp->m_xObject->getStatus( m_xImp->m_nAspect ) & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE )
1118 m_xImp->m_xObject->changeState( embed::EmbedStates::INPLACE_ACTIVE );
1119 else
1120 {
1121 // the links should not stay in running state for long time because of locking
1122 uno::Reference< embed::XLinkageSupport > xLink( m_xImp->m_xObject, uno::UNO_QUERY );
1123 if ( xLink.is() && xLink->isLink() )
1124 m_xImp->m_xObject->changeState( embed::EmbedStates::LOADED );
1125 else
1126 m_xImp->m_xObject->changeState( embed::EmbedStates::RUNNING );
1127 }
1128 }
1129 catch (css::uno::Exception& )
1130 {}
1131}
1132
1134{
1135 return m_xImp->m_bUIActive;
1136}
1137
1139{
1140 m_xImp->m_bNegativeX = bSet;
1141}
1142
1144{
1145 return m_xImp->m_bNegativeX;
1146}
1147
1148/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AnyEventRef aEvent
static DialogMask HandleError(ErrCode nId, weld::Window *pParent=nullptr, DialogMask nMask=DialogMask::MAX)
MapUnit GetMapUnit() const
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
Definition: frame.cxx:515
void Resize()
Definition: frame.cxx:662
bool IsClosing_Impl() const
Definition: frame.cxx:197
SAL_DLLPRIVATE void LockResize_Impl(bool bLock)
Definition: frame2.cxx:350
virtual void SAL_CALL disposing(const css::lang::EventObject &aEvent) override
Definition: ipclient.cxx:209
uno::Reference< embed::XEmbeddedObject > m_xObject
Definition: ipclient.cxx:126
virtual awt::Rectangle SAL_CALL getClipRectangle() override
Definition: ipclient.cxx:465
virtual void SAL_CALL activatingInplace() override
Definition: ipclient.cxx:343
virtual void SAL_CALL stateChanged(const css::lang::EventObject &aEvent, ::sal_Int32 nOldState, ::sal_Int32 nNewState) override
Definition: ipclient.cxx:182
SfxInPlaceClient * m_pClient
Definition: ipclient.cxx:119
virtual void SAL_CALL visibilityChanged(sal_Bool bVisible) override
Definition: ipclient.cxx:315
virtual awt::Rectangle SAL_CALL getPlacement() override
Definition: ipclient.cxx:430
virtual void SAL_CALL notifyEvent(const document::EventObject &aEvent) override
Definition: ipclient.cxx:197
virtual void SAL_CALL changedPlacement(const awt::Rectangle &aPosRect) override
Definition: ipclient.cxx:511
virtual uno::Reference< frame::XDispatchProvider > SAL_CALL getInplaceDispatchProvider() override
Definition: ipclient.cxx:424
virtual void SAL_CALL deactivatedInplace() override
Definition: ipclient.cxx:379
virtual uno::Reference< util::XCloseable > SAL_CALL getComponent() override
Definition: ipclient.cxx:560
virtual void SAL_CALL activatingUI() override
Definition: ipclient.cxx:368
virtual void SAL_CALL scrollObject(const awt::Size &aOffset) override
Definition: ipclient.cxx:504
virtual uno::Reference< awt::XWindow > SAL_CALL getWindow() override
Definition: ipclient.cxx:577
virtual void SAL_CALL saveObject() override
Definition: ipclient.cxx:224
virtual void SAL_CALL deactivatedUI() override
Definition: ipclient.cxx:393
virtual void SAL_CALL translateAccelerators(const uno::Sequence< awt::KeyEvent > &aKeys) override
Definition: ipclient.cxx:495
virtual void SAL_CALL changingState(const css::lang::EventObject &aEvent, ::sal_Int32 nOldState, ::sal_Int32 nNewState) override
Definition: ipclient.cxx:175
tools::Rectangle m_aObjArea
Definition: ipclient.cxx:116
uno::Reference< frame::XFrame > const & GetFrame() const
Definition: ipclient.cxx:217
virtual sal_Bool SAL_CALL canInplaceActivate() override
Definition: ipclient.cxx:330
DECL_LINK(TimerHdl, Timer *, void)
virtual uno::Reference< css::frame::XLayoutManager > SAL_CALL getLayoutManager() override
Definition: ipclient.cxx:403
void SetNegativeX(bool bSet)
To indicate that negated document X coordinates are used.
Definition: ipclient.cxx:1138
bool IsUIActive() const
Definition: ipclient.cxx:1133
sal_Int64 GetObjectMiscStatus() const
Definition: ipclient.cxx:692
bool SetObjArea(const tools::Rectangle &)
Definition: ipclient.cxx:757
VclPtr< vcl::Window > m_pEditWin
Definition: ipclient.hxx:48
void SetObjectState(sal_Int32)
Definition: ipclient.cxx:671
void SetObjAreaAndScale(const tools::Rectangle &, const Fraction &, const Fraction &)
Definition: ipclient.cxx:802
SfxViewShell * m_pViewSh
Definition: ipclient.hxx:47
const css::uno::Reference< css::embed::XEmbeddedObject > & GetObject() const
Definition: ipclient.cxx:700
virtual void FormatChanged()
Definition: ipclient.cxx:1055
virtual SAL_DLLPRIVATE void ObjectAreaChanged()
Definition: ipclient.cxx:1040
const Fraction & GetScaleHeight() const
Definition: ipclient.cxx:823
virtual SAL_DLLPRIVATE void ViewChanged()
Definition: ipclient.cxx:1050
void VisAreaChanged()
Definition: ipclient.cxx:1033
void SetObject(const css::uno::Reference< css::embed::XEmbeddedObject > &rObject)
Definition: ipclient.cxx:706
virtual SAL_DLLPRIVATE void RequestNewObjectArea(tools::Rectangle &)
Definition: ipclient.cxx:1045
vcl::Window * GetEditWin() const
Definition: ipclient.hxx:67
const tools::Rectangle & GetObjArea() const
Definition: ipclient.cxx:772
tools::Rectangle GetScaledObjArea() const
Definition: ipclient.cxx:777
bool IsObjectUIActive() const
Definition: ipclient.cxx:844
void SetSizeScale(const Fraction &rScaleWidth, const Fraction &rScaleHeight)
Definition: ipclient.cxx:786
rtl::Reference< SfxInPlaceClient_Impl > m_xImp
Definition: ipclient.hxx:46
virtual ~SfxInPlaceClient()
Definition: ipclient.cxx:651
bool IsNegativeX() const
Definition: ipclient.cxx:1143
bool IsObjectInPlaceActive() const
Definition: ipclient.cxx:856
ErrCode DoVerb(sal_Int32 nVerb)
Definition: ipclient.cxx:897
SfxInPlaceClient(SfxViewShell *pViewShell, vcl::Window *pDraw, sal_Int64 nAspect)
Definition: ipclient.cxx:637
const Fraction & GetScaleWidth() const
Definition: ipclient.cxx:817
static SfxInPlaceClient * GetClient(SfxObjectShell const *pDoc, const css::uno::Reference< css::embed::XEmbeddedObject > &xObject)
Definition: ipclient.cxx:877
SfxViewShell * GetViewShell() const
Definition: ipclient.hxx:66
virtual bool IsProtected() const
Definition: ipclient.cxx:1060
void DeactivateObject()
Definition: ipclient.cxx:1062
sal_Int64 GetAspect() const
Definition: ipclient.cxx:892
static void SetCurrentComponent(const css::uno::Reference< css::uno::XInterface > &_rxComponent)
Definition: objxtor.cxx:870
css::uno::Reference< css::frame::XModel3 > GetModel() const
Definition: objxtor.cxx:838
virtual void SetModified(bool bModified=true)
Definition: objmisc.cxx:301
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
Definition: viewfrm.cxx:2006
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
Definition: viewfrm.cxx:1983
SfxFrame & GetFrame() const
Definition: viewfrm.cxx:2782
static void SetViewFrame(SfxViewFrame *)
Definition: viewfrm.cxx:3583
One SfxViewShell more or less represents one edit window for a document, there can be multiple ones f...
Definition: viewsh.hxx:165
weld::Window * GetFrameWeld() const
Definition: viewsh.cxx:2891
virtual void UIActivating(SfxInPlaceClient *pClient)
Definition: viewsh.cxx:1452
SfxViewFrame & GetViewFrame() const
Definition: viewsh.hxx:290
SfxInPlaceClient * FindIPClient(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj, vcl::Window *pObjParentWin) const
Definition: viewsh.cxx:1473
SAL_DLLPRIVATE void IPClientGone_Impl(SfxInPlaceClient const *pIPClient)
Definition: viewsh.cxx:1039
void OutplaceActivated(bool bActive)
Definition: viewsh.cxx:1446
virtual SfxObjectShell * GetObjectShell() override
Definition: viewsh.cxx:2591
SAL_DLLPRIVATE void NewIPClient_Impl(SfxInPlaceClient *pIPClient)
Definition: viewsh.cxx:1034
SAL_DLLPRIVATE void ResetAllClients_Impl(SfxInPlaceClient const *pIP)
Definition: viewsh.cxx:2513
vcl::Window * GetWindow() const
Definition: viewsh.hxx:272
virtual void UIDeactivated(SfxInPlaceClient *pClient)
Definition: viewsh.cxx:1463
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static MapUnit UnoEmbed2VCLMapUnit(sal_Int32 nUnoEmbedMapUnit)
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
constexpr tools::Long GetWidth() const
constexpr tools::Long Top() const
void SetSize(const Size &)
constexpr Size GetSize() const
constexpr tools::Long Right() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
Point LogicToPixel(const Point &rLogicPt) const
void GrabFocus()
Size LogicToLogic(const Size &rSzSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
bool IsMapModeEnabled() const
const MapMode & GetMapMode() const
virtual css::uno::Reference< css::awt::XVclWindowPeer > GetComponentInterface(bool bCreate=true)
Point PixelToLogic(const Point &rDevicePt) const
void EnableMapMode(bool bEnable=true)
css::awt::Rectangle AWTRectangle(const ::tools::Rectangle &rVCLRect)
inline ::tools::Rectangle VCLRectangle(const css::awt::Rectangle &rAWTRect)
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
float u
sal_Int32 nState
#define ERRCODE_IO_GENERAL
#define ERRCODE_NONE
Any aHelper
bool & m_rFlag
IMPL_LINK_NOARG(SfxInPlaceClient_Impl, TimerHdl, Timer *, void)
Definition: ipclient.cxx:624
#define SFX_CLIENTACTIVATE_TIMEOUT
Definition: ipclient.cxx:71
MapUnit GetMapUnit()
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
Any SAL_CALL getCaughtException()
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
long Long
OUString toString(OptionInfo const *info)
#define ERRCODE_SO_CANNOT_DOVERB_NOW
#define ERRCODE_SO_GENERALERROR
SVT_DLLPUBLIC const ErrMsgCode RID_SO_ERRCTX[]
#define ERRCTX_SO_DOVERB
Reference< XController > xController
Reference< XFrame > xFrame
Reference< XModel > xModel
bool bVisible
unsigned char sal_Bool