diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-02 09:35:01 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-03 10:19:08 +0100 |
commit | 991ce31833b3e14e75f56b213bcb71bd18d4f980 (patch) | |
tree | 7e6d34d47882e4c58cc14836366b9357f04b66bb | |
parent | ed6dfdbea32ec8fa97e9dc92ebc5dd18bd6ef78e (diff) |
bubblewindow.hxx can be a private vcl header
Change-Id: Iaf79521e812ec32f6e0b9276ad778fe7abc836a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111807
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | extensions/source/update/ui/updatecheckui.cxx | 6 | ||||
-rw-r--r-- | include/vcl/menubarupdateicon.hxx | 89 | ||||
-rw-r--r-- | solenv/clang-format/excludelist | 2 | ||||
-rw-r--r-- | vcl/inc/bubblewindow.hxx (renamed from include/vcl/bubblewindow.hxx) | 57 | ||||
-rw-r--r-- | vcl/source/window/bubblewindow.cxx | 3 |
5 files changed, 94 insertions, 63 deletions
diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx index b9582b465410..a39de0bbd3cb 100644 --- a/extensions/source/update/ui/updatecheckui.cxx +++ b/extensions/source/update/ui/updatecheckui.cxx @@ -31,12 +31,10 @@ #include <comphelper/processfactory.hxx> #include <unotools/resmgr.hxx> #include <vcl/image.hxx> -#include <vcl/bubblewindow.hxx> -#include <vcl/timer.hxx> -#include <vcl/outdev.hxx> -#include <vcl/weld.hxx> +#include <vcl/menubarupdateicon.hxx> #include <vcl/settings.hxx> #include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <sfx2/strings.hrc> #include <rtl/ustrbuf.hxx> diff --git a/include/vcl/menubarupdateicon.hxx b/include/vcl/menubarupdateicon.hxx new file mode 100644 index 000000000000..0b021519dffd --- /dev/null +++ b/include/vcl/menubarupdateicon.hxx @@ -0,0 +1,89 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include <tools/link.hxx> +#include <vcl/idle.hxx> +#include <vcl/image.hxx> +#include <vcl/menu.hxx> + +class BubbleWindow; +class SystemWindow; +class VclSimpleEvent; +class VclWindowEvent; + +class VCL_DLLPUBLIC MenuBarUpdateIconManager +{ +private: + OUString maBubbleTitle; + OUString maBubbleText; + OUString maBubbleImageURL; + Image maBubbleImage; + VclPtr<BubbleWindow> mpBubbleWin; + VclPtr<SystemWindow> mpIconSysWin; + VclPtr<MenuBar> mpIconMBar; + + Link<VclWindowEvent&, void> maWindowEventHdl; + Link<VclSimpleEvent&, void> maApplicationEventHdl; + Link<LinkParamNone*, void> maClickHdl; + + Timer maTimeoutTimer; + Idle maWaitIdle; + + sal_uInt16 mnIconID; + + bool mbShowMenuIcon; + bool mbShowBubble; + bool mbBubbleChanged; + + DECL_LINK(UserEventHdl, void*, void); + DECL_LINK(TimeOutHdl, Timer*, void); + DECL_LINK(WindowEventHdl, VclWindowEvent&, void); + DECL_LINK(ApplicationEventHdl, VclSimpleEvent&, void); + DECL_LINK(WaitTimeOutHdl, Timer*, void); + DECL_LINK(ClickHdl, MenuBar::MenuBarButtonCallbackArg&, bool); + DECL_LINK(HighlightHdl, MenuBar::MenuBarButtonCallbackArg&, bool); + + VclPtr<BubbleWindow> GetBubbleWindow(); + void SetBubbleChanged(); + +public: + MenuBarUpdateIconManager(); + ~MenuBarUpdateIconManager(); + + void SetShowMenuIcon(bool bShowMenuIcon); + void SetShowBubble(bool bShowBubble); + void SetBubbleImage(const Image& rImage); + void SetBubbleTitle(const OUString& rTitle); + void SetBubbleText(const OUString& rText); + + void SetClickHdl(const Link<LinkParamNone*, void>& rHdl) { maClickHdl = rHdl; } + + bool GetShowMenuIcon() const { return mbShowMenuIcon; } + bool GetShowBubble() const { return mbShowBubble; } + OUString GetBubbleTitle() const { return maBubbleTitle; } + OUString GetBubbleText() const { return maBubbleText; } + + void RemoveBubbleWindow(bool bRemoveIcon); + + void AddMenuBarIcon(SystemWindow* pSysWin, bool bAddEventHdl); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 88ecdff9981c..e51305a2f579 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -6363,7 +6363,6 @@ include/vcl/accessibletableprovider.hxx include/vcl/alpha.hxx include/vcl/bitmap.hxx include/vcl/bitmapex.hxx -include/vcl/bubblewindow.hxx include/vcl/builder.hxx include/vcl/builderfactory.hxx include/vcl/cairo.hxx @@ -14453,6 +14452,7 @@ vcl/inc/bitmap/bmpfast.hxx vcl/inc/accel.h vcl/inc/accmgr.hxx vcl/inc/brdwin.hxx +vcl/inc/bubblewindow.hxx vcl/inc/calendar.hxx vcl/inc/canvasbitmap.hxx vcl/inc/configsettings.hxx diff --git a/include/vcl/bubblewindow.hxx b/vcl/inc/bubblewindow.hxx index ae15c051ecc1..2583885b8d5a 100644 --- a/include/vcl/bubblewindow.hxx +++ b/vcl/inc/bubblewindow.hxx @@ -53,61 +53,4 @@ public: const Image& rImage ); }; -class VCL_DLLPUBLIC MenuBarUpdateIconManager -{ -private: - OUString maBubbleTitle; - OUString maBubbleText; - OUString maBubbleImageURL; - Image maBubbleImage; - VclPtr<BubbleWindow> mpBubbleWin; - VclPtr<SystemWindow> mpIconSysWin; - VclPtr<MenuBar> mpIconMBar; - - Link<VclWindowEvent&,void> maWindowEventHdl; - Link<VclSimpleEvent&,void> maApplicationEventHdl; - Link<LinkParamNone*,void> maClickHdl; - - Timer maTimeoutTimer; - Idle maWaitIdle; - - sal_uInt16 mnIconID; - - bool mbShowMenuIcon; - bool mbShowBubble; - bool mbBubbleChanged; - - DECL_LINK(UserEventHdl, void *, void); - DECL_LINK(TimeOutHdl, Timer *, void); - DECL_LINK(WindowEventHdl, VclWindowEvent&, void); - DECL_LINK(ApplicationEventHdl, VclSimpleEvent&, void); - DECL_LINK(WaitTimeOutHdl, Timer *, void); - DECL_LINK(ClickHdl, MenuBar::MenuBarButtonCallbackArg&, bool); - DECL_LINK(HighlightHdl, MenuBar::MenuBarButtonCallbackArg&, bool); - - VclPtr<BubbleWindow> GetBubbleWindow(); - void SetBubbleChanged(); - -public: - MenuBarUpdateIconManager(); - ~MenuBarUpdateIconManager(); - - void SetShowMenuIcon(bool bShowMenuIcon); - void SetShowBubble(bool bShowBubble); - void SetBubbleImage(const Image& rImage); - void SetBubbleTitle(const OUString& rTitle); - void SetBubbleText(const OUString& rText); - - void SetClickHdl(const Link<LinkParamNone*,void>& rHdl) { maClickHdl = rHdl; } - - bool GetShowMenuIcon() const { return mbShowMenuIcon; } - bool GetShowBubble() const { return mbShowBubble; } - OUString GetBubbleTitle() const { return maBubbleTitle; } - OUString GetBubbleText() const { return maBubbleText; } - - void RemoveBubbleWindow(bool bRemoveIcon); - - void AddMenuBarIcon(SystemWindow *pSysWin, bool bAddEventHdl); -}; - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/bubblewindow.cxx b/vcl/source/window/bubblewindow.cxx index 736b66612b0f..a1b97c3d49c3 100644 --- a/vcl/source/window/bubblewindow.cxx +++ b/vcl/source/window/bubblewindow.cxx @@ -18,11 +18,12 @@ */ #include <rtl/ustrbuf.hxx> -#include <vcl/bubblewindow.hxx> +#include <vcl/menubarupdateicon.hxx> #include <vcl/lineinfo.hxx> #include <vcl/settings.hxx> #include <vcl/svapp.hxx> #include <unotools/resmgr.hxx> +#include <bubblewindow.hxx> #include <bitmaps.hlst> #define TIP_HEIGHT 15 |