Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.6KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #ifndef JUCE_SYSTEMTRAYICONCOMPONENT_H_INCLUDED
  18. #define JUCE_SYSTEMTRAYICONCOMPONENT_H_INCLUDED
  19. #if JUCE_WINDOWS || JUCE_LINUX || JUCE_MAC || DOXYGEN
  20. //==============================================================================
  21. /**
  22. This component sits in the taskbar tray as a small icon.
  23. (NB: The exact behaviour of this class will differ between OSes, and it
  24. isn't fully implemented for all OSes)
  25. To use it, just create one of these components, but don't attempt to make it
  26. visible, add it to a parent, or put it on the desktop.
  27. You can then call setIconImage() to create an icon for it in the taskbar.
  28. To change the icon's tooltip, you can use setIconTooltip().
  29. To respond to mouse-events, you can override the normal mouseDown(),
  30. mouseUp(), mouseDoubleClick() and mouseMove() methods, and although the x, y
  31. position will not be valid, you can use this to respond to clicks. Traditionally
  32. you'd use a left-click to show your application's window, and a right-click
  33. to show a pop-up menu.
  34. */
  35. class JUCE_API SystemTrayIconComponent : public Component
  36. {
  37. public:
  38. //==============================================================================
  39. SystemTrayIconComponent();
  40. /** Destructor. */
  41. ~SystemTrayIconComponent();
  42. //==============================================================================
  43. /** Changes the image shown in the taskbar. */
  44. void setIconImage (const Image& newImage);
  45. /** Changes the icon's tooltip (if the current OS supports this). */
  46. void setIconTooltip (const String& tooltip);
  47. /** Highlights the icon (if the current OS supports this). */
  48. void setHighlighted (bool);
  49. /** Shows a floating text bubble pointing to the icon (if the current OS supports this). */
  50. void showInfoBubble (const String& title, const String& content);
  51. /** Hides the icon's floating text bubble (if the current OS supports this). */
  52. void hideInfoBubble();
  53. /** Returns the raw handle to whatever kind of internal OS structure is
  54. involved in showing this icon.
  55. @see ComponentPeer::getNativeHandle()
  56. */
  57. void* getNativeHandle() const;
  58. #if JUCE_LINUX
  59. /** @internal */
  60. void paint (Graphics&) override;
  61. #endif
  62. #if JUCE_MAC
  63. /** Shows a menu attached to the OSX menu bar icon. */
  64. void showDropdownMenu (const PopupMenu& menu);
  65. #endif
  66. private:
  67. //==============================================================================
  68. JUCE_PUBLIC_IN_DLL_BUILD (class Pimpl)
  69. ScopedPointer<Pimpl> pimpl;
  70. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SystemTrayIconComponent)
  71. };
  72. #endif
  73. #endif // JUCE_SYSTEMTRAYICONCOMPONENT_H_INCLUDED