DOMPlugin.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public
  5. License as published by the Free Software Foundation; either
  6. version 2 of the License, or (at your option) any later version.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public License
  12. along with this library; see the file COPYING.LIB. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  14. Boston, MA 02110-1301, USA.
  15. */
  16. #ifndef DOMPlugin_h
  17. #define DOMPlugin_h
  18. #include "FrameDestructionObserver.h"
  19. #include "DOMMimeType.h"
  20. #include "ScriptWrappable.h"
  21. #include <wtf/Forward.h>
  22. #include <wtf/RefPtr.h>
  23. #include <wtf/RefCounted.h>
  24. namespace WebCore {
  25. class Plugin;
  26. class PluginData;
  27. class DOMPlugin : public ScriptWrappable, public RefCounted<DOMPlugin>, public FrameDestructionObserver {
  28. public:
  29. static PassRefPtr<DOMPlugin> create(PluginData* pluginData, Frame* frame, unsigned index) { return adoptRef(new DOMPlugin(pluginData, frame, index)); }
  30. ~DOMPlugin();
  31. String name() const;
  32. String filename() const;
  33. String description() const;
  34. unsigned length() const;
  35. PassRefPtr<DOMMimeType> item(unsigned index);
  36. bool canGetItemsForName(const AtomicString& propertyName);
  37. PassRefPtr<DOMMimeType> namedItem(const AtomicString& propertyName);
  38. private:
  39. const PluginInfo& pluginInfo() const { return m_pluginData->plugins()[m_index]; }
  40. DOMPlugin(PluginData*, Frame*, unsigned index);
  41. RefPtr<PluginData> m_pluginData;
  42. unsigned m_index;
  43. };
  44. } // namespace WebCore
  45. #endif // Plugin_h