11#include <uiobject.hxx>
17#include <viewfunc.hxx>
29#include <com/sun/star/embed/EmbedVerbs.hpp>
41 sal_Int32 nOffset = 0;
49 sal_Int32 nOffset = 0;
59 mxGridWindow(xGridWin)
67 aMap[
"SelectedTable"] = OUString::number(
mxGridWindow->getViewData().GetTabNo());
68 aMap[
"CurrentColumn"] = OUString::number(
mxGridWindow->getViewData().GetCurX());
69 aMap[
"CurrentRow"] = OUString::number(
mxGridWindow->getViewData().GetCurY());
74 aMap[
"TopVisibleRow"] = OUString::number(
mxGridWindow->getViewData().GetPosY(eAlignY));
75 aMap[
"TopVisibleColumn"] = OUString::number(
mxGridWindow->getViewData().GetPosX(eAlignX));
78 OUString aMarkedAreaString;
81 aMap[
"MarkedArea"] = aMarkedAreaString;
142 if (rAction ==
"SELECT")
144 bool bExtend =
false;
145 if (rParameters.find(
"EXTEND") != rParameters.end())
147 auto itr = rParameters.find(
"EXTEND");
148 if (itr->second.equalsIgnoreAsciiCase(
"true") || itr->second ==
"1")
152 if (rParameters.find(
"CELL") != rParameters.end())
154 auto itr = rParameters.find(
"CELL");
155 const OUString& rStr = itr->second;
161 else if (rParameters.find(
"RANGE") != rParameters.end())
163 auto itr = rParameters.find(
"RANGE");
164 const OUString rStr = itr->second;
170 else if (rParameters.find(
"TABLE") != rParameters.end())
172 auto itr = rParameters.find(
"TABLE");
173 const OUString rStr = itr->second;
174 sal_Int32 nTab = rStr.toUInt32();
183 SAL_WARN(
"sc.uitest",
"incorrect table number");
187 else if (rParameters.find(
"OBJECT") != rParameters.end())
189 auto itr = rParameters.find(
"OBJECT");
190 const OUString rStr = itr->second;
197 SAL_WARN(
"sc.uitest",
"unknown selection method");
200 else if (rAction ==
"DESELECT")
202 if (rParameters.find(
"OBJECT") != rParameters.end())
211 else if (rAction ==
"ACTIVATE")
220 if (nSdrObjKind == SdrObjKind::OLE2)
227 SAL_WARN(
"sc.uitest",
"can't activate non-ole objects");
231 SAL_WARN(
"sc.uitest",
"can't activate the current selection");
233 else if (rAction ==
"LAUNCH")
235 if ( rParameters.find(
"AUTOFILTER") != rParameters.end())
237 auto itrCol = rParameters.find(
"COL");
238 if (itrCol == rParameters.end())
240 SAL_WARN(
"sc.uitest",
"missing COL parameter");
244 auto itrRow = rParameters.find(
"ROW");
245 if (itrRow == rParameters.end())
247 SAL_WARN(
"sc.uitest",
"missing ROW parameter");
250 SCROW nRow = itrRow->second.toUInt32();
251 SCCOL nCol = itrCol->second.toUInt32();
254 else if ( rParameters.find(
"PIVOTTABLE") != rParameters.end())
256 auto itrCol = rParameters.find(
"COL");
257 if (itrCol == rParameters.end())
259 SAL_WARN(
"sc.uitest",
"missing COL parameter");
263 auto itrRow = rParameters.find(
"ROW");
264 if (itrRow == rParameters.end())
266 SAL_WARN(
"sc.uitest",
"missing ROW parameter");
269 SCROW nRow = itrRow->second.toUInt32();
270 SCCOL nCol = itrCol->second.toUInt32();
273 else if ( rParameters.find(
"SELECTMENU") != rParameters.end())
275 auto itrCol = rParameters.find(
"COL");
276 if (itrCol == rParameters.end())
278 SAL_WARN(
"sc.uitest",
"missing COL parameter");
282 auto itrRow = rParameters.find(
"ROW");
283 if (itrRow == rParameters.end())
285 SAL_WARN(
"sc.uitest",
"missing ROW parameter");
288 SCROW nRow = itrRow->second.toUInt32();
289 SCCOL nCol = itrCol->second.toUInt32();
293 else if (rAction ==
"COMMENT")
295 if ( rParameters.find(
"OPEN") != rParameters.end() )
300 else if ( rParameters.find(
"CLOSE") != rParameters.end() )
307 else if ( rParameters.find(
"SETTEXT") != rParameters.end() )
309 auto itr = rParameters.find(
"SETTEXT");
310 const OUString rStr = itr->second;
316 else if (rAction ==
"SIDEBAR")
319 DBG_ASSERT(pViewFrm,
"ScGridWinUIObject::execute: no viewframe");
322 auto itr = rParameters.find(
"PANEL");
323 if (itr != rParameters.end())
325 OUString aVal = itr->second;
329 else if (rAction ==
"SET")
331 if (rParameters.find(
"ZOOM") != rParameters.end())
333 auto itr = rParameters.find(
"ZOOM");
334 OUString aVal = itr->second;
335 sal_Int32 nVal = aVal.toInt32();
344 pViewShell->
SetZoom( aFract, aFract,
true );
361 return xGridWindow->getViewData().GetDocument().GetDrawLayer();
366 ScDrawLayer* pDrawLayer = get_draw_layer(xGridWindow);
368 return pDrawLayer->
GetPage(nTab);
373 SCTAB nTab = xGridWindow->getViewData().GetTabNo();
374 SdrPage* pPage = get_draw_page(xGridWindow, nTab);
376 std::set<OUString> aRet;
385 if (
pObject->GetObjIdentifier() == SdrObjKind::OLE2)
387 aRet.insert(
static_cast<SdrOle2Obj*
>(pObject)->GetPersistName());
399 std::set<OUString> aChildren = collect_charts(
mxGridWindow);
417 return "ScGridWinUIObject";
Base class for all Drawmodule specific functions.
sal_uInt16 GetSlotID() const
sal_uInt16 GetZoom() const
void SetZoom(sal_uInt16 nNew)
SC_DLLPUBLIC bool GetPrintAreaVer(SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, SCROW &rEndRow, bool bNotes) const
SC_DLLPUBLIC ScPostIt * GetNote(const ScAddress &rPos)
SC_DLLPUBLIC bool GetPrintAreaHor(SCTAB nTab, SCROW nStartRow, SCROW nEndRow, SCCOL &rEndCol) const
SC_DLLPUBLIC bool HasNote(const ScAddress &rPos) const
SC_DLLPUBLIC ScPostIt * GetOrCreateNote(const ScAddress &rPos)
SC_DLLPUBLIC bool GetDataStart(SCTAB nTab, SCCOL &rStartCol, SCROW &rStartRow) const
SC_DLLPUBLIC SCTAB GetTableCount() const
bool SelectObject(std::u16string_view rName)
ScDrawView * getDrawView()
VclPtr< ScGridWindow > mxGridWindow
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
virtual OUString get_name() const override
ScViewFunc * getViewFunc()
ScGridWinUIObject(const VclPtr< ScGridWindow > &xGridWin)
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual std::set< OUString > get_children() const override
virtual StringMap get_state() override
virtual std::unique_ptr< UIObject > get_child(const OUString &rID) override
ScTabViewShell * getViewShell()
SC_DLLPUBLIC const ScAppOptions & GetAppOptions()
SC_DLLPUBLIC void SetAppOptions(const ScAppOptions &rOpt)
Additional class containing cell annotation data.
void SetText(const ScAddress &rPos, const OUString &rText)
Changes the caption text of this note.
OUString GetText() const
Returns the caption text of this note.
static bool GetAddressFromString(ScAddress &rAddress, std::u16string_view rAddressStr, const ScDocument &rDocument, formula::FormulaGrammar::AddressConvention eConv, sal_Int32 &nOffset, sal_Unicode cSeparator=' ', sal_Unicode cQuote='\'')
String to Range core.
static bool GetRangeFromString(ScRange &rRange, std::u16string_view rRangeStr, const ScDocument &rDocument, formula::FormulaGrammar::AddressConvention eConv, sal_Int32 &nOffset, sal_Unicode cSeparator=' ', sal_Unicode cQuote='\'')
static void GetStringFromRangeList(OUString &rString, const ScRangeList *pRangeList, const ScDocument *pDocument, formula::FormulaGrammar::AddressConvention eConv, sal_Unicode cSeparator=' ')
void ActivateObject(SdrOle2Obj *pObj, sal_Int32 nVerb)
void SetDrawShell(bool bActive)
FuPoor * GetDrawFuncPtr()
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
void SetZoom(const Fraction &rNewX, const Fraction &rNewY, bool bAll)
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
SfxDispatcher & GetDispatcher()
ScTabViewShell * GetViewShell() const
ScDBFunc * GetView() const
ScDrawView * GetScDrawView()
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
const SdrMarkList & GetMarkedObjectList() const
SdrObject * GetMarkedSdrObj() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
virtual SdrObjKind GetObjIdentifier() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
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
#define DBG_ASSERT(sCon, aError)
EmbeddedObjectRef * pObject
#define SAL_WARN(area, stream)
HashMap_OWString_Interface aMap
ScHSplitPos WhichH(ScSplitPos ePos)
ScVSplitPos WhichV(ScSplitPos ePos)
std::map< OUString, OUString > StringMap