The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
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.

82 lines
3.0KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifndef __JUCE_SYSTEMTRAYICONCOMPONENT_JUCEHEADER__
  19. #define __JUCE_SYSTEMTRAYICONCOMPONENT_JUCEHEADER__
  20. #if JUCE_WINDOWS || JUCE_LINUX || DOXYGEN
  21. //==============================================================================
  22. /**
  23. On Windows and Linux only, this component sits in the taskbar tray as a small icon.
  24. To use it, just create one of these components, but don't attempt to make it
  25. visible, add it to a parent, or put it on the desktop.
  26. You can then call setIconImage() to create an icon for it in the taskbar.
  27. To change the icon's tooltip, you can use setIconTooltip().
  28. To respond to mouse-events, you can override the normal mouseDown(),
  29. mouseUp(), mouseDoubleClick() and mouseMove() methods, and although the x, y
  30. position will not be valid, you can use this to respond to clicks. Traditionally
  31. you'd use a left-click to show your application's window, and a right-click
  32. to show a pop-up menu.
  33. */
  34. class JUCE_API SystemTrayIconComponent : public Component
  35. {
  36. public:
  37. //==============================================================================
  38. SystemTrayIconComponent();
  39. /** Destructor. */
  40. ~SystemTrayIconComponent();
  41. //==============================================================================
  42. /** Changes the image shown in the taskbar.
  43. */
  44. void setIconImage (const Image& newImage);
  45. /** Changes the tooltip that Windows shows above the icon. */
  46. void setIconTooltip (const String& tooltip);
  47. #if JUCE_LINUX
  48. /** @internal */
  49. void paint (Graphics& g);
  50. #endif
  51. private:
  52. //==============================================================================
  53. class Pimpl;
  54. ScopedPointer<Pimpl> pimpl;
  55. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SystemTrayIconComponent);
  56. };
  57. #endif
  58. #endif // __JUCE_SYSTEMTRAYICONCOMPONENT_JUCEHEADER__