FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
BrowserPlugin.h
1 /**********************************************************\
2 Original Author: Richard Bateman (taxilian)
3 
4 Created: Oct 19, 2009
5 License: Dual license model; choose one of two:
6  New BSD License
7  http://www.opensource.org/licenses/bsd-license.php
8  - or -
9  GNU Lesser General Public License, version 2.1
10  http://www.gnu.org/licenses/lgpl-2.1.html
11 
12 Copyright 2009 Richard Bateman, Firebreath development team
13 \**********************************************************/
14 
15 #pragma once
16 #ifndef H_FB_BROWSERPLUGIN
17 #define H_FB_BROWSERPLUGIN
18 
19 #include "APITypes.h"
20 #include "JSAPI.h"
21 #include <boost/shared_ptr.hpp>
22 #include <boost/noncopyable.hpp>
23 
24 namespace FB {
25 
26  FB_FORWARD_PTR(PluginCore);
27 
38  class BrowserPlugin : boost::noncopyable
39  {
40  public:
41  BrowserPlugin(const std::string& mimetype);
42  virtual ~BrowserPlugin();
43 
44  virtual void shutdown() = 0;
45  virtual void setFSPath(const std::string& path);
46 
47  static std::string getFSPath() { return fileSystemPath; }
48 
49  protected:
50  // Even though this is a shared pointer, don't ever hold onto a reference to it except
51  // as a weak_ptr, and then don't keep it locked longer than needed.
52  FB::PluginCorePtr pluginMain;
53 
54  static std::string fileSystemPath;
55  };
56 
57 };
58 #endif
59 
Browser-specific plugin base class.
Definition: BrowserPlugin.h:38
boost::shared_ptr< PluginCore > PluginCorePtr
Defines an alias representing a boost::shared_ptr<PluginCore>
Definition: FactoryBase.h:46