Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / vcl / menubarupdateicon.hxx
blob99aea9581a4f93b7100984c726b85b69a23f3cf5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <tools/link.hxx>
23 #include <vcl/idle.hxx>
24 #include <vcl/image.hxx>
26 class BubbleWindow;
27 class MenuBar;
28 class SystemWindow;
29 class VclSimpleEvent;
30 class VclWindowEvent;
31 struct MenuBarButtonCallbackArg;
33 class VCL_DLLPUBLIC MenuBarUpdateIconManager
35 private:
36 OUString maBubbleTitle;
37 OUString maBubbleText;
38 Image maBubbleImage;
39 VclPtr<BubbleWindow> mpBubbleWin;
40 VclPtr<SystemWindow> mpActiveSysWin;
41 VclPtr<MenuBar> mpActiveMBar;
42 std::vector<VclPtr<MenuBar>> maIconMBars;
43 std::vector<sal_uInt16> maIconIDs;
45 Link<VclWindowEvent&, void> maWindowEventHdl;
46 Link<VclSimpleEvent&, void> maApplicationEventHdl;
47 Link<LinkParamNone*, void> maClickHdl;
49 Timer maTimeoutTimer;
50 Idle maWaitIdle;
52 bool mbShowMenuIcon;
53 bool mbShowBubble;
54 bool mbBubbleChanged;
56 DECL_DLLPRIVATE_LINK(UserEventHdl, void*, void);
57 DECL_DLLPRIVATE_LINK(TimeOutHdl, Timer*, void);
58 DECL_DLLPRIVATE_LINK(WindowEventHdl, VclWindowEvent&, void);
59 DECL_DLLPRIVATE_LINK(ApplicationEventHdl, VclSimpleEvent&, void);
60 DECL_DLLPRIVATE_LINK(WaitTimeOutHdl, Timer*, void);
61 DECL_DLLPRIVATE_LINK(ClickHdl, MenuBarButtonCallbackArg&, bool);
62 DECL_DLLPRIVATE_LINK(HighlightHdl, MenuBarButtonCallbackArg&, bool);
64 VclPtr<BubbleWindow> GetBubbleWindow();
65 void SetBubbleChanged();
67 sal_uInt16 GetIconID(MenuBar* pMenuBar) const;
69 void AddMenuBarIcon(SystemWindow& rSysWin, bool bAddEventHdl);
70 void RemoveMenuBarIcon(MenuBar* pMenuBar);
71 void RemoveMenuBarIcons();
73 public:
74 MenuBarUpdateIconManager();
75 ~MenuBarUpdateIconManager();
77 void SetShowMenuIcon(bool bShowMenuIcon);
78 void SetShowBubble(bool bShowBubble);
79 void SetBubbleImage(const Image& rImage);
80 void SetBubbleTitle(const OUString& rTitle);
81 void SetBubbleText(const OUString& rText);
83 void SetClickHdl(const Link<LinkParamNone*, void>& rHdl) { maClickHdl = rHdl; }
85 bool GetShowMenuIcon() const { return mbShowMenuIcon; }
86 bool GetShowBubble() const { return mbShowBubble; }
87 const OUString& GetBubbleTitle() const { return maBubbleTitle; }
88 const OUString& GetBubbleText() const { return maBubbleText; }
90 void RemoveBubbleWindow();
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */