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.

94 lines
3.4KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-7 by Raw Material Software ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the
  7. GNU General Public License, as published by the Free Software Foundation;
  8. either version 2 of the License, or (at your option) any later version.
  9. JUCE is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with JUCE; if not, visit www.gnu.org/licenses or write to the
  15. Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  16. Boston, MA 02111-1307 USA
  17. ------------------------------------------------------------------------------
  18. If you'd like to release a closed-source product which uses JUCE, commercial
  19. licenses are also available: visit www.rawmaterialsoftware.com/juce for
  20. more information.
  21. ==============================================================================
  22. */
  23. #ifndef __JUCE_BROWSERPLUGINCOMP_H__
  24. #define __JUCE_BROWSERPLUGINCOMP_H__
  25. #include "../../../../juce/juce_amalgamated.h"
  26. //==============================================================================
  27. /**
  28. Base class for a browser plugin object.
  29. You need to implement a createBrowserPlugin() function that the host will call
  30. when it needs a new instance of your BrowserPluginComponent subclass. The host will
  31. delete the BrowserPluginComponent later when the user navigates away from the
  32. page.
  33. */
  34. class BrowserPluginComponent : public Component
  35. {
  36. public:
  37. //==============================================================================
  38. /**
  39. Creates a browser plugin object.
  40. @see createBrowserPlugin
  41. */
  42. BrowserPluginComponent();
  43. /** Destructor. */
  44. ~BrowserPluginComponent();
  45. //==============================================================================
  46. /** Returns a string describing the host browser version.
  47. */
  48. const String getBrowserVersion() const;
  49. /** Returns the URL that the browser is currently showing.
  50. */
  51. const String getBrowserURL() const;
  52. /** The plugin must implement this method to return a variant object whose
  53. properties and methods can be accessed by javascript in the browser.
  54. If your plugin doesn't need to represent itself, you can just return
  55. a void var() object here.
  56. */
  57. virtual const var getJavascriptObject() = 0;
  58. //==============================================================================
  59. juce_UseDebuggingNewOperator
  60. };
  61. //==============================================================================
  62. /**
  63. This function must be implemented somewhere in your code to create the actual
  64. plugin object that you want to use.
  65. Obviously multiple instances may be used simultaneously, so be VERY cautious
  66. in your use of static variables!
  67. */
  68. BrowserPluginComponent* JUCE_CALLTYPE createBrowserPlugin();
  69. #endif