ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater.PluginFramework/Interfaces/PluginInterfaces.cs
Revision: 684
Committed: Mon Jun 17 08:52:54 2013 UTC (10 years, 5 months ago) by william
File size: 5142 byte(s)
Log Message:

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