32#include <bitmaps.hlst>
38#define EXT_FROM_LEFT 2
39#define EXT_HORIZONTAL 3
46#define BMP_CAPTTYPE_1 1
47#define BMP_CAPTTYPE_2 2
48#define BMP_CAPTTYPE_3 3
54 SDRATTR_CAPTIONTYPE, SDRATTR_CAPTIONFIXEDANGLE,
55 SDRATTR_CAPTIONANGLE, SDRATTR_CAPTIONGAP,
56 SDRATTR_CAPTIONESCDIR, SDRATTR_CAPTIONESCISREL,
57 SDRATTR_CAPTIONESCREL, SDRATTR_CAPTIONESCABS,
58 SDRATTR_CAPTIONLINELEN, SDRATTR_CAPTIONFITLINELEN>);
61 :
SfxTabPage(pPage, pController,
"cui/ui/calloutpage.ui",
"CalloutPage", &rInAttrs)
74 , m_xMF_SPACING(m_xBuilder->weld_metric_spin_button(
"spacing",
FieldUnit::
MM))
75 , m_xLB_EXTENSION(m_xBuilder->weld_combo_box(
"extension"))
76 , m_xFT_BYFT(m_xBuilder->weld_label(
"byft"))
77 , m_xMF_BY(m_xBuilder->weld_metric_spin_button(
"by",
FieldUnit::
MM))
78 , m_xFT_POSITIONFT(m_xBuilder->weld_label(
"positionft"))
79 , m_xLB_POSITION(m_xBuilder->weld_combo_box(
"position"))
80 , m_xLineTypes(m_xBuilder->weld_combo_box(
"linetypes"))
81 , m_xFT_LENGTHFT(m_xBuilder->weld_label(
"lengthft"))
82 , m_xMF_LENGTH(m_xBuilder->weld_metric_spin_button(
"length",
FieldUnit::
MM))
83 , m_xCB_OPTIMAL(m_xBuilder->weld_check_button(
"optimal"))
84 , m_xCT_CAPTTYPE(new
ValueSet(m_xBuilder->weld_scrolled_window(
"valuesetwin", true)))
85 , m_xCT_CAPTTYPEWin(new
weld::CustomWeld(*m_xBuilder,
"valueset", *m_xCT_CAPTTYPE))
91 for (
int i = 0;
i < 3; ++
i)
93 for (
int i = 3;
i < 6; ++
i)
98 std::vector<OUString> aLineTypes;
99 aLineTypes.reserve(3);
100 for (
int i = 0;
i < 3; ++
i)
160 case SdrCaptionEscDir::Horizontal:
nEscDir=SdrCaptionEscDir::Vertical;
break;
161 case SdrCaptionEscDir::Vertical:
nEscDir=SdrCaptionEscDir::Horizontal;
break;
185 if (
m_xMF_BY->get_value_changed_from_saved())
221 eFUnit = FieldUnit::MM;
268 case SdrCaptionEscDir::Horizontal:
nEscDir=SdrCaptionEscDir::Vertical;
break;
269 case SdrCaptionEscDir::Vertical:
nEscDir=SdrCaptionEscDir::Horizontal;
break;
279 if(
nEscDir == SdrCaptionEscDir::Horizontal )
295 else if(
nEscDir == SdrCaptionEscDir::Vertical )
311 else if(
nEscDir == SdrCaptionEscDir::BestFit )
329 return std::make_unique<SvxCaptionTabPage>(pPage, pController, *
rOutAttrs);
341 nEscDir = SdrCaptionEscDir::BestFit;
349 nEscDir = SdrCaptionEscDir::Horizontal;
357 nEscDir = SdrCaptionEscDir::Vertical;
370 nEscDir = SdrCaptionEscDir::Horizontal;
383 nEscDir = SdrCaptionEscDir::Vertical;
390 if (&rListBox == m_xLB_EXTENSION.get())
392 SetupExtension_Impl(m_xLB_EXTENSION->get_active());
398 if (&rListBox == m_xLB_POSITION.get())
400 nPosition = m_xLB_POSITION->get_active();
406 if (&rButton != m_xCB_OPTIMAL.get())
409 if (m_xCB_OPTIMAL->get_active() || !m_xCB_OPTIMAL->get_sensitive())
411 m_xFT_LENGTHFT->set_sensitive(
false);
412 m_xMF_LENGTH->set_sensitive(
false);
416 m_xFT_LENGTHFT->set_sensitive(
true);
417 m_xMF_LENGTH->set_sensitive(
true);
423 SetupType_Impl(
static_cast<SdrCaptionType>(m_xCT_CAPTTYPE->GetSelectedItemId()) );
430 case SdrCaptionType::Type1:
431 case SdrCaptionType::Type2:
436 case SdrCaptionType::Type3:
437 case SdrCaptionType::Type4:
456 , nAnchorCtrls(nAnchorTypes)
461 if (
nAnchorCtrls & (SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page | SvxAnchorIds::Fly))
479 if (rId ==
"RID_SVXPAGE_POSITION_SIZE")
489 else if (rId ==
"RID_SVXPAGE_SWPOSSIZE")
495 else if (rId ==
"RID_SVXPAGE_CAPTION")
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void AddTabPage(const OUString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
void RemoveTabPage(const OUString &rName)
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
SvxAnchorIds nAnchorCtrls
Link< SvxSwFrameValidation &, void > aValidateLink
SvxCaptionTabDialog(weld::Window *pParent, const SdrView *pView, SvxAnchorIds nAnchorTypes)
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
void SetValidateFramePosLink(const Link< SvxSwFrameValidation &, void > &rLink)
link for the Writer to validate positions
void SetupType_Impl(SdrCaptionType nType)
virtual bool FillItemSet(SfxItemSet *) override
std::unique_ptr< weld::MetricSpinButton > m_xMF_LENGTH
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
std::unique_ptr< weld::MetricSpinButton > m_xMF_SPACING
std::unique_ptr< weld::MetricSpinButton > m_xMF_BY
void SetupExtension_Impl(sal_uInt16 nType)
std::unique_ptr< weld::Label > m_xFT_POSITIONFT
std::unique_ptr< weld::ComboBox > m_xLB_EXTENSION
SvxCaptionTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
std::unique_ptr< weld::Label > m_xFT_BYFT
std::unique_ptr< ValueSet > m_xCT_CAPTTYPE
std::unique_ptr< weld::CustomWeld > m_xCT_CAPTTYPEWin
const SfxItemSet & rOutAttrs
virtual void Reset(const SfxItemSet *) override
SdrCaptionType nCaptionType
Image m_aBmpCapTypes[CAPTYPE_BITMAPS_COUNT]
std::unique_ptr< weld::CheckButton > m_xCB_OPTIMAL
std::unique_ptr< weld::ComboBox > m_xLB_POSITION
std::unique_ptr< weld::ComboBox > m_xLineTypes
static WhichRangesContainer GetRanges()
std::unique_ptr< weld::Label > m_xFT_LENGTHFT
std::vector< OUString > m_aStrHorzList
std::vector< OUString > m_aStrVertList
static const WhichRangesContainer pCaptionRanges
virtual ~SvxCaptionTabPage() override
static WhichRangesContainer GetRanges()
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
void EnableAnchorTypes(SvxAnchorIds nAnchorEnable)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
void SetValidateFramePosLink(const Link< SvxSwFrameValidation &, void > &rLink)
static WhichRangesContainer GetRanges()
#define DBG_ASSERT(sCon, aError)
virtual tools::Long GetValue() const override
SVXCORE_DLLPUBLIC FieldUnit GetModuleFieldUnit(const SfxItemSet &)
IMPL_LINK_NOARG(SvxCaptionTabPage, SelectCaptTypeHdl_Impl, ValueSet *, void)
IMPL_LINK(SvxCaptionTabPage, ExtensionSelectHdl_Impl, weld::ComboBox &, rListBox, void)
const sal_uInt16 CAPTYPE_BITMAPS_COUNT
#define LINK(Instance, Class, Member)
static constexpr auto Items
constexpr TypedWhichId< SdrCaptionEscRelItem > SDRATTR_CAPTIONESCREL(SDRATTR_CAPTION_FIRST+6)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_CAPTIONGAP(SDRATTR_CAPTION_FIRST+3)
constexpr TypedWhichId< SdrCaptionEscIsRelItem > SDRATTR_CAPTIONESCISREL(SDRATTR_CAPTION_FIRST+5)
constexpr TypedWhichId< SdrCaptionTypeItem > SDRATTR_CAPTIONTYPE(SDRATTR_CAPTION_FIRST+0)
constexpr TypedWhichId< SdrCaptionEscAbsItem > SDRATTR_CAPTIONESCABS(SDRATTR_CAPTION_FIRST+7)
constexpr TypedWhichId< SdrCaptionLineLenItem > SDRATTR_CAPTIONLINELEN(SDRATTR_CAPTION_FIRST+8)
constexpr TypedWhichId< SdrCaptionFitLineLenItem > SDRATTR_CAPTIONFITLINELEN(SDRATTR_CAPTION_FIRST+9)
constexpr TypedWhichId< SdrCaptionEscDirItem > SDRATTR_CAPTIONESCDIR(SDRATTR_CAPTION_FIRST+4)
SVT_DLLPUBLIC sal_Int64 GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
SVT_DLLPUBLIC void SetMetricValue(weld::MetricSpinButton &rField, sal_Int64 nCoreValue, MapUnit eUnit)
SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton &rCtrl, FieldUnit eUnit, bool bAll=false)