13#include <toolbarmode.hrc>
15#include <com/sun/star/frame/ModuleManager.hpp>
19#include <officecfg/Office/Common.hxx>
20#include <officecfg/Office/UI/ToolbarMode.hxx>
21#include <osl/file.hxx>
22#include <rtl/bootstrap.hxx>
30#include <com/sun/star/beans/PropertyValue.hpp>
37 const auto xCurrentFrame = pViewFrame->GetFrame().GetFrameInterface();
39 const auto xModuleManager = css::frame::ModuleManager::create(xContext);
61 sResult =
"Unsupported";
74 xContext,
"org.openoffice.Office.UI.ToolbarMode/Applications/" +
GetCurrentApp(),
true);
82 : GenericDialogController(pParent,
"cui/ui/toolbarmodedialog.ui",
"ToolbarmodeDialog")
83 , m_pImage(m_xBuilder->weld_image(
"imImage"))
84 , m_pApply(m_xBuilder->weld_button(
"btnApply"))
85 , m_pApplyAll(m_xBuilder->weld_button(
"btnApplyAll"))
86 , m_pRadioButtons{ (m_xBuilder->weld_radio_button(
"rbButton1")),
87 (m_xBuilder->weld_radio_button(
"rbButton2")),
88 (m_xBuilder->weld_radio_button(
"rbButton3")),
89 (m_xBuilder->weld_radio_button(
"rbButton4")),
90 (m_xBuilder->weld_radio_button(
"rbButton5")),
91 (m_xBuilder->weld_radio_button(
"rbButton6")),
92 (m_xBuilder->weld_radio_button(
"rbButton7")),
93 (m_xBuilder->weld_radio_button(
"rbButton8")),
94 (m_xBuilder->weld_radio_button(
"rbButton9")) }
105 if (sCurrentMode == std::get<1>(TOOLBARMODES_ARRAY[
i]))
117 if (!officecfg::Office::Common::Misc::ExperimentalMode::get())
128 osl::File aFile(fileName);
129 return aFile.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None;
145 OUString
aURL(
"$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/toolbarmode/");
146 rtl::Bootstrap::expandMacros(
aURL);
164 const int i = GetActiveRadioButton();
167 UpdateImage(std::get<2>(TOOLBARMODES_ARRAY[
i]));
174 const int i = GetActiveRadioButton();
177 const OUString sCmd = std::get<1>(TOOLBARMODES_ARRAY[
i]);
179 if (&rButton == m_pApplyAll.get())
181 std::shared_ptr<comphelper::ConfigurationChanges> aBatch(
183 officecfg::Office::UI::ToolbarMode::ActiveWriter::set(sCmd, aBatch);
184 officecfg::Office::UI::ToolbarMode::ActiveCalc::set(sCmd, aBatch);
185 officecfg::Office::UI::ToolbarMode::ActiveImpress::set(sCmd, aBatch);
186 officecfg::Office::UI::ToolbarMode::ActiveDraw::set(sCmd, aBatch);
194 xContext,
"org.openoffice.Office.UI.ToolbarMode/Applications/",
true);
195 if (sCurrentApp !=
"Writer")
196 aAppNode.
setNodeValue(
"Writer/Active", css::uno::Any(sCmd));
197 if (sCurrentApp !=
"Calc")
198 aAppNode.
setNodeValue(
"Calc/Active", css::uno::Any(sCmd));
199 if (sCurrentApp !=
"Impress")
200 aAppNode.
setNodeValue(
"Impress/Active", css::uno::Any(sCmd));
201 if (sCurrentApp !=
"Draw")
202 aAppNode.
setNodeValue(
"Draw/Active", css::uno::Any(sCmd));
static ErrCode LoadGraphic(const OUString &rPath, const OUString &rFilter, Graphic &rGraphic, GraphicFilter *pFilter=nullptr, sal_uInt16 *pDeterminedFormat=nullptr)
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
Size GetSizePixel(const OutputDevice *pRefDevice=nullptr) const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
reference_type * get() const
static std::shared_ptr< ConfigurationChanges > create()
css::uno::Any getNodeValue(const OUString &_rPath) const noexcept
bool setNodeValue(const OUString &_rPath, const css::uno::Any &_rValue) const noexcept
bool commit() const noexcept
static Application GetApplicationEnum(const OUString &rsApplicationName)
OUString CuiResId(TranslateId aKey)
#define LINK(Instance, Class, Member)
#define SAL_N_ELEMENTS(arr)
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)
Reference< XComponentContext > getProcessComponentContext()
OUString getString(const Any &_rAny)
std::shared_ptr< LabelProvider > m_pInfoLabel