47using namespace ::
sfx2;
56 std::unique_ptr<SfxPoolItem> _pItem;
58 if (eState >= SfxItemState::DEFAULT)
63 m_xMenu->CheckItem(nMID, !_pItem->IsVoidItem() &&
64 dynamic_cast< const SfxBoolItem *
>( _pItem.get() ) !=
nullptr &&
68 m_xMenu->EnableItem(nMID,
false);
72 m_xMenu->EnableItem(nMID,
false);
75#define MN_READONLY_GRAPHICTOGALLERY 1000
76#define MN_READONLY_BACKGROUNDTOGALLERY 2000
79 : m_aBuilder(nullptr,
AllSettings::GetUIRootDir(),
"modules/swriter/ui/readonlymenu.ui",
"")
80 , m_xMenu(m_aBuilder.get_menu(
u"menu"))
81 , m_nReadonlyOpenurl(m_xMenu->GetItemId(
u"openurl"))
82 , m_nReadonlyOpendoc(m_xMenu->GetItemId(
u"opendoc"))
83 , m_nReadonlyEditdoc(m_xMenu->GetItemId(
u"edit"))
84 , m_nReadonlySelectionMode(m_xMenu->GetItemId(
u"selection"))
85 , m_nReadonlyReload(m_xMenu->GetItemId(
u"reload"))
86 , m_nReadonlyReloadFrame(m_xMenu->GetItemId(
u"reloadframe"))
87 , m_nReadonlySourceview(m_xMenu->GetItemId(
u"html"))
88 , m_nReadonlyBrowseBackward(m_xMenu->GetItemId(
u"backward"))
89 , m_nReadonlyBrowseForward(m_xMenu->GetItemId(
u"forward"))
90 , m_nReadonlySaveGraphic(m_xMenu->GetItemId(
u"savegraphic"))
91 , m_nReadonlyGraphictogallery(m_xMenu->GetItemId(
u"graphictogallery"))
92 , m_nReadonlyTogallerylink(m_xMenu->GetItemId(
u"graphicaslink"))
93 , m_nReadonlyTogallerycopy(m_xMenu->GetItemId(
u"graphicascopy"))
94 , m_nReadonlySaveBackground(m_xMenu->GetItemId(
u"savebackground"))
95 , m_nReadonlyBackgroundtogallery(m_xMenu->GetItemId(
u"backgroundtogallery"))
96 , m_nReadonlyBackgroundTogallerylink(m_xMenu->GetItemId(
u"backaslink"))
97 , m_nReadonlyBackgroundTogallerycopy(m_xMenu->GetItemId(
u"backascopy"))
98 , m_nReadonlyCopylink(m_xMenu->GetItemId(
u"copylink"))
99 , m_nReadonlyLoadGraphic(m_xMenu->GetItemId(
u"loadgraphic"))
100 , m_nReadonlyGraphicoff(m_xMenu->GetItemId(
u"imagesoff"))
101 , m_nReadonlyFullscreen(m_xMenu->GetItemId(
u"fullscreen"))
102 , m_nReadonlyCopy(m_xMenu->GetItemId(
u"copy"))
108 OUString sDescription;
123 if (
nullptr == pGrf )
132 bool bEnableGraphicToGallery = bLink;
133 if ( bEnableGraphicToGallery )
145 bEnableGraphicToGallery =
false;
154 bool bEnableBackGallery =
false,
170 bEnableBackGallery =
true;
196 std::unique_ptr<SfxPoolItem> pState;
200 if (eState < SfxItemState::DEFAULT)
205 eState < SfxItemState::DEFAULT ||
220 m_xMenu->RemoveDisabledEntries(
true );
225 sal_uInt16
nId =
m_xMenu->Execute(pWin, rPixPos);
253 if ( !sTmp.isEmpty() )
261 sal_uInt16 nExecId = USHRT_MAX;
262 bool bFilterSet =
false;
265 nExecId = SID_WIN_FULLSCREEN;
279 nExecId = SID_EDITDOC;
285 nExecId = SID_BROWSE_BACKWARD;
287 nExecId = SID_BROWSE_FORWARD;
289 nExecId = SID_SOURCEVIEW;
295 pClipCntnr->CopyString(
m_sURL );
309 SW_MOD()->GetModuleConfig()->SetGrfToGalleryAsLnk(
true);
311 SW_MOD()->GetModuleConfig()->SetGrfToGalleryAsLnk(
false);
313 if( USHRT_MAX != nExecId )
318 if( pClipCntnr && pClipCntnr->HasAnyData() )
320 pClipCntnr->CopyToClipboard( pWin );
static bool FillThemeList(std::vector< OUString > &rThemeList)
static bool InsertURL(std::u16string_view rThemeName, std::u16string_view rURL)
static OUString ExportGraphic(weld::Window *pWin, const Graphic &rGraphic, const OUString &rGraphicName)
SfxItemState QueryState(sal_uInt16 nSID, std::unique_ptr< SfxPoolItem > &rpState)
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
SfxBindings * GetBindings() const
bool IsReadOnlyUI() const
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
weld::Window * GetFrameWeld() const
SfxViewFrame & GetViewFrame() const
bool GetContentAtPos(const Point &rPt, SwContentAtPos &rContentAtPos, bool bSetCursor=false, SwRect *pFieldRect=nullptr)
bool IsModified() const
Changes in document?
bool IsGlobalDoc() const
Interfaces for GlobalDocument.
const Graphic * GetGrfAtPos(const Point &rDocPos, OUString &rName, bool &rbLink) const
Deliver graphic in rName besides graphic name.
const SwFrameFormat * IsURLGrfAtPos(const Point &rPt, OUString *pURL=nullptr, OUString *pTargetFrameName=nullptr, OUString *pURLDescription=nullptr) const
Position is a graphic with URL?
size_t GetCurPageDesc(const bool bCalcFrame=true) const
const SwPageDesc & GetPageDesc(size_t i) const
SwFrameFormat & GetMaster()
const SwViewOption * GetViewOptions() const
SwWrtShell & GetWrtShell() const
SwDocShell * GetDocShell()
Used by the UI to modify the document model.
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
const SwView & GetView() const
#define FN_READONLY_SELECTION_MODE
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
union SwContentAtPos::@21 aFnd
const SfxPoolItem * pAttr
void LoadURL(SwViewShell &rVSh, const OUString &rURL, LoadUrlFlags nFilter, const OUString &rTargetFrameName)