14#include <com/sun/star/beans/PropertyValues.hpp>
15#include <com/sun/star/util/Color.hpp>
19#include <editeng/editids.hrc>
31 :
SfxTabPage(pPage, pController,
"cui/ui/themetabpage.ui",
"ThemePage", &rInAttrs)
32 , m_xThemeName(m_xBuilder->weld_entry(
"themeName"))
33 , m_xColorSetName(m_xBuilder->weld_entry(
"colorSetName"))
34 , m_xDk1(new
ColorListBox(m_xBuilder->weld_menu_button(
"btnDk1"),
36 , m_xLt1(
new ColorListBox(m_xBuilder->weld_menu_button(
"btnLt1"),
37 [
this] { return GetDialogController()->getDialog(); }))
38 , m_xDk2(
new ColorListBox(m_xBuilder->weld_menu_button(
"btnDk2"),
39 [
this] { return GetDialogController()->getDialog(); }))
40 , m_xLt2(
new ColorListBox(m_xBuilder->weld_menu_button(
"btnLt2"),
41 [
this] { return GetDialogController()->getDialog(); }))
42 , m_xAccent1(
new ColorListBox(m_xBuilder->weld_menu_button(
"btnAccent1"),
43 [
this] { return GetDialogController()->getDialog(); }))
44 , m_xAccent2(
new ColorListBox(m_xBuilder->weld_menu_button(
"btnAccent2"),
45 [
this] { return GetDialogController()->getDialog(); }))
46 , m_xAccent3(
new ColorListBox(m_xBuilder->weld_menu_button(
"btnAccent3"),
47 [
this] { return GetDialogController()->getDialog(); }))
48 , m_xAccent4(
new ColorListBox(m_xBuilder->weld_menu_button(
"btnAccent4"),
49 [
this] { return GetDialogController()->getDialog(); }))
50 , m_xAccent5(
new ColorListBox(m_xBuilder->weld_menu_button(
"btnAccent5"),
51 [
this] { return GetDialogController()->getDialog(); }))
52 , m_xAccent6(
new ColorListBox(m_xBuilder->weld_menu_button(
"btnAccent6"),
53 [
this] { return GetDialogController()->getDialog(); }))
54 , m_xHlink(
new ColorListBox(m_xBuilder->weld_menu_button(
"btnHlink"),
55 [
this] { return GetDialogController()->getDialog(); }))
56 , m_xFolHlink(
new ColorListBox(m_xBuilder->weld_menu_button(
"btnFolHlink"),
57 [
this] { return GetDialogController()->getDialog(); }))
68 SAL_WARN(
"cui.tabpages",
"SvxThemePage::Reset: no SfxGrabBagItem");
72 auto itTheme = pGrabBagItem->
GetGrabBag().find(
"Theme");
73 if (itTheme == pGrabBagItem->
GetGrabBag().end())
76 m_xDk1->set_sensitive(
true);
77 m_xLt1->set_sensitive(
true);
78 m_xDk2->set_sensitive(
true);
79 m_xLt2->set_sensitive(
true);
92 auto it =
aMap.find(
"Name");
100 it =
aMap.find(
"ColorSchemeName");
101 if (it !=
aMap.end())
104 it->second >>=
aName;
108 it =
aMap.find(
"ColorScheme");
109 if (it !=
aMap.end())
112 it->second >>= aColors;
132 if (!rOldSet.
HasItem(SID_ATTR_CHAR_GRABBAG))
138 auto it = aGrabBagItem.
GetGrabBag().find(
"Theme");
146 std::vector<util::Color> aColorScheme = {
147 static_cast<sal_Int32
>(
m_xDk1->GetSelectEntryColor()),
148 static_cast<sal_Int32
>(
m_xLt1->GetSelectEntryColor()),
149 static_cast<sal_Int32
>(
m_xDk2->GetSelectEntryColor()),
150 static_cast<sal_Int32
>(
m_xLt2->GetSelectEntryColor()),
151 static_cast<sal_Int32
>(
m_xAccent1->GetSelectEntryColor()),
152 static_cast<sal_Int32
>(
m_xAccent2->GetSelectEntryColor()),
153 static_cast<sal_Int32
>(
m_xAccent3->GetSelectEntryColor()),
154 static_cast<sal_Int32
>(
m_xAccent4->GetSelectEntryColor()),
155 static_cast<sal_Int32
>(
m_xAccent5->GetSelectEntryColor()),
156 static_cast<sal_Int32
>(
m_xAccent6->GetSelectEntryColor()),
157 static_cast<sal_Int32
>(
m_xHlink->GetSelectEntryColor()),
158 static_cast<sal_Int32
>(
m_xFolHlink->GetSelectEntryColor()),
162 beans::PropertyValues aTheme =
aMap.getAsConstPropertyValueList();
163 aGrabBagItem.
GetGrabBag()[
"Theme"] <<= aTheme;
164 pAttrs->
Put(aGrabBagItem);
173 return std::make_unique<SvxThemePage>(pPage, pController, *rAttrs);
const std::map< OUString, css::uno::Any > & GetGrabBag() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const SfxItemSet & GetItemSet() const
SfxOkDialogController * GetDialogController() const
SvxThemePage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
std::unique_ptr< weld::Entry > m_xColorSetName
virtual void Reset(const SfxItemSet *) override
virtual bool FillItemSet(SfxItemSet *) override
virtual ~SvxThemePage() override
std::unique_ptr< ColorListBox > m_xAccent2
std::unique_ptr< ColorListBox > m_xAccent1
std::unique_ptr< ColorListBox > m_xHlink
std::unique_ptr< ColorListBox > m_xAccent4
static const WhichRangesContainer m_pRanges
std::unique_ptr< ColorListBox > m_xLt1
std::unique_ptr< ColorListBox > m_xDk1
std::unique_ptr< ColorListBox > m_xAccent5
std::unique_ptr< ColorListBox > m_xAccent6
std::unique_ptr< ColorListBox > m_xDk2
std::unique_ptr< ColorListBox > m_xLt2
std::unique_ptr< ColorListBox > m_xFolHlink
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
std::unique_ptr< ColorListBox > m_xAccent3
std::unique_ptr< weld::Entry > m_xThemeName
#define SAL_WARN(area, stream)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
HashMap_OWString_Interface aMap