40#include <officecfg/Office/Common.hxx>
44#include <com/sun/star/configuration/theDefaultProvider.hpp>
45#include <com/sun/star/container/XNameAccess.hpp>
46#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
47#include <com/sun/star/document/MacroExecMode.hpp>
48#include <com/sun/star/document/UpdateDocMode.hpp>
49#include <com/sun/star/frame/Desktop.hpp>
50#include <com/sun/star/lang/XMultiServiceFactory.hpp>
51#include <com/sun/star/system/SystemShellExecute.hpp>
52#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
53#include <com/sun/star/util/URLTransformer.hpp>
54#include <com/sun/star/task/InteractionHandler.hpp>
127 OUString sURL = officecfg::Office::Common::Menus::VolunteerURL::get();
130 Reference<css::system::XSystemShellExecute>
const xSystemShellExecute(
131 css::system::SystemShellExecute::create(
132 ::comphelper::getProcessComponentContext()));
133 xSystemShellExecute->execute(sURL, OUString(),
134 css::system::SystemShellExecuteFlags::URIS_ONLY);
150 , mxOpenButton(m_xBuilder->weld_button(
"open_all"))
151 , mxRecentButton(m_xBuilder->weld_toggle_button(
"open_recent"))
152 , mxRemoteButton(m_xBuilder->weld_button(
"open_remote"))
153 , mxTemplateButton(m_xBuilder->weld_toggle_button(
"templates_all"))
154 , mxCreateLabel(m_xBuilder->weld_label(
"create_label"))
155 , mxAltHelpLabel(m_xBuilder->weld_label(
"althelplabel"))
156 , mxFilter(m_xBuilder->weld_combo_box(
"cbFilter"))
157 , mxActions(m_xBuilder->weld_menu_button(
"mbActions"))
158 , mxWriterAllButton(m_xBuilder->weld_button(
"writer_all"))
159 , mxCalcAllButton(m_xBuilder->weld_button(
"calc_all"))
160 , mxImpressAllButton(m_xBuilder->weld_button(
"impress_all"))
161 , mxDrawAllButton(m_xBuilder->weld_button(
"draw_all"))
162 , mxDBAllButton(m_xBuilder->weld_button(
"database_all"))
163 , mxMathAllButton(m_xBuilder->weld_button(
"math_all"))
165 , mxBrandImageWeld(new
weld::CustomWeld(*m_xBuilder,
"daBrand", *mxBrandImage))
166 , mxHelpButton(m_xBuilder->weld_button(
"help"))
167 , mxExtensionsButton(m_xBuilder->weld_button(
"extensions"))
168 , mxAllButtonsBox(m_xBuilder->weld_container(
"all_buttons_box"))
169 , mxButtonsBox(m_xBuilder->weld_container(
"buttons_box"))
170 , mxSmallButtonsBox(m_xBuilder->weld_container(
"small_buttons_box"))
171 , mxAllRecentThumbnails(new
sfx2::RecentDocsView(m_xBuilder->weld_scrolled_window(
"scrollrecent", true),
172 m_xBuilder->weld_menu(
"recentmenu")))
173 , mxAllRecentThumbnailsWin(new
weld::CustomWeld(*m_xBuilder,
"all_recent", *mxAllRecentThumbnails))
174 , mxLocalView(new
TemplateDefaultView(m_xBuilder->weld_scrolled_window(
"scrolllocal", true),
175 m_xBuilder->weld_menu(
"localmenu")))
176 , mxLocalViewWin(new
weld::CustomWeld(*m_xBuilder,
"local_view", *mxLocalView))
177 , mbLocalViewInitialized(false)
178 , mbInitControls(false)
184 auto nHeight =
mxFilter->get_preferred_size().getHeight();
185 mxActions->set_size_request(nHeight, nHeight);
195 mxContext.set( ::comphelper::getProcessComponentContext(), uno::UNO_SET_THROW );
327 if ((rDCEvt.
GetType() != DataChangedEventType::SETTINGS)
328 || !(rDCEvt.
GetFlags() & AllSettingsFlags::STYLE))
338template <
typename W
idgetClass>
343 pWidget->set_font(aFont);
372 sal_Int32 nMenuHeight = 0;
374 nMenuHeight = pSystemWindow->GetMenuBarHeight();
417 if( rNEvt.
GetType() == NotifyEventType::KEYINPUT )
429 if (bThumbnailHasFocus)
435 else if ( rKeyCode.
IsMod1() )
450 if (!bThumbnailHasFocus)
474 if ((
aCommand !=
"vnd.sun.star.findbar:FocusToFindbar") && pEvt &&
mpAccExec->execute(rKeyCode))
483 if( nFlags & GetFocusFlags::F6 )
485 if( nFlags & GetFocusFlags::Forward )
519 xFramesSupplier->setActiveFrame(
mxFrame);
526 if (&rButton == mxExtensionsButton.get())
527 aNode =
"AddFeatureURL";
536 {
"nodepath",
uno::Any(OUString(
"/org.openoffice.Office.Common/Help/StartCenter"))}
541 if (xNameAccess.is())
544 Any value(xNameAccess->getByName(aNode));
546 sURL =
value.get<OUString>();
549 Reference<css::system::XSystemShellExecute>
const
551 css::system::SystemShellExecute::create(
552 ::comphelper::getProcessComponentContext()));
553 xSystemShellExecute->execute(sURL, OUString(),
554 css::system::SystemShellExecuteFlags::URIS_ONLY);
564 const int nFilter =
mxFilter->get_active();
589 if (&rButton == mxRecentButton.get())
590 bRecentMode = rButton.get_active();
592 bRecentMode = !rButton.get_active();
597 mxAllRecentThumbnails->Show();
598 mxAllRecentThumbnails->GrabFocus();
599 mxRecentButton->set_active(
true);
600 mxTemplateButton->set_active(
false);
601 mxActions->set_sensitive(
true);
605 mxAllRecentThumbnails->Hide();
606 initializeLocalView();
608 mxLocalView->reload();
609 mxLocalView->GrabFocus();
610 mxRecentButton->set_active(
false);
611 mxTemplateButton->set_active(
true);
612 mxActions->set_sensitive(
false);
620 if( &rButton == mxWriterAllButton.get() )
621 dispatchURL(
"private:factory/swriter" );
622 else if( &rButton == mxCalcAllButton.get() )
623 dispatchURL(
"private:factory/scalc" );
624 else if( &rButton == mxImpressAllButton.get() )
625 dispatchURL(
"private:factory/simpress?slot=6686" );
626 else if( &rButton == mxDrawAllButton.get() )
627 dispatchURL(
"private:factory/sdraw" );
628 else if( &rButton == mxDBAllButton.get() )
629 dispatchURL(
"private:factory/sdatabase?Interactive" );
630 else if( &rButton == mxMathAllButton.get() )
631 dispatchURL(
"private:factory/smath" );
632 else if( &rButton == mxOpenButton.get() )
634 Reference< XDispatchProvider >
xFrame( mxFrame, UNO_QUERY );
638 else if( &rButton == mxRemoteButton.get() )
640 Reference< XDispatchProvider >
xFrame( mxFrame, UNO_QUERY );
642 dispatchURL(
".uno:OpenRemote", OUString(),
xFrame, {} );
648 if (rId ==
"clear_all")
651 mxAllRecentThumbnails->Reload();
654 else if(rId ==
"clear_unavailable")
656 mxAllRecentThumbnails->clearUnavailableFiles();
665 mxLocalView->createContextMenu();
670 uno::Sequence< PropertyValue > aArgs{
674 comphelper::makePropertyValue(
"InteractionHandler", task::InteractionHandler::createWithParent( ::comphelper::getProcessComponentContext(),
nullptr ))
679 Reference< XDispatchProvider >
xFrame( mxFrame, UNO_QUERY );
683 dispatchURL( pTemplateItem->
getPath(),
"_default",
xFrame, aArgs );
685 catch(
const uno::Exception& )
692 uno::Sequence< PropertyValue > aArgs{
700 Reference< XDispatchProvider >
xFrame( mxFrame, UNO_QUERY );
704 dispatchURL( pViewItem->
getPath(),
"_default",
xFrame, aArgs );
706 catch(
const uno::Exception& )
713struct ImplDelayedDispatch
716 css::util::URL aDispatchURL;
717 Sequence< PropertyValue > aArgs;
719 ImplDelayedDispatch(
const Reference< XDispatch >& i_xDispatch,
720 css::util::URL i_aURL,
721 const Sequence< PropertyValue >& i_rArgs )
723 aDispatchURL(
std::move( i_aURL )),
733 struct ImplDelayedDispatch* pDispatch =
static_cast<ImplDelayedDispatch*
>(pArg);
736 pDispatch->xDispatch->dispatch( pDispatch->aDispatchURL, pDispatch->aArgs );
748 const Reference< XDispatchProvider >& i_xProv,
749 const Sequence< PropertyValue >& i_rArgs )
759 css::util::URL aDispatchURL;
760 aDispatchURL.Complete = i_rURL;
762 Reference < css::util::XURLTransformer > xURLTransformer(
767 xURLTransformer->parseStrict( aDispatchURL );
770 xProvider->queryDispatch( aDispatchURL,
rTarget, 0 )
775 std::unique_ptr<ImplDelayedDispatch> pDisp(
new ImplDelayedDispatch(
xDispatch, std::move(aDispatchURL), i_rArgs ));
780 catch (
const css::uno::RuntimeException&)
784 catch (
const css::uno::Exception&)
constexpr OUStringLiteral SERVICENAME_CFGREADACCESS
float const g_fMultiplier
static void implDispatchDelayed(void *, void *pArg)
IMPL_LINK_NOARG(BackingWindow, FilterHdl, weld::ComboBox &, void)
IMPL_LINK(BackingWindow, ClickHelpHdl, weld::Button &, rButton, void)
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
std::unique_ptr< sfx2::RecentDocsView > mxAllRecentThumbnails
std::unique_ptr< weld::Button > mxExtensionsButton
virtual bool PreNotify(NotifyEvent &rNEvt) override
std::unique_ptr< weld::CustomWeld > mxAllRecentThumbnailsWin
std::unique_ptr< weld::Button > mxDrawAllButton
std::unique_ptr< weld::Button > mxWriterAllButton
std::unique_ptr< weld::ToggleButton > mxRecentButton
std::unique_ptr< TemplateDefaultView > mxLocalView
void clearRecentFileList()
std::unique_ptr< weld::Container > mxSmallButtonsBox
std::unique_ptr< weld::MenuButton > mxActions
std::unique_ptr< BrandImage > mxBrandImage
css::uno::Reference< css::datatransfer::dnd::XDropTarget > mxDropTarget
void setLargerFont(WidgetClass &, const vcl::Font &)
bool mbLocalViewInitialized
css::uno::Reference< css::uno::XComponentContext > mxContext
std::unique_ptr< weld::Button > mxImpressAllButton
std::unique_ptr< weld::Button > mxCalcAllButton
std::unique_ptr< weld::CustomWeld > mxBrandImageWeld
BackingWindow(vcl::Window *pParent)
std::unique_ptr< weld::Container > mxButtonsBox
void ApplyStyleSettings()
void checkInstalledModules()
std::unique_ptr< weld::Container > mxAllButtonsBox
std::unique_ptr< weld::ComboBox > mxFilter
std::unique_ptr< weld::Button > mxMathAllButton
std::unique_ptr< weld::Button > mxDBAllButton
std::unique_ptr< weld::Button > mxOpenButton
void DataChanged(const DataChangedEvent &) override
virtual ~BackingWindow() override
void dispatchURL(const OUString &i_rURL, const OUString &i_rTarget=OUString("_default"), const css::uno::Reference< css::frame::XDispatchProvider > &i_xProv=css::uno::Reference< css::frame::XDispatchProvider >(), const css::uno::Sequence< css::beans::PropertyValue > &=css::uno::Sequence< css::beans::PropertyValue >())
std::unique_ptr< weld::Label > mxAltHelpLabel
css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > mxDropTargetListener
helper for drag&drop.
void initializeLocalView()
std::unique_ptr< weld::ToggleButton > mxTemplateButton
std::unique_ptr< weld::Button > mxHelpButton
void setOwningFrame(const css::uno::Reference< css::frame::XFrame > &xFrame)
std::unique_ptr< weld::CustomWeld > mxLocalViewWin
virtual void GetFocus() override
css::uno::Reference< css::frame::XFrame > mxFrame
std::unique_ptr< weld::Button > mxRemoteButton
css::uno::Reference< css::frame::XDispatchProvider > mxDesktopDispatchProvider
std::unique_ptr< weld::Label > mxCreateLabel
std::unique_ptr< svt::AcceleratorExecute > mpAccExec
virtual void dispose() override
const Size & GetSizePixel() const
virtual void StyleUpdated() override
virtual void Resize() override
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
void ConfigureForWidth(int nWidth)
void LoadImageForWidth(int nWidth)
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
virtual void dispose() override
virtual void GetFocus() override
const vcl::KeyCode & GetKeyCode() const
const KeyEvent * GetKeyEvent() const
NotifyEventType GetType() const
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
static bool loadBrandSvg(const char *pName, BitmapEx &rBitmap, int nWidth)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const Color & GetWindowColor() const
const vcl::Font & GetLabelFont() const
const vcl::Font & GetPushButtonFont() const
const Color & GetDialogColor() const
bool IsModuleInstalled(EModule eModule) const
const OUString & getPath() const
static css::awt::KeyEvent st_VCLKey2AWTKey(const vcl::KeyCode &aKey)
static std::unique_ptr< AcceleratorExecute > createAcceleratorHelper()
void SetFontSize(const Size &)
const Size & GetFontSize() const
sal_uInt16 GetCode() const
void SetStyle(WinBits nStyle)
vcl::Window * GetParent() const
GetFocusFlags GetGetFocusFlags() const
void set_height_request(sal_Int32 nHeightRequest)
const AllSettings & GetSettings() const
virtual bool PreNotify(NotifyEvent &rNEvt)
SystemWindow * GetSystemWindow() const
void set_width_request(sal_Int32 nWidthRequest)
virtual void DataChanged(const DataChangedEvent &rDCEvt)
void SetPaintTransparent(bool bTransparent)
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
virtual OutputDevice & get_ref_device()=0
#define TOOLS_WARN_EXCEPTION(area, stream)
Reference< XDispatch > xDispatch
constexpr sal_uInt16 KEY_F6
SVT_DLLPUBLIC void localizeWebserviceURI(OUString &io_rURI)
#define LINK(Instance, Class, Member)
void Clear(EHistoryType eHistory)
css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
Reference< XComponentContext > getProcessComponentContext()
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
Reference< XNameAccess > m_xContainer
Reference< XFrame > xFrame
WinBits const WB_DIALOGCONTROL