25#include <svx/svxids.hrc>
29#include <editeng/editeng.hxx>
43#include <uiobject.hxx>
45#include <officecfg/Office/Common.hxx>
55#define SCROLL_LINE_FACT 0.05
56#define SCROLL_PAGE_FACT 0.5
57#define SCROLL_SENSITIVE 20
58#define ZOOM_MULTIPLICATOR 10000
64 DropTargetHelper( this ),
67 maViewSize(1000, 1000),
71 mbMinZoomAutoCalc(false),
72 mbCenterAllowed(true),
75 mbUseDropScroll (true)
80 aMap.SetMapUnit(MapUnit::Map100thMM);
106 if (pWindowUpdater !=
nullptr)
109 DropTargetHelper::dispose();
120 if (pWindowUpdater !=
nullptr)
130 if (pWindowUpdater !=
nullptr)
175 mnMinZoom =
static_cast<sal_uInt16
>(nMin);
180 mnMaxZoom =
static_cast<sal_uInt16
>(nMax);
185 if(
GetMapMode().GetScaleX().GetDenominator() )
187 return ::tools::Long(
GetMapMode().GetScaleX() * 100);
222 pOLV->GetEditView().GetEditEngine()->dumpAsXmlEditDoc(
nullptr);
264 if (rCEvt.
GetCommand() == CommandEventId::ModKeyChange)
283 bool bResult =
false;
357 pDrawViewShell->GetView()->RecalcLogicSnapMagnetic(*
GetOutDev());
392 if( (rZoomRect.GetWidth() != 0) && (rZoomRect.GetHeight() != 0))
402 if(rZoomRect.GetHeight())
408 if(rZoomRect.GetWidth())
451 if (rZoomRect.GetWidth() == 0 || rZoomRect.GetHeight() == 0)
459 Point aPos = rZoomRect.TopLeft();
465 DBG_ASSERT(rZoomRect.GetWidth(),
"ZoomRect-Width = 0!");
466 DBG_ASSERT(rZoomRect.GetHeight(),
"ZoomRect-Height = 0!");
475 if(rZoomRect.GetHeight())
481 if(rZoomRect.GetWidth())
538 bool bChanged =
false;
597 if (aPix.
Width() == 0)
622 aMap.SetOrigin(aNewOrigin);
764 if ( !((rDCEvt.
GetType() == DataChangedEventType::PRINTER) ||
765 (rDCEvt.
GetType() == DataChangedEventType::DISPLAY) ||
766 (rDCEvt.
GetType() == DataChangedEventType::FONTS) ||
767 (rDCEvt.
GetType() == DataChangedEventType::FONTSUBSTITUTION) ||
768 ((rDCEvt.
GetType() == DataChangedEventType::SETTINGS) &&
769 (rDCEvt.
GetFlags() & AllSettingsFlags::STYLE))) )
772 if ( (rDCEvt.
GetType() == DataChangedEventType::SETTINGS) &&
773 (rDCEvt.
GetFlags() & AllSettingsFlags::STYLE) )
788 sal_uInt16 nPreviewSlot;
796 && officecfg::Office::Common::Accessibility::IsForPagePreviews::get() )
797 nPreviewSlot = SID_PREVIEW_QUALITY_CONTRAST;
799 nPreviewSlot = SID_PREVIEW_QUALITY_COLOR;
829 if ( (rDCEvt.
GetType() == DataChangedEventType::DISPLAY) ||
830 ((rDCEvt.
GetType() == DataChangedEventType::SETTINGS) &&
831 (rDCEvt.
GetFlags() & AllSettingsFlags::STYLE)) )
842 if ( rDCEvt.
GetType() == DataChangedEventType::FONTS )
851 if ( (rDCEvt.
GetType() == DataChangedEventType::FONTS) ||
852 (rDCEvt.
GetType() == DataChangedEventType::FONTSUBSTITUTION) )
864 if ( rDCEvt.
GetType() == DataChangedEventType::PRINTER )
948 if ( (nDx || nDy) && (rMousePos.
X()!=0 || rMousePos.
Y()!=0 ) )
957css::uno::Reference<css::accessibility::XAccessible>
965 css::uno::Reference< css::accessibility::XAccessible > xAcc =
GetAccessible(
false);
978 SAL_WARN(
"sd",
"::sd::Window::CreateAccessible: no view shell");
990 pOLV = pOView->GetViewByWindow(
this);
1034 pResultRectangle =
nullptr;
1037 aRectangle = *pRectangle;
1042 pResultRectangle = &aRectangle;
1050 if (
get_id() ==
"impress_win")
const StyleSettings & GetStyleSettings() const
CommandEventId GetCommand() const
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
bool DeleteSurroundingText(const Selection &rRange)
OUString GetSurroundingText() const
Selection GetSurroundingTextSelection() const
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
const vcl::KeyCode & GetKeyCode() const
MapUnit GetMapUnit() const
vcl::Window * GetWindow() const
EditView & GetEditView() const
void ShowCursor(bool bGotoCursor=true, bool bActivate=false)
void SetDrawMode(DrawModeFlags nDrawMode)
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
void dumpAsXml(xmlTextWriterPtr pWriter) const override
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
const SfxItemPool & GetItemPool() const
const OutlinerView * GetTextEditOutlinerView() const
virtual bool IsTextEdit() const final override
void Invalidate(sal_uInt16 nId)
static void notifyInvalidation(SfxViewShell const *pThisView, tools::Rectangle const *)
virtual void Invalidate(sal_uInt16 nId=0)
SfxViewShell * GetViewShell() const
SfxBindings & GetBindings()
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
bool GetHighContrastMode() const
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
void SetPrinter(SfxPrinter *pNewPrinter)
Set new SfxPrinter (transfer of ownership)
SfxPrinter * GetPrinter(bool bCreate)
Creates (if necessary) and returns a SfxPrinter.
SdDrawDocument * GetDoc()
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
bool IsInSwitchPage() const
void SetDrawMode(DrawModeFlags nNewDrawMode)
Show a textual overview of the text contents of all slides.
Derivative of sd::View for the outline mode |* .
This view shell is responsible for showing the presentation of an Impress document.
Base class of the stacked shell hierarchy.
SD_DLLPUBLIC DrawDocShell * GetDocSh() const
virtual bool KeyInput(const KeyEvent &rKEvt, ::sd::Window *pWin)
SdDrawDocument * GetDoc() const
bool RequestHelp(const HelpEvent &rEvt)
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt, DropTargetHelper &rTargetHelper, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer)
virtual void Paint(const ::tools::Rectangle &rRect, ::sd::Window *pWin)
virtual void MouseMove(const MouseEvent &rMEvt, ::sd::Window *pWin)
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt, DropTargetHelper &rTargetHelper, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer)
virtual void Command(const CommandEvent &rCEvt, ::sd::Window *pWin)
virtual void MouseButtonUp(const MouseEvent &rMEvt, ::sd::Window *pWin)
::sd::WindowUpdater * GetWindowUpdater() const
Return the window updater of this view shell.
virtual void ArrangeGUIElements()
Set position and size of the GUI elements that are controlled by the view shell like rulers and scrol...
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleDocumentView(::sd::Window *pWindow)
Create an accessible object representing the specified window.
FrameView * GetFrameView()
void ScrollLines(::tools::Long nX, ::tools::Long nY)
Scroll a specific number of lines.
::sd::View * GetView() const
virtual void MouseButtonDown(const MouseEvent &rMEvt, ::sd::Window *pWin)
bool Notify(NotifyEvent const &rNEvt, ::sd::Window *pWin)
void ExecReq(SfxRequest &rReq)
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
SD_DLLPUBLIC ShellType GetShellType() const
Return the type of the shell.
The purpose of the <type>WindowUpdater</type> is to update output devices to take care of modified gl...
void RegisterWindow(vcl::Window *pWindow)
Add the given device to the list of devices which will be updated when one of the monitored values ch...
void UnregisterWindow(vcl::Window *pWindow)
Remove the given device from the list of devices which will be updated when one of the monitored valu...
void DropScroll(const Point &rMousePos)
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
double GetVisibleWidth() const
::tools::Long SetZoomFactor(::tools::Long nZoom)
This internally used method performs the actual adaptation of the window's map mode to the specified ...
bool DeleteSurroundingText(const Selection &rSelection) override
double GetScrlPageHeight() const
OUString GetSurroundingText() const override
void GrabFocus()
Activate window.
Selection GetSurroundingTextSelection() const override
double GetVisibleX() const
virtual void LoseFocus() override
Deactivate window.
double GetVisibleY() const
FactoryFunction GetUITestFactory() const override
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt) override
virtual void PrePaint(vcl::RenderContext &rRenderContext) override
void SetViewShell(ViewShell *pViewSh)
void SetViewSize(const Size &rSize)
Set size of the whole working area which can be seen with the window.
void CalcMinZoom()
Calculate the minimal zoom factor as the value at which the application area would completely fill th...
void SetMaxZoom(::tools::Long nMax)
double GetVisibleHeight() const
virtual ~Window() override
virtual void Paint(vcl::RenderContext &rRenderContext, const ::tools::Rectangle &rRect) override
void SetUseDropScroll(bool bUseDropScroll)
The DropScroll() method is used by AcceptDrop() to scroll the content of the window while dragging an...
bool mbMinZoomAutoCalc
This flag tells whether to re-calculate the minimal zoom factor depending on the current zoom factor.
void SetCenterAllowed(bool bIsAllowed)
double GetScrlLineHeight() const
void SetMinZoomAutoCalc(bool bAuto)
void SetMinZoom(::tools::Long nMin)
ViewShell * GetViewShell()
virtual void dispose() override
::tools::Long GetZoomForRect(const ::tools::Rectangle &rZoomRect)
virtual void KeyInput(const KeyEvent &rKEvt) override
void LogicInvalidate(const ::tools::Rectangle *pRectangle) override
void SetWinViewPos(const Point &rPnt)
Set the position of the upper left corner from the visible area of the window.
::tools::Long SetZoomRect(const ::tools::Rectangle &rZoomRect)
This method is called when the whole page shall be displayed in the window.
Window(vcl::Window *pParent)
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual bool EventNotify(NotifyEvent &rNEvt) override
virtual void Command(const CommandEvent &rCEvt) override
virtual void RequestHelp(const HelpEvent &rEvt) override
void SetViewOrigin(const Point &rPnt)
Set origin of the representation in respect to the whole working area.
::tools::Long GetZoom() const
double GetScrlPageWidth() const
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
Create an accessibility object that makes this window accessible.
double GetScrlLineWidth() const
void SetVisibleXY(double fX, double fY)
Set x and y position of the visible area as fraction (< 1) of the whole working area.
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
OutlinerView * GetOutlinerView() const
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
void UpdateMapOrigin(bool bInvalidate=true)
Calculate origin of the map mode according to the size of the view and window (its size in model coor...
virtual void MouseMove(const MouseEvent &rMEvt) override
void SetZoomIntegral(::tools::Long nZoom)
Set the zoom factor to the specified value and center the display area around the zoom center.
virtual void Resize() override
sal_uInt16 GetCode() const
virtual void dispose() override
virtual void RequestHelp(const HelpEvent &rHEvt)
Point LogicToPixel(const Point &rLogicPt) const
const OUString & get_id() const
virtual void Command(const CommandEvent &rCEvt)
void SetAccessible(const css::uno::Reference< css::accessibility::XAccessible > &)
virtual void EnableRTL(bool bEnable=true)
bool IsMapModeEnabled() const
const AllSettings & GetSettings() const
virtual void KeyInput(const KeyEvent &rKEvt)
const MapMode & GetMapMode() const
::OutputDevice const * GetOutDev() const
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible()
virtual void Scroll(tools::Long nHorzScroll, tools::Long nVertScroll, ScrollFlags nFlags=ScrollFlags::NONE)
Point PixelToLogic(const Point &rDevicePt) const
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
Size GetOutputSizePixel() const
virtual void DataChanged(const DataChangedEvent &rDCEvt)
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
void EnableMapMode(bool bEnable=true)
void SetDialogControlFlags(DialogControlFlags nFlags)
virtual bool EventNotify(NotifyEvent &rNEvt)
#define DBG_ASSERT(sCon, aError)
std::function< std::unique_ptr< UIObject >(vcl::Window *)> FactoryFunction
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_F12
#define SAL_WARN(area, stream)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
const DrawModeFlags OUTPUT_DRAWMODE_CONTRAST
const DrawModeFlags OUTPUT_DRAWMODE_COLOR
HashMap_OWString_Interface aMap
#define MAX_ZOOM
maximal zoom factor
#define MIN_ZOOM
minimal zoom factor
#define SCROLL_PAGE_FACT
factor for page scrolling
#define SCROLL_SENSITIVE
sensitive area in pixel
#define SCROLL_LINE_FACT
factor for line scrolling
#define ZOOM_MULTIPLICATOR
multiplier to avoid rounding errors
constexpr SdrLayerID SDRLAYER_NOTFOUND(-1)
WinBits const WB_DIALOGCONTROL
WinBits const WB_CLIPCHILDREN