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.

95 lines
3.4KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2013 - Raw Material Software 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. On Windows and Linux only, this component sits in the taskbar tray as a small icon.
  23. To use it, just create one of these components, but don't attempt to make it
  24. visible, add it to a parent, or put it on the desktop.
  25. You can then call setIconImage() to create an icon for it in the taskbar.
  26. To change the icon's tooltip, you can use setIconTooltip().
  27. To respond to mouse-events, you can override the normal mouseDown(),
  28. mouseUp(), mouseDoubleClick() and mouseMove() methods, and although the x, y
  29. position will not be valid, you can use this to respond to clicks. Traditionally
  30. you'd use a left-click to show your application's window, and a right-click
  31. to show a pop-up menu.
  32. */
  33. class JUCE_API SystemTrayIconComponent : public Component
  34. {
  35. public:
  36. //==============================================================================
  37. SystemTrayIconComponent();
  38. /** Destructor. */
  39. ~SystemTrayIconComponent();
  40. //==============================================================================
  41. /** Changes the image shown in the taskbar. */
  42. void setIconImage (const Image& newImage);
  43. /** Changes the icon's tooltip (if the current OS supports this). */
  44. void setIconTooltip (const String& tooltip);
  45. /** Highlights the icon (if the current OS supports this). */
  46. void setHighlighted (bool);
  47. /** Shows a floating text bubble pointing to the icon (if the current OS supports this). */
  48. void showInfoBubble (const String& title, const String& content);
  49. /** Hides the icon's floating text bubble (if the current OS supports this). */
  50. void hideInfoBubble();
  51. /** Returns the raw handle to whatever kind of internal OS structure is
  52. involved in showing this icon.
  53. @see ComponentPeer::getNativeHandle()
  54. */
  55. void* getNativeHandle() const;
  56. #if JUCE_LINUX
  57. /** @internal */
  58. void paint (Graphics&) override;
  59. #endif
  60. private:
  61. //==============================================================================
  62. JUCE_PUBLIC_IN_DLL_BUILD (class Pimpl)
  63. ScopedPointer<Pimpl> pimpl;
  64. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SystemTrayIconComponent)
  65. };
  66. #endif
  67. #endif // JUCE_SYSTEMTRAYICONCOMPONENT_H_INCLUDED