ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater.PluginFramework/Interfaces/PluginInterfaces.cs
Revision: 682
Committed: Mon Jun 17 08:27:34 2013 UTC (9 years, 5 months ago) by william
File size: 5044 byte(s)
Log Message:
+ fix-up null plugins

File Contents

# Content
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Diagnostics;
6 using RomCheater.PluginFramework.Core;
7 using RomCheater.PluginFramework.Events;
8 using WeifenLuo.WinFormsUI.Docking;
9
10 namespace RomCheater.PluginFramework.Interfaces
11 {
12 #region t
13 public interface IExposedPluginData : IAcceptPEData
14 {
15 void SetAcceptedProcess(Process proc);
16 void SetAcceptedConfig(IConfigPlugin config);
17
18 void SetAcceptedProcessAndConfig(IAcceptsProcessAndConfig iapc);
19
20 }
21
22
23 #endregion
24
25 #region IPluginBase
26 public interface IPluginBase : IPluginName, IPluginDescription, IPluginID, IToString, IPluginRefresh, IExposedPluginData
27 {
28 bool IsNullPlugin { get; }
29 bool IsGenericPlugin { get; }
30 }
31 #region IPluginBase SubMembers
32 public interface IToString { string ToString(); }
33 public interface IPluginName { string Name { get; } }
34 public interface IPluginDescription { string Description { get; } }
35 public interface IPluginID { Guid ID { get; } }
36 public interface IPluginRefresh { void Reload(); void Reload(bool silent); }
37 #endregion
38 #endregion
39 #region IConfigPlugin
40 public interface IConfigPlugin : IPluginBase, IAcceptsReadOnlyMemoryRange, ISearchInProgress, IAcceptsMemorySearch
41 {
42 List<ProcContainer> ValidProcessesForPlugin { get; }
43 }
44 #endregion
45 #region IInputPlugin
46 public interface IInputPlugin : IPluginBase
47 {
48 }
49 #endregion
50 #region IWindowPlugin
51 public interface IWindowPlugin : IPluginBase
52 {
53 }
54 #endregion
55 #region IUserControlPlugin
56 public interface IUserControlPlugin : IPluginBase
57 {
58 void Show();
59 void Show(DockPanel dockPanel);
60 void Show(DockPanel dockPanel, DockState dockState);
61 void Config();
62 }
63 #endregion
64 #region IPluginLoader
65 public interface IPluginLoader
66 {
67 void LoadPlugins();
68 void LoadPlugins(bool silent);
69 List<IConfigPlugin> LoadedConfigPlugins { get; }
70 List<IInputPlugin> LoadedInputPlugins { get; }
71 List<IWindowPlugin> LoadedWindowPlugins { get; }
72 List<IUserControlPlugin> LoadedUserControlPlugins { get; }
73
74 IConfigPlugin GetConfigPlugin(string t);
75 IInputPlugin GetInputPlugin(string t);
76 IWindowPlugin GetWindowPlugin(string t);
77
78 string ToString();
79 }
80 #endregion
81 #region AcceptsPlugin
82 public interface IAcceptsPlugin<TPlugin>
83 where TPlugin : IPluginBase
84 {
85 TPlugin AcceptedPlugin { get; set; }
86 }
87 public interface IAcceptsConfig : IAcceptsPlugin<IConfigPlugin> { }
88 public interface IAcceptsProcess : IAcceptsProcess<Process> { }
89 public interface IAcceptsProcess<TProcess>
90 where TProcess : Process
91 {
92 TProcess AcceptedProcess { get; set; }
93 }
94 #endregion
95 public interface IAcceptsProcessAndConfig<TProcess> : IAcceptsConfig, IAcceptsProcess<TProcess> where TProcess : Process { }
96 public interface IAcceptsProcessAndConfig : IAcceptsProcess, IAcceptsConfig { }
97
98 public class AcceptedProcessAndConfig<TProcess> : IAcceptsProcessAndConfig<TProcess> where TProcess : Process
99 {
100 public AcceptedProcessAndConfig() : this(null, default(TProcess)) { }
101 public AcceptedProcessAndConfig(IConfigPlugin config, TProcess process) { AcceptedPlugin = config; AcceptedProcess = process; }
102 #region IAcceptsProcessAndConfig<TProcess> members
103 #endregion
104
105 #region IAcceptsPlugin<IConfigPlugin> Members
106 public IConfigPlugin AcceptedPlugin { get; set; }
107 #endregion
108
109 #region IAcceptsProcess<TProcess> Members
110 public TProcess AcceptedProcess { get; set; }
111 #endregion
112 }
113 public class AcceptedProcessAndConfig : IAcceptsProcessAndConfig
114 {
115 public AcceptedProcessAndConfig() : this(null, null) { }
116 public AcceptedProcessAndConfig(IConfigPlugin config, Process process) { AcceptedPlugin = config; AcceptedProcess = process; }
117
118 #region IAcceptsProcess<Process> Members
119 public Process AcceptedProcess { get; set; }
120 #endregion
121 #region IAcceptsPlugin<IConfigPlugin> Members
122 public IConfigPlugin AcceptedPlugin { get; set; }
123 #endregion
124 }
125
126 public interface IAcceptsProcessPID
127 {
128 int ProcessPID { get; set; }
129 }
130 public interface IAcceptsMemoryRange
131 {
132 ulong MemoryRangeStart { get; set; }
133 ulong MemoryRangeSize { get; set; }
134 }
135 public interface IAcceptsReadOnlyMemoryRange
136 {
137 ulong MemoryRangeStart { get; }
138 ulong MemoryRangeSize { get; }
139 }
140 public interface IOutputsData<TData> { TData Data { get; } }
141 public interface ISearchInProgress
142 {
143 bool SearchInProgess { get; }
144 Guid SearchGuid { get; }
145 }
146 }