6ad3e9db8f11bbcfc15e3087bb86ca1cb9616bd0
[WebThing.git] / WebThingPlugin.cs
1 using System;
2 using System.Collections.Generic;
3 using WebKit;
4
5 namespace bytex64.WebThing {
6     public abstract class WebThingPlugin {
7         protected Dictionary<string,string> Options;
8
9         public WebThingPlugin() {
10             string classname = this.GetType().FullName;
11
12             if (Config.PluginOptions.ContainsKey(classname)) {
13                 Options = Config.PluginOptions[classname];
14             } else {
15                 Options = new Dictionary<string,string>();
16                 Config.PluginOptions[classname] = Options;
17             }
18         }
19
20         // Plugin life cycle
21         public virtual void Init(WebThing wt) {}
22         public virtual void Deinit(WebThing wt) {}
23
24         // WebView life cycle
25         public virtual void InitWebView(WebView wv) {}
26         public virtual void DeinitWebView(WebView wv) {}
27     }
28 }