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.

juce_SystemTrayIconComponent.h 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 5 End-User License
  8. Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
  9. 27th April 2017).
  10. End User License Agreement: www.juce.com/juce-5-licence
  11. Privacy Policy: www.juce.com/juce-5-privacy-policy
  12. Or: You may also use this code under the terms of the GPL v3 (see
  13. www.gnu.org/licenses).
  14. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  15. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  16. DISCLAIMED.
  17. ==============================================================================
  18. */
  19. namespace juce
  20. {
  21. #if JUCE_WINDOWS || JUCE_LINUX || JUCE_MAC || DOXYGEN
  22. //==============================================================================
  23. /**
  24. This component sits in the taskbar tray as a small icon.
  25. (NB: The exact behaviour of this class will differ between OSes, and it
  26. isn't fully implemented for all OSes)
  27. To use it, just create one of these components, but don't attempt to make it
  28. visible, add it to a parent, or put it on the desktop.
  29. You can then call setIconImage() to create an icon for it in the taskbar.
  30. To change the icon's tooltip, you can use setIconTooltip().
  31. To respond to mouse-events, you can override the normal mouseDown(),
  32. mouseUp(), mouseDoubleClick() and mouseMove() methods, and although the x, y
  33. position will not be valid, you can use this to respond to clicks. Traditionally
  34. you'd use a left-click to show your application's window, and a right-click
  35. to show a pop-up menu.
  36. */
  37. class JUCE_API SystemTrayIconComponent : public Component
  38. {
  39. public:
  40. //==============================================================================
  41. SystemTrayIconComponent();
  42. /** Destructor. */
  43. ~SystemTrayIconComponent();
  44. //==============================================================================
  45. /** Changes the image shown in the taskbar. */
  46. void setIconImage (const Image& newImage);
  47. /** Changes the icon's tooltip (if the current OS supports this). */
  48. void setIconTooltip (const String& tooltip);
  49. /** Highlights the icon (if the current OS supports this). */
  50. void setHighlighted (bool);
  51. /** Shows a floating text bubble pointing to the icon (if the current OS supports this). */
  52. void showInfoBubble (const String& title, const String& content);
  53. /** Hides the icon's floating text bubble (if the current OS supports this). */
  54. void hideInfoBubble();
  55. /** Returns the raw handle to whatever kind of internal OS structure is
  56. involved in showing this icon.
  57. @see ComponentPeer::getNativeHandle()
  58. */
  59. void* getNativeHandle() const;
  60. #if JUCE_LINUX
  61. /** @internal */
  62. void paint (Graphics&) override;
  63. #endif
  64. #if JUCE_MAC
  65. /** Shows a menu attached to the OSX menu bar icon. */
  66. void showDropdownMenu (const PopupMenu& menu);
  67. #endif
  68. private:
  69. //==============================================================================
  70. JUCE_PUBLIC_IN_DLL_BUILD (class Pimpl)
  71. ScopedPointer<Pimpl> pimpl;
  72. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SystemTrayIconComponent)
  73. };
  74. #endif
  75. } // namespace juce