11#include <uiobject.hxx>
21#include <editeng/editeng.hxx>
34 return xEditWin->GetView().GetWrtShell();
43 aMap[
"SelectedText"] =
mxEditWin->GetView().GetSelectionText();
45 sal_uInt16 nPageNum = 0;
46 sal_uInt16 nVirtPageNum = 0;
49 aMap[
"CurrentPage"] = OUString::number(nPageNum);
50 rWrtShell.
GetPageNum(nPageNum, nVirtPageNum,
false);
51 aMap[
"TopVisiblePage"] = OUString::number(nPageNum);
55 aMap[
"Pages"] = OUString::number(nPages);
74 if (rParameters.find(
"ZOOM") != rParameters.end())
76 auto itr = rParameters.find(
"ZOOM");
77 OUString aVal = itr->second;
78 sal_Int32 nVal = aVal.toInt32();
79 mxEditWin->GetView().SetZoom(SvxZoomType::PERCENT, nVal);
82 else if (rAction ==
"GOTO")
84 if (rParameters.find(
"PAGE") != rParameters.end())
86 auto itr = rParameters.find(
"PAGE");
87 OUString aVal = itr->second;
88 sal_Int32 nVal = aVal.toInt32();
89 getWrtShell(
mxEditWin).GotoPage(nVal,
false);
92 else if (rAction ==
"SELECT")
94 if (rParameters.find(
"START_POS") != rParameters.end())
96 auto itr = rParameters.find(
"START_POS");
97 OUString aStartPos = itr->second;
100 itr = rParameters.find(
"END_POS");
101 assert(itr != rParameters.end());
102 OUString aEndPos = itr->second;
106 if (
shell.GetCursor_()->GetPoint()->GetNode().GetTextNode())
113 sal_Int32(nStartPos) < 0 || nStartPos > len || sal_Int32(nEndPos) < 0 || nEndPos > len,
"sw.ui",
114 "SELECT START/END_POS " << sal_Int32(nStartPos) <<
".." << sal_Int32(nEndPos) <<
" outside 0.." << sal_Int32(len));
115 shell.SelectTextView(
120 SAL_WARN(
"sw.ui",
"SELECT without SwTextNode");
124 else if (rAction ==
"SIDEBAR")
127 DBG_ASSERT(pViewFrm,
"SwEditWinUIObject::execute: no viewframe");
130 if (rParameters.find(
"PANEL") != rParameters.end())
132 auto itr = rParameters.find(
"PANEL");
133 OUString aVal = itr->second;
143 return "SwEditWinUIObject";
155 mxCommentUIObject(xCommentUIObject)
175 if (rAction ==
"SELECT")
177 if (rParameters.find(
"FROM") != rParameters.end() &&
178 rParameters.find(
"TO") != rParameters.end())
180 tools::Long nMin = rParameters.find(
"FROM")->second.toInt32();
181 tools::Long nMax = rParameters.find(
"TO")->second.toInt32();
186 else if (rAction ==
"LEAVE")
190 else if (rAction ==
"HIDE")
194 else if (rAction ==
"SHOW")
198 else if (rAction ==
"DELETE")
202 else if (rAction ==
"RESOLVE")
213 assert(pCommentUIObject);
214 return std::unique_ptr<UIObject>(
new CommentUIObject(pCommentUIObject));
219 return "CommentUIObject";
224 mxPageBreakUIObject(xPageBreakUIObject)
231 if (rAction ==
"DELETE" || rAction ==
"EDIT")
240 assert(pPageBreakWin);
246 return "PageBreakUIObject";
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
PageBreakUIObject(const VclPtr< SwBreakDashedLine > &xEditWin)
VclPtr< SwBreakDashedLine > mxPageBreakUIObject
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
virtual OUString get_name() const override
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
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)
Class for the page break control window.
bool IsStartSentence() const
bool IsEndWord(sal_Int16 nWordType=css::i18n::WordType::ANYWORD_IGNOREWHITESPACES) const
void GetPageNum(sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, bool bAtCursorPos=true, const bool bCalcFrame=true)
bool IsStartOfDoc() const
bool IsStartWord(sal_Int16 nWordType=css::i18n::WordType::ANYWORD_IGNOREWHITESPACES) const
bool IsEndSentence() const
virtual StringMap get_state() override
SwEditWinUIObject(const VclPtr< SwEditWin > &xEditWin)
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
VclPtr< SwEditWin > mxEditWin
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
virtual OUString get_name() const override
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
sal_uInt16 GetZoom() const
const SwViewOption * GetViewOptions() const
Used by the UI to modify the document model.
virtual StringMap get_state() override
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
#define DBG_ASSERT(sCon, aError)
ESelection aNewSelection(GetSelection())
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
HashMap_OWString_Interface aMap
bool GoCurrPara(SwPaM &rPam, SwMoveFnCollection const &aPosPara)
SwMoveFnCollection const & fnParaEnd
std::map< OUString, OUString > StringMap