20 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
32 #include <strings.hrc>
37 : GenericDialogController(pParent,
"modules/swriter/ui/insertscript.ui",
"InsertScriptDialog")
41 , m_xTypeED(m_xBuilder->weld_entry(
"scripttype"))
42 , m_xUrlRB(m_xBuilder->weld_radio_button(
"url"))
43 , m_xEditRB(m_xBuilder->weld_radio_button(
"text"))
44 , m_xUrlPB(m_xBuilder->weld_button(
"browse"))
45 , m_xUrlED(m_xBuilder->weld_entry(
"urlentry"))
46 , m_xEditED(m_xBuilder->weld_text_view(
"textentry"))
47 , m_xOKBtn(m_xBuilder->weld_button(
"ok"))
48 , m_xPrevBtn(m_xBuilder->weld_button(
"previous"))
49 , m_xNextBtn(m_xBuilder->weld_button(
"next"))
83 m_pSh->EnterStdMode();
87 m_pField =
static_cast<SwScriptField*
>(m_pMgr->GetCurField());
89 RadioButtonHdl(*m_xUrlRB);
94 m_pSh->EnterStdMode();
98 m_pField =
static_cast<SwScriptField*
>(m_pMgr->GetCurField());
100 RadioButtonHdl(*m_xUrlRB);
111 bool bTravel =
false;
112 bool bNext(
false), bPrev(
false);
127 bTravel |= bNext || bPrev;
202 bool bEnable = m_xUrlRB->get_active();
203 m_xUrlPB->set_sensitive(bEnable);
204 m_xUrlED->set_sensitive(bEnable);
205 m_xEditED->set_sensitive(!bEnable);
209 bEnable = !m_pSh->IsReadOnlyAvailable() || !m_pSh->HasReadonlySel();
210 m_xOKBtn->set_sensitive(bEnable);
211 m_xUrlED->set_editable(bEnable);
212 m_xEditED->set_editable(bEnable);
213 m_xTypeED->set_editable(bEnable);
214 if( m_xUrlPB->get_sensitive() && !bEnable )
215 m_xUrlPB->set_sensitive(
false );
223 m_pFileDlg.reset(new ::sfx2::FileDialogHelper(
224 ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
225 FileDialogFlags::Insert,
"swriter", SfxFilterFlags::NONE, SfxFilterFlags::NONE,
m_xDialog.get()));
235 OUString sFileName = m_pFileDlg->GetPath();
236 if ( !sFileName.isEmpty() )
239 if ( INetProtocol::File == aINetURL.
GetProtocol() )
242 m_xUrlED->set_text(sFileName);
#define LINK(Instance, Class, Member)
std::shared_ptr< weld::Dialog > m_xDialog
std::unique_ptr< weld::Button > m_xNextBtn
std::unique_ptr< SwFieldMgr > m_pMgr
std::unique_ptr< weld::RadioButton > m_xUrlRB
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
std::unique_ptr< weld::Entry > m_xUrlED
std::unique_ptr< weld::Button > m_xUrlPB
void DestroyCursor()
transform TableCursor to normal cursor, nullify Tablemode
virtual OUString GetPar1() const override
Type.
OUString PathToFileName() const
Used by the UI to modify the document model.
std::unique_ptr< sfx2::FileDialogHelper > m_pFileDlg
std::unique_ptr< weld::Button > m_xPrevBtn
const SwView & GetView() const
std::unique_ptr< weld::TextView > m_xEditED
SwPaM * CreateCursor()
delete the current cursor and make the following into the current
void EndAction(const bool bIdleEnd=false, const bool DoSetPosX=false)
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
SwJavaEditDialog(weld::Window *pParent, SwWrtShell *pWrtSh)
virtual OUString GetPar2() const override
Text.
std::unique_ptr< weld::Entry > m_xTypeED
OUString SwResId(const char *pId)
SwDocShell * GetDocShell()
SwFieldType * GetTyp() const
INetProtocol GetProtocol() const
std::unique_ptr< weld::RadioButton > m_xEditRB
Reference< XExecutableDialog > m_xDialog
const INetURLObject & GetURLObject() const
virtual ~SwJavaEditDialog() override
IMPL_LINK_NOARG(SwJavaEditDialog, PrevHdl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xOKBtn
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
SfxMedium * GetMedium() const