- monodevelop project update
[FaRetSys.git] / IPlugin / IPlugin.cs
blob5f6d54523c566c29c139467cd32966f14cda0ee7
1 using System;
2 using System.Xml;
3 using Mono.Unix;
5 namespace Eithne
7 public abstract class IPlugin
9 protected IInfo _info;
10 private object _source;
11 protected XmlDocument _xmldoc;
12 protected bool _workdone = false;
13 protected IBlock _block = null;
14 protected CommSocket _in = null, _out = null;
16 public virtual IInfo Info { get { return _info; } }
17 public XmlDocument XmlDoc { set { _xmldoc = value; } }
19 public object Source
21 get { return _source; }
22 set { _source = value; }
25 public virtual XmlNode Config
27 get { return null; }
28 set {}
31 public virtual bool WorkDone
33 get { return _workdone; }
34 set { _workdone = value; }
37 public IBlock Block
39 set { _block = value; }
42 public abstract void Setup();
43 public abstract void Work();
45 public virtual void Invalidate()
47 ClearInput();
48 ClearOutput();
51 protected void ClearInput()
53 if(_in != null)
55 for(int i=0; i<_in.Length; i++)
56 _in[i] = null;
57 _in = null;
61 protected void ClearOutput()
63 if(_out != null)
65 for(int i=0; i<_out.Length; i++)
66 _out[i] = null;
67 _out = null;
71 public virtual void Lock()
75 public virtual void Unlock()
79 public virtual bool HasSetup
81 get { return true; }
84 public abstract int NumIn { get; }
85 public abstract int NumOut { get; }
87 public CommSocket In
89 set { _in = value; }
92 public CommSocket Out
94 get { return _out; }
97 public abstract string DescIn(int n);
98 public abstract string DescOut(int n);
100 public abstract string[] MatchIn { get; }
101 public abstract string[] MatchOut { get; }
103 public virtual float Progress { get { return -1; } }
106 public abstract class IImgProcPlugin : IPlugin
109 public abstract class IResProcPlugin : IPlugin
112 public abstract class IComparatorPlugin : IPlugin
115 public abstract class IOtherPlugin : IPlugin