30#include <osl/diagnose.h>
45#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
46#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
54#include <svx/dialogs.hrc>
59using namespace ::
sfx2;
64 "CharacterPropertiesDialog", &rCoreSet, pStr != nullptr)
66 , m_nDialogMode(nDialogMode)
113 else if (rId ==
"fonteffects")
119 else if (rId ==
"position")
124 else if (rId ==
"asianlayout")
129 else if (rId ==
"background")
133 eFlags = SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR;
140 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/charurlpage.ui",
"CharURLPage", &rCoreSet)
142 , m_xURLED(m_xBuilder->weld_entry(
"urled"))
143 , m_xTextFT(m_xBuilder->weld_label(
"textft"))
144 , m_xTextED(m_xBuilder->weld_entry(
"texted"))
145 , m_xNameED(m_xBuilder->weld_entry(
"nameed"))
146 , m_xTargetFrameLB(m_xBuilder->weld_combo_box(
"targetfrmlb"))
147 , m_xURLPB(m_xBuilder->weld_button(
"urlpb"))
148 , m_xEventPB(m_xBuilder->weld_button(
"eventpb"))
149 , m_xVisitedLB(m_xBuilder->weld_combo_box(
"visitedlb"))
150 , m_xNotVisitedLB(m_xBuilder->weld_combo_box(
"unvisitedlb"))
151 , m_xCharStyleContainer(m_xBuilder->weld_widget(
"charstyle"))
154 const int nMaxWidth(
m_xVisitedLB->get_approximate_digit_width() * 50);
162 pItem = pShell->GetItem(SID_HTML_MODE);
166 sal_uInt16 nHtmlMode = pItem->
GetValue();
191 size_t nCount = aList.size();
210 m_xNameED->set_text(pINetFormat->GetName());
213 OUString sEntry = pINetFormat->GetVisitedFormat();
214 if (sEntry.isEmpty())
216 OSL_ENSURE(
false,
"<SwCharURLPage::Reset(..)> - missing visited character format at hyperlink attribute" );
221 sEntry = pINetFormat->GetINetFormat();
222 if (sEntry.isEmpty())
224 OSL_ENSURE(
false,
"<SwCharURLPage::Reset(..)> - missing unvisited character format at hyperlink attribute" );
235 if( pINetFormat->GetMacroTable() )
248 OUString sURL =
m_xURLED->get_text();
259 bool bURLModified =
m_xURLED->get_value_changed_from_saved();
260 bool bNameModified =
m_xNameED->get_value_changed_from_saved();
262 m_bModified = bURLModified || bNameModified || bTargetModified;
294 return std::make_unique<SwCharURLPage>(pPage, pController, *rAttrSet);
299 FileDialogHelper aDlgHelper(TemplateDescription::FILEOPEN_SIMPLE,
301 aDlgHelper.SetContext(FileDialogHelper::WriterInsertHyperlink);
304 const Reference<XFilePicker3>& xFP = aDlgHelper.GetFilePicker();
305 m_xURLED->set_text(xFP->getSelectedFiles().getConstArray()[0]);
313 pView->GetWrtShell(), m_oINetMacroTable);
Reference< XExecutableDialog > m_xDialog
IMPL_LINK_NOARG(SwCharURLPage, InsertFileHdl, weld::Button &, void)
sal_uInt16 GetValue() const
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
static SfxAbstractDialogFactory * Create()
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
static void GetDefaultTargetList(TargetList &)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
void AddTabPage(const OUString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
void RemoveTabPage(const OUString &rName)
SfxItemSet * GetInputSetImpl()
virtual void PageCreated(const SfxAllItemSet &aSet)
const FontList * GetFontList() const
SwCharDlgMode m_nDialogMode
SwCharDlg(weld::Window *pParent, SwView &pVw, const SfxItemSet &rCoreSet, SwCharDlgMode nDialogMode, const OUString *pFormatStr)
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
virtual ~SwCharDlg() override
std::unique_ptr< weld::ComboBox > m_xNotVisitedLB
std::unique_ptr< weld::ComboBox > m_xTargetFrameLB
virtual ~SwCharURLPage() override
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
SwCharURLPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
std::unique_ptr< weld::Entry > m_xURLED
std::unique_ptr< weld::Label > m_xTextFT
virtual void Reset(const SfxItemSet *rSet) override
std::unique_ptr< weld::Widget > m_xCharStyleContainer
std::optional< SvxMacroTableDtor > m_oINetMacroTable
std::unique_ptr< weld::Entry > m_xTextED
std::unique_ptr< weld::Button > m_xEventPB
std::unique_ptr< weld::ComboBox > m_xVisitedLB
virtual bool FillItemSet(SfxItemSet *rSet) override
std::unique_ptr< weld::Entry > m_xNameED
std::unique_ptr< weld::Button > m_xURLPB
static bool INetFormatDlg(weld::Window *pParent, SwWrtShell &rSh, std::optional< SvxMacroTableDtor > &rpINetItem)
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
SwDocShell * GetDocShell()
#define FN_PARAM_SELECTION
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
#define SVX_ENABLE_CHAR_TRANSPARENCY
#define SVX_PREVIEW_CHARACTER
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
::std::vector< OUString > TargetList
#define LINK(Instance, Class, Member)
bool IsDoubleLinesEnabled()
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)
SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative(OUString const &baseUriReference, OUString const &uriReference)
COMPHELPER_DLLPUBLIC bool isFileUrl(std::u16string_view url)
@ RES_POOLCHR_INET_VISIT
Internet visited.
@ RES_POOLCHR_INET_NORMAL
Internet normal.
OUString SwResId(TranslateId aId)