13#include <editeng/editids.hrc>
15#include <sfx2/sfxsids.hrc>
25#define IS_MOBILE (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current() && SfxViewShell::Current()->isLOKMobilePhone())
29 , m_rBindings(rBindings)
30 , m_xTextInput(m_xBuilder->weld_entry(
"TextInput"))
32 , m_xFont(m_xBuilder->weld_combo_box(
"FontBox"))
33 , m_xAngle(m_xBuilder->weld_metric_spin_button(
"Angle",
FieldUnit::
DEGREE))
34 , m_xTransparency(m_xBuilder->weld_metric_spin_button(
"Transparency",
FieldUnit::
PERCENT))
35 , m_xColor(new
ColorListBox(m_xBuilder->weld_menu_button(
"Color"), [this]{
return m_xDialog.get(); }))
41 m_xBuilder->weld_label(
"ColorLabel")->hide();
43 m_xBuilder->weld_button(
"cancel")->hide();
44 m_xBuilder->weld_button(
"help")->hide();
58 std::unique_ptr<FontList> xFontList;
60 if ( pDocSh && ( ( pFontItem = pDocSh->
GetItem( SID_ATTR_CHAR_FONTLIST ) ) !=
nullptr ) )
61 pFontList =
static_cast<const SvxFontListItem*
>( pFontItem )->GetFontList();
66 pFontList = xFontList.get();
71 for (sal_uInt16
i = 0;
i < nFontCount; ++
i)
84 if( !(eState >= SfxItemState::DEFAULT && pWatermark && pWatermark->Which() == SID_WATERMARK))
87 const OUString& sText = pWatermark->
GetText();
89 OUString sFontName = pWatermark->
GetFont();
90 int nFontIndex =
m_xFont->find_text(sFontName);
92 m_xFont->set_active(nFontIndex);
94 m_xFont->set_entry_text(sFontName);
102 OUString sText = m_xTextInput->get_text();
106 {
"Text", css::uno::Any( sText ) },
107 {
"Font", css::uno::Any( m_xFont->get_active_text() ) },
108 {
"Angle", css::uno::Any(
static_cast<sal_Int16
>( m_xAngle->get_value(FieldUnit::DEGREE) ) ) },
109 {
"Transparency", css::uno::Any(
static_cast<sal_Int16
>( m_xTransparency->get_value(FieldUnit::PERCENT) ) ) },
110 {
"Color", css::uno::Any(
static_cast<sal_uInt32
>( m_xColor->GetSelectEntryColor().GetRGBColor() ) ) }
PropertyValueVector_t aPropertyValues
Reference< XExecutableDialog > m_xDialog
static OutputDevice * GetDefaultDevice()
size_t GetFontNameCount() const
const FontMetric & GetFontName(size_t nFont) const
SfxDispatcher * GetDispatcher() const
SfxItemState QueryState(sal_uInt16 nSID, const SfxPoolItem *&rpState)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
sal_Int16 GetTransparency() const
OUString const & GetFont() const
OUString const & GetText() const
sal_Int16 GetAngle() const
virtual ~SwWatermarkDialog() override
std::unique_ptr< weld::Button > m_xOKButton
SfxBindings & m_rBindings
SwWatermarkDialog(weld::Window *pParent, SfxBindings &rBindings)
std::unique_ptr< ColorListBox > m_xColor
std::unique_ptr< weld::MetricSpinButton > m_xTransparency
std::unique_ptr< weld::ComboBox > m_xFont
std::unique_ptr< weld::Entry > m_xTextInput
std::unique_ptr< weld::MetricSpinButton > m_xAngle
const OUString & GetFamilyName() const
std::unique_ptr< weld::Button > m_xOKButton
#define LINK(Instance, Class, Member)
bool dispatchCommand(const OUString &rCommand, const uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Sequence< css::beans::PropertyValue > &rArguments, const uno::Reference< css::frame::XDispatchResultListener > &rListener)
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
constexpr OUStringLiteral PERCENT(u"Percent")
IMPL_LINK_NOARG(SwWatermarkDialog, OKButtonHdl, weld::Button &, void)