FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
PluginEventMac.h
1 /**********************************************************\
2 Original Author: Anson MacKeracher
3 
4 Created: Mar 26, 2010
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 2010 Anson MacKeracher, Firebreath development team
13 \**********************************************************/
14 
15 #ifndef H_PLUGINEVENTMAC
16 #define H_PLUGINEVENTMAC
17 
18 #include "NpapiBrowserHost.h"
19 #include "NpapiTypes.h"
20 #include "FBPointers.h"
21 
22 namespace FB {
23 
24  FB_FORWARD_PTR(PluginEventMac);
25  FB_FORWARD_PTR(PluginWindowMac);
26 
27  class PluginEventMac
28  {
29  public:
30  enum EventModel
31  {
32  EventModelCarbon,
33  EventModelCocoa
34  };
35  static NPEventModel initPluginEventMac(const FB::Npapi::NpapiBrowserHostPtr &host, NPDrawingModel drawingModel);
36  static FB::PluginEventMac* createPluginEventMac(NPEventModel eventModel);
37 
38  PluginEventMac() {}
39  virtual ~PluginEventMac() {}
40 
41  virtual EventModel getEventModel() const = 0;
42  virtual int16_t HandleEvent(void* event) = 0;
43  void setPluginWindow(PluginWindowMacPtr window) { m_PluginWindow = window; }
44 
45  protected:
46  PluginWindowMacWeakPtr m_PluginWindow;
47  };
48 
49 };
50 
51 #endif // H_PLUGINEVENTMAC