11#include <uiobject.hxx>
18#include <sfx2/sfxsids.hrc>
19#include <svx/uiobject.hxx>
46OUString getObjectName(
SdrObject const* pObject)
48 if (
pObject->GetName().isEmpty())
49 return "Unnamed Drawinglayer object " + OUString::number(
pObject->GetOrdNum());
56 SdrPage* pPage = getViewShell(xWindow)->getCurrentPage();
62 for (
size_t i = 0;
i < nObjs; ++
i)
65 if (rName == getObjectName(pObj))
73ImpressSdrObject::ImpressSdrObject(
const VclPtr<sd::Window>& xImpressWin, OUString aName)
74 : mxWindow(xImpressWin)
79SdrObject* ImpressSdrObject::get_object() {
return getObject(mxWindow, maName); }
91 aMap[
"SelectedText"] = getViewShell(
mxWindow)->GetSelectionText(
false);
92 aMap[
"CurrentSlide"] = OUString::number(getViewShell(
mxWindow)->GetCurPagePos() + 1);
93 aMap[
"Zoom"] = OUString::number(getViewShell(
mxWindow)->GetZoom());
100 if (rAction ==
"SET")
102 if (rParameters.find(
"ZOOM") != rParameters.end())
104 auto itr = rParameters.find(
"ZOOM");
105 OUString aVal = itr->second;
106 sal_Int32 nVal = aVal.toInt32();
107 getViewShell(
mxWindow)->SetZoom(nVal);
110 else if (rAction ==
"GOTO")
112 if (rParameters.find(
"PAGE") != rParameters.end())
114 auto itr = rParameters.find(
"PAGE");
115 OUString aVal = itr->second;
116 sal_Int32 nVal = aVal.toInt32();
117 getViewShell(
mxWindow)->SwitchPage(nVal - 1);
120 else if (rAction ==
"SELECT")
122 if (rParameters.find(
"OBJECT") != rParameters.end())
124 auto itr = rParameters.find(
"OBJECT");
125 OUString
aName = itr->second;
131 else if (rAction ==
"SIDEBAR")
134 DBG_ASSERT(pViewFrm,
"ImpressWindowUIObject::execute: no viewframe");
137 auto itr = rParameters.find(
"PANEL");
138 if (itr != rParameters.end())
140 OUString aVal = itr->second;
144 else if (rAction ==
"DESELECT")
146 getViewShell(
mxWindow)->GetView()->UnMarkAll();
154 return std::unique_ptr<UIObject>(
new ImpressSdrObject(
mxWindow, rID));
161 std::set<OUString> aRet;
166 for (
size_t i = 0;
i < nObjs; ++
i)
169 aRet.insert(getObjectName(
pObject));
virtual std::unique_ptr< UIObject > get_child(const OUString &rID) override
virtual StringMap get_state() override
ImpressWindowUIObject(const VclPtr< sd::Window > &xWindow)
virtual OUString get_name() const override
VclPtr< sd::Window > mxWindow
virtual std::set< OUString > get_children() const override
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
SdrPageView * GetSdrPageView() const
virtual SdrObject * get_object()=0
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
SfxFrame & GetFrame() const
void ShowChildWindow(sal_uInt16, bool bVisible=true)
virtual StringMap get_state() override
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
An SdWindow contains the actual working area of ViewShell.
#define DBG_ASSERT(sCon, aError)
EmbeddedObjectRef * pObject
HashMap_OWString_Interface aMap
std::map< OUString, OUString > StringMap