24#include <com/sun/star/embed/XEmbeddedObject.hpp>
29#include <svx/svxids.hrc>
52#include <drawview.hxx>
71#include <LibreOfficeKit/LibreOfficeKitEnums.h>
93 if (pTopViewShell ==
this)
136 void Lock(
bool bLock);
139 explicit LockUI(
SfxViewFrame *pFrame) : mpFrame(pFrame) { Lock(
true); }
140 ~LockUI() { Lock(
false); }
144 void LockUI::Lock(
bool bLock)
148 mpFrame->Enable( !bLock );
163 SID_3D_STATE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem });
179 if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::OLE2)
184 else if (nSdrObjKind == SdrObjKind::Graphic)
190 rBase.
SetVerbs( uno::Sequence< embed::VerbDescriptor >() );
210 const uno::Reference < embed::XEmbeddedObject >& xObj = pOleObj->
GetObjRef();
213 rBase.
SetVerbs( xObj->getSupportedVerbs() );
217 rBase.
SetVerbs( uno::Sequence < embed::VerbDescriptor >() );
225 const uno::Reference < embed::XEmbeddedObject >& xObj = pOleObj->
GetObjRef();
228 rBase.
SetVerbs( xObj->getSupportedVerbs() );
232 rBase.
SetVerbs( uno::Sequence < embed::VerbDescriptor >() );
237 rBase.
SetVerbs( uno::Sequence < embed::VerbDescriptor >() );
241 catch( css::uno::Exception& )
265void collectUIInformation(
const OUString& aZoom)
268 aDescription.
aID =
"impress_win";
271 aDescription.
aKeyWord =
"ImpressWindowUIObject";
272 aDescription.
aParent =
"MainWindow";
291 collectUIInformation(OUString::number(nZoom));
319 if (nID == SID_TEXTEDIT || nID == SID_ATTR_CHAR)
359 if (pLayerBar !=
nullptr)
388 if ( !bShowMasterViewToolbar )
390 if ( !bShowPresentationToolbar )
407 for (sal_uInt16
i = 0;
i < nPageCnt;
i++)
410 OUString aPageName = pPage->
GetName();
424 mpDrawView->GetModel().SetDisableTextEditUsesCommonUndoManager(
false);
432 AnimationChildWindow::GetChildWindowId(),
false );
436 ".uno:SlideMasterPage=true");
444 sal_uInt16 nActualMasterPageId =
maTabControl->GetPageId(0);
447 for (sal_uInt16
i = 0;
i < nMasterPageCnt;
i++)
453 aLayoutName = aLayoutName.copy(0,
nPos);
459 nActualMasterPageId = pMaster->
getPageId();
470 mpDrawView->GetModel().SetDisableTextEditUsesCommonUndoManager(
true);
478 if (bShowMasterViewToolbar)
482 if (bShowPresentationToolbar)
527 nFlags |= SvxRulerSupportFlags::SET_NULLOFFSET |
528 SvxRulerSupportFlags::TABS |
529 SvxRulerSupportFlags::PARAGRAPH_MARGINS;
537 if( nMetric == 0xffff )
547 pRuler->SetZoom(aUIScale);
568 if( nMetric == 0xffff )
575 pRuler->SetZoom(aUIScale);
615 const ::tools::Long nMax = maViewSize.Width() - maScrBarWH.Width()
616 - maTabControl->GetPosPixel().X() ;
618 Size aTabSize = maTabControl->GetSizePixel();
621 maTabControl->SetSizePixel(aTabSize);
623 if(GetLayerTabControl())
625 GetLayerTabControl()->SetSizePixel(aTabSize);
628 Point aPos = maTabControl->GetPosPixel();
631 Size aScrSize(nMax - aTabSize.
Width(), maScrBarWH.Height());
632 mpHorizontalScrollBar->SetPosSizePixel(aPos, aScrSize);
642 sal_uInt16 nCurrentPage =
maTabControl->GetCurPagePos();
643 DBG_ASSERT((nCurrentPage<nPageCount),
"sd::DrawViewShell::getCurrentPage(), illegal page index!");
644 if (nCurrentPage >= nPageCount)
666 sal_uInt16 nCurrentPageId =
maTabControl->GetCurPageId();
667 sal_uInt16 nNewPageId;
668 sal_uInt16 nCurrentPageNum =
maTabControl->GetPagePos(nCurrentPageId);
679 for (sal_uInt16
i = 0;
i < nPageCount;
i++)
682 OUString aPageName = pPage->
GetName();
685 if (nCurrentPageId == pPage->
getPageId())
702 for (sal_uInt16
i = 0;
i < nMasterPageCnt;
i++)
708 aLayoutName = aLayoutName.copy(0,
nPos);
711 if (pMaster->
getPageId() == nCurrentPageId)
720 bool bAllowChangeFocus = nNewPageId != nCurrentPageId;
723 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
744 if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::OLE2)
759 bool bActivated =
false;
787 pageSelector.DeselectPage(nPage);
789 else if (nSelect == 1)
792 pageSelector.SelectPage(nPage);
800 pageSelector.DeselectPage(nPage);
805 pageSelector.SelectPage(nPage);
818 if (pVShell !=
nullptr)
819 return pVShell->
GetSlideSorter().GetController().GetPageSelector().IsPageSelected(nPage);
851 [
this, nSelectedPage] () { this->
SwitchPage(nSelectedPage); } );
876 if (nSelectedPage >= nPageCount)
877 nSelectedPage = nPageCount-1;
888 SdPage* pNewPage =
nullptr;
901 sPageText = sPageText.copy(0,
nPos);
925 && pNewPage == pCurrentPage
935 if (bAllowChangeFocus)
950 for (sal_uInt16
i = 0;
i < nPageCount;
i++)
963 for (sal_uInt16
i = 0;
i < nPageCount;
i++)
994 OString aPayload = OString::number(nSelectedPage);
996 pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload);
1000 if( !xSlideshow.is() || !xSlideshow->isRunning() || ( xSlideshow->getAnimationMode() !=
ANIMATIONMODE_SHOW ) )
1011 std::vector<Graphic*> graphics;
1013 if(graphics.size() > 1)
1144 aLayoutName = aLayoutName.copy(0,
nPos);
1164 static_cast<SdrPageObj*
>(pObj)->SetReferencedPage(
nullptr);
1177 rBindings.
Invalidate(SID_NAVIGATOR_STATE,
true);
1178 rBindings.
Invalidate(SID_NAVIGATOR_PAGENAME,
true);
1180 rBindings.
Invalidate(SID_DELETE_MASTER_PAGE,
true);
1182 rBindings.
Invalidate(SID_ASSIGN_LAYOUT,
true);
1201 if (pFormShell !=
nullptr && !pFormShell->
PrepareClose(
false))
1214 if (pLayerBar ==
nullptr)
1229 OUString aActiveLayer =
mpDrawView->GetActiveLayer();
1234 for ( sal_uInt16 nLayerPos = 0; nLayerPos < nLayerCnt; nLayerPos++ )
1238 if (
aName == aActiveLayer )
1240 nActiveLayerPos = nLayerPos;
1258 nBits |= TabBarPageBits::Blue;
1262 nBits |= TabBarPageBits::Italic;
1266 nBits |= TabBarPageBits::Underline;
1281 nBits = TabBarPageBits::Blue;
1285 nBits |= TabBarPageBits::Italic;
1289 nBits |= TabBarPageBits::Underline;
1302 nActiveLayerPos = nOldLayerPos - 1;
1324 DropTargetHelper& rTargetHelper,
1332 return mpDrawView->AcceptDrop( rEvt, rTargetHelper, nLayer );
void MakeGraphicsAvailableThreaded(std::vector< Graphic * > &rGraphics)
static GraphicFilter & GetGraphicFilter()
const Fraction & GetScaleX() const
const Fraction & GetScaleY() const
tools::Long AdjustX(tools::Long nHorzMove)
sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
SdPage * GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
SAL_DLLPRIVATE void SetSelected(SdPage *pPage, bool bSelect)
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
sd::ShapeList & GetPresentationShapeList()
PresObjKind GetPresObjKind(SdrObject *pObj) const
virtual OUString GetLayoutName() const override
const OUString & GetName() const
sal_uInt16 getPageId() const
void getGraphicsForPrefetch(std::vector< Graphic * > &graphics) const
Returns graphics objects from the page that can be prefetched before it's painted.
sal_uInt16 GetLayerCount() const
SdrLayer * GetLayer(sal_uInt16 i)
const OUString & GetName() const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
SdrObject * GetMarkedSdrObj() const
sal_uInt16 GetDefaultTabulator() const
FieldUnit GetUIUnit() const
const Fraction & GetUIScale() const
const SdrLayerAdmin & GetLayerAdmin() const
virtual SdrInventor GetObjInventor() const
virtual SdrObjKind GetObjIdentifier() const
css::uno::Reference< css::embed::XEmbeddedObject > const & GetObjRef() const
const SdrLayerIDSet & GetVisibleLayers() const
void SetLockedLayers(const SdrLayerIDSet &rSet)
void SetVisibleLayers(const SdrLayerIDSet &rSet)
bool IsLayerVisible(const OUString &rName) const
void SetPrintableLayers(const SdrLayerIDSet &rSet)
const SdrHelpLineList & GetHelpLines() const
const SdrLayerIDSet & GetLockedLayers() const
SdrPage * GetPage() const
bool IsLayerLocked(const OUString &rName) const
const SdrLayerIDSet & GetPrintableLayers() const
bool IsLayerPrintable(const OUString &rName) const
void SetHelpLines(const SdrHelpLineList &rHLL)
SdrPage & TRG_GetMasterPage() const
sal_uInt16 GetPageNum() const
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
SfxModule * GetModule() const
bool IsObjectInPlaceActive() const
FieldUnit GetFieldUnit() const
bool SetContextBroadcasterEnabled(const bool bIsEnabled)
void SetVerbs(const css::uno::Sequence< css::embed::VerbDescriptor > &aVerbs)
void SetContextName(const OUString &rsContextName)
virtual void Invalidate(sal_uInt16 nId=0)
SfxViewShell * GetViewShell() const
SfxBindings & GetBindings()
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
SfxDispatcher * GetDispatcher()
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
void DisconnectAllClients()
SfxViewFrame & GetViewFrame() const
SfxInPlaceClient * GetIPClient() const
void setWidth(tools::Long nWidth)
constexpr tools::Long Width() const
void SetCurPageId(sal_uInt16 nPageId)
void EndEditMode(bool bCancel=false)
sal_uInt16 GetPageCount() const
sal_uInt16 GetCurPageId() const
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
static VclPtr< reference_type > Create(Arg &&... arg)
void BroadcastContextChange() const
Broadcast a sidebar context change that is caused by a view switch.
void FireChangeEditMode(bool bMasterPageMode) noexcept
Call this method when the edit mode has changed.
void FireSelectionChangeListener() noexcept
Call this method when the selection has changed.
void FireChangeLayerMode(bool bLayerMode) noexcept
Call this method when the layer mode has changed.
void FireSwitchCurrentPage(SdPage *pCurrentPage) noexcept
Call this method when there is a new current page.
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
bool mbIsInSwitchPage
This flag is used to prevent nested calls to SwitchPage().
bool IsSelected(sal_uInt16 nPage)
virtual void UIActivating(SfxInPlaceClient *) override
virtual SdPage * getCurrentPage() const override
inherited from sd::ViewShell
std::unique_ptr< DrawView > mpDrawView
void UpdateIMapDlg(SdrObject *pObj)
virtual void SetZoomRect(const ::tools::Rectangle &rZoomRect) override
Set zoom rectangle for active window.
virtual void VisAreaChanged(const ::tools::Rectangle &rRect) override
this method is called when the visible area of the view from this viewshell is changed
virtual void Activate(bool bIsMDIActivate) override
set focus to working window
virtual ErrCode DoVerb(sal_Int32 nVerb) override
Apply "Verb" on OLE-object.
::std::unique_ptr< ViewOverlayManager > mpViewOverlayManager
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt, DropTargetHelper &rTargetHelper, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer) override
AcceptDrop.
virtual void UpdateVRuler() override
Refresh vertical ruler.
VclPtr< TabControl > maTabControl
bool mbFirstTimeActivation
Prevents grabbing focus while loading - see tdf#83773 that introduced the grabbing,...
virtual void ChangeEditMode(EditMode eMode, bool bIsLayerModeActive)
Set status (enabled/disabled) of menu SfxSlots.
bool mbIsLayerModeActive
This flag controls whether the layer mode is active, i.e.
virtual VclPtr< SvxRuler > CreateVRuler(::sd::Window *pWin) override
Generate vertical ruler.
tools::AsynchronousCall maAsynchronousSwitchPageCall
On some occasions it is necessary to make SwitchPage calls asynchronously.
virtual VclPtr< SvxRuler > CreateHRuler(::sd::Window *pWin) override
Generate horizontal ruler.
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt, DropTargetHelper &rTargetHelper, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer) override
ExecuteDrop.
SD_DLLPUBLIC LayerTabBar * GetLayerTabControl()
Return a pointer to the tab control for layers.
virtual void UIDeactivated(SfxInPlaceClient *) override
OUString const & GetSidebarContextName() const
bool SelectPage(sal_uInt16 nPage, sal_uInt16 nSelect)
Mark the desired page as selected (1), deselected (0), toggle (2).
void ConfigureAppBackgroundColor(svtools::ColorConfig *pColorConfig=nullptr)
bool SwitchPage(sal_uInt16 nPage, bool bAllowChangeFocus=true)
Switch to desired page.
virtual bool PrepareClose(bool bUI=true) override
PrepareClose, as appropriate end text input, so other viewshells discover a refreshed text object.
void ResetActualPage()
Select new refreshed page, in case of a page order change (eg.
bool IsSwitchPageAllowed() const
Check if page change is allowed.
void SelectionHasChanged()
Called, if state of selection of view is changed.
virtual bool ActivateObject(SdrOle2Obj *pObj, sal_Int32 nVerb) override
Activate OLE-object.
virtual void UpdateHRuler() override
Refresh horizontal ruler.
void ResetActualLayer()
Select new refreshed page, in case of a page order change (eg.
virtual void SetZoom(::tools::Long nZoom) override
set zoom factor
virtual void Deactivate(bool IsMDIActivate) override
void SetLockedLayers(const SdrLayerIDSet &rLockedLayers)
void SetNotesHelpLines(const SdrHelpLineList &rHelpLines)
const SdrHelpLineList & GetStandardHelpLines() const
void SetPrintableLayers(const SdrLayerIDSet &rPrintableLayers)
const SdrHelpLineList & GetHandoutHelpLines() const
const SdrLayerIDSet & GetLockedLayers() const
const SdrLayerIDSet & GetVisibleLayers() const
const SdrHelpLineList & GetNotesHelpLines() const
void SetSelectedPage(sal_uInt16 nPage)
void SetHandoutHelpLines(const SdrHelpLineList &rHelpLines)
void SetStandardHelpLines(const SdrHelpLineList &rHelpLines)
void SetVisibleLayers(const SdrLayerIDSet &rVisibleLayers)
const SdrLayerIDSet & GetPrintableLayers() const
OUString GetLayerName(sal_uInt16 nPageId) const
virtual void InsertPage(sal_uInt16 nPageId, const OUString &rText, TabBarPageBits nBits=TabBarPageBits::NONE, sal_uInt16 nPos=TabBar::APPEND) override
an instance of this guard disables modification of a document during its lifetime
SdrObject * getNextShape()
returns the shape the internal iterator points to, or 0 if the list end is reached.
void seekShape(sal_uInt32 nIndex)
Sets the internal iterator to the shape at given index.
static bool IsRunning(ViewShellBase const &rBase)
returns true if there is a running presentation for the given ViewShellBase
static rtl::Reference< SlideShow > GetSlideShow(SdDrawDocument const *pDocument)
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
DrawController * GetDrawController() const
std::shared_ptr< ToolBarManager > const & GetToolBarManager() const
std::shared_ptr< FormShellManager > const & GetFormShellManager() const
std::shared_ptr< ViewShellManager > const & GetViewShellManager() const
Local derivation of the SfxHint class that defines some hint ids that are used by the ViewShell class...
@ HINT_COMPLEX_MODEL_CHANGE_END
@ HINT_COMPLEX_MODEL_CHANGE_START
Use this class to safely lock updates of the view shell stack.
virtual void UpdatePreview(SdPage *pPage)
This method is still used by the OutlineViewShell to update the model according to the content of the...
SD_DLLPUBLIC DrawDocShell * GetDocSh() const
VclPtr< SvxRuler > mpHorizontalRuler
Horizontal ruler is not shown by default.
bool IsMainViewShell() const
Return <TRUE> when the called view shell is the main sub shell of its ViewShellBase object,...
const rtl::Reference< FuPoor > & GetCurrentFunction() const
SdDrawDocument * GetDoc() const
virtual void SetZoom(::tools::Long nZoom)
Set zoom factor for all split windows.
std::unique_ptr< Implementation, o3tl::default_delete< Implementation > > mpImpl
virtual bool ActivateObject(SdrOle2Obj *pObj, sal_Int32 nVerb)
VclPtr< SvxRuler > mpVerticalRuler
Vertical ruler is not shown by default.
void InvalidateWindows()
Invalidate all split windows below the ?provided rectangle.
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
virtual bool PrepareClose(bool bUI=true)
Tell the FmFormShell that the view shell is closing.
vcl::Window * GetParentWindow() const
Return the window that is the parent of all controls of this view shell.
virtual void SetZoomRect(const ::tools::Rectangle &rZoomRect)
Set zoom rectangle for active window.
virtual void UIActivating(SfxInPlaceClient *)
virtual void Activate(bool IsMDIActivate) override
set focus to working window
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
virtual void UIDeactivated(SfxInPlaceClient *)
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
bool HasCurrentFunction() const
SD_DLLPUBLIC ShellType GetShellType() const
Return the type of the shell.
virtual void Deactivate(bool IsMDIActivate) override
An SdWindow contains the actual working area of ViewShell.
void GrabFocus()
Activate window.
SD_DLLPUBLIC SlideSorter & GetSlideSorter() const
static SD_DLLPUBLIC SlideSorterViewShell * GetSlideSorter(ViewShellBase &rBase)
Return a slide sorter that is currently displayed in one of the panes that belong to the given ViewSh...
SD_DLLPUBLIC controller::SlideSorterController & GetController() const
SD_DLLPUBLIC PageSelector & GetPageSelector()
static bool IsActive(bool bConsiderSingleToolbar=false)
const MapMode & GetMapMode() const
Point PixelToLogic(const Point &rDevicePt) const
Size GetOutputSizePixel() const
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
virtual SfxBindings & GetBindings() override
constexpr OUStringLiteral SD_LT_SEPARATOR
IMPL_LINK(SdCharHeightPropertyBox, implMenuSelectHdl, const OUString &, rIdent, void)
constexpr WinBits WB_EXTRAFIELD
std::map< OUString, OUString > aParameters
#define SDRLAYERPOS_NOTFOUND
constexpr OUStringLiteral sUNO_LayerName_measurelines
constexpr OUStringLiteral sUNO_LayerName_background_objects
constexpr OUStringLiteral sUNO_LayerName_layout
constexpr OUStringLiteral sUNO_LayerName_controls
constexpr OUStringLiteral sUNO_LayerName_background