42 #include <strings.hrc>
44 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
45 #include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
52 #include <svx/dialogs.hrc>
57 using namespace ::
sfx2;
62 "CharacterPropertiesDialog", &rCoreSet, pStr != nullptr)
64 , m_nDialogMode(nDialogMode)
112 else if (rId ==
"fonteffects")
118 else if (rId ==
"position")
123 else if (rId ==
"asianlayout")
128 else if (rId ==
"background")
132 eFlags = SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR;
139 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/charurlpage.ui",
"CharURLPage", &rCoreSet)
141 , m_xURLED(m_xBuilder->weld_entry(
"urled"))
142 , m_xTextFT(m_xBuilder->weld_label(
"textft"))
143 , m_xTextED(m_xBuilder->weld_entry(
"texted"))
144 , m_xNameED(m_xBuilder->weld_entry(
"nameed"))
145 , m_xTargetFrameLB(m_xBuilder->weld_combo_box(
"targetfrmlb"))
146 , m_xURLPB(m_xBuilder->weld_button(
"urlpb"))
147 , m_xEventPB(m_xBuilder->weld_button(
"eventpb"))
148 , m_xVisitedLB(m_xBuilder->weld_combo_box(
"visitedlb"))
149 , m_xNotVisitedLB(m_xBuilder->weld_combo_box(
"unvisitedlb"))
150 , m_xCharStyleContainer(m_xBuilder->weld_widget(
"charstyle"))
153 const int nMaxWidth(
m_xVisitedLB->get_approximate_digit_width() * 50);
159 if(SfxItemState::SET == rCoreSet.
GetItemState(SID_HTML_MODE,
false, &pItem) ||
161 nullptr != (pItem = pShell->
GetItem(SID_HTML_MODE))))
179 std::unique_ptr<TargetList> pList(
new TargetList );
183 size_t nCount = pList->size();
184 for (
size_t i = 0;
i < nCount; ++
i)
209 if (sEntry.isEmpty())
211 OSL_ENSURE(
false,
"<SwCharURLPage::Reset(..)> - missing visited character format at hyperlink attribute" );
217 if (sEntry.isEmpty())
219 OSL_ENSURE(
false,
"<SwCharURLPage::Reset(..)> - missing unvisited character format at hyperlink attribute" );
243 OUString sURL =
m_xURLED->get_text();
254 bool bURLModified =
m_xURLED->get_value_changed_from_saved();
255 bool bNameModified =
m_xNameED->get_value_changed_from_saved();
257 bModified = bURLModified || bNameModified || bTargetModified;
262 aINetFormat.SetVisitedFormatAndId( sEntry, nId );
266 aINetFormat.SetINetFormatAndId( sEntry, nId );
269 aINetFormat.SetMacroTable(&
pINetItem->GetMacroTable());
283 rSet->
Put(aINetFormat);
289 return std::make_unique<SwCharURLPage>(pPage, pController, *rAttrSet);
294 FileDialogHelper aDlgHelper(TemplateDescription::FILEOPEN_SIMPLE,
298 const Reference<XFilePicker3>& xFP = aDlgHelper.GetFilePicker();
299 m_xURLED->set_text(xFP->getSelectedFiles().getConstArray()[0]);
#define LINK(Instance, Class, Member)
virtual void Reset(const SfxItemSet *rSet) override
virtual void PageCreated(const SfxAllItemSet &aSet)
static SfxAbstractDialogFactory * Create()
static void GetDefaultTargetList(TargetList &)
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
std::unique_ptr< weld::Button > m_xEventPB
void RemoveTabPage(const OString &rName)
SfxItemSet * GetInputSetImpl()
static SfxObjectShell * Current()
std::unique_ptr< weld::ComboBox > m_xNotVisitedLB
std::unique_ptr< weld::Entry > m_xNameED
virtual bool FillItemSet(SfxItemSet *rSet) override
SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative(OUString const &baseUriReference, OUString const &uriReference)
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
virtual ~SwCharDlg() override
#define SVX_PREVIEW_CHARACTER
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
std::unique_ptr< weld::Button > m_xURLPB
SwCharURLPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
std::unique_ptr< weld::Entry > m_xTextED
bool IsDoubleLinesEnabled() const
SwCharDlgMode m_nDialogMode
std::unique_ptr< weld::Entry > m_xURLED
IMPL_LINK_NOARG(SwCharURLPage, InsertFileHdl, weld::Button &, void)
#define FN_INET_FIELD_MACRO
OUString SwResId(const char *pId)
SwDocShell * GetDocShell()
std::unique_ptr< weld::Label > m_xTextFT
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
#define FN_PARAM_SELECTION
static bool INetFormatDlg(weld::Window *pParent, SwWrtShell &rSh, std::unique_ptr< SvxMacroItem > &rpINetItem)
COMPHELPER_DLLPUBLIC bool isFileUrl(OUString const &url)
void AddTabPage(const OString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
virtual void PageCreated(const OString &rId, SfxTabPage &rPage) override
Reference< XExecutableDialog > m_xDialog
virtual ~SwCharURLPage() override
std::unique_ptr< weld::Widget > m_xCharStyleContainer
std::unique_ptr< weld::ComboBox > m_xTargetFrameLB
SwCharDlg(weld::Window *pParent, SwView &pVw, const SfxItemSet &rCoreSet, SwCharDlgMode nDialogMode, const OUString *pFormatStr)
#define SVX_ENABLE_CHAR_TRANSPARENCY
std::unique_ptr< SvxMacroItem > pINetItem
std::unique_ptr< weld::ComboBox > m_xVisitedLB
::std::vector< OUString > TargetList
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)
static OUString decode(OUString const &rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)