**** Merged from MCS ****
[mono-project.git] / mcs / class / System.Windows.Forms / System.Windows.Forms / AccessibleObject.cs
blob2f9f0f5ed1e6f565cdc15f5bfdb86f1db61518e0
1 //
2 // System.Windows.Forms.AccessibleObject.cs
3 //
4 // Author:
5 // stubbed out by Jaak Simm (jaaksimm@firm.ee)
6 // Dennis Hayes (dennish@raytek.com)
7 // (C) 2002/3 Ximian, Inc
8 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 //
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 //
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System;
32 using System.Reflection;
33 using System.Globalization;
34 using System.Drawing;
35 using Accessibility;
36 using System.Runtime.InteropServices;
37 using IEnumVariant = System.Windows.Forms.UnsafeNativeMethods.IEnumVariant;
39 namespace System.Windows.Forms {
41 /// <summary>
42 /// Provides information that accessibility applications use to adjust an application's UI for users with impairments.
43 /// </summary>
44 [MonoTODO]
45 public class AccessibleObject : MarshalByRefObject, IReflect, IAccessible{
46 private string defaultAction;
47 private string description;
48 private string help;
49 private string keyboardShortcut;
50 private AccessibleObject parent;
51 private AccessibleRole role;
52 private AccessibleStates state;
53 private string name;
54 private string value;
55 // --- Constructor ---
56 [MonoTODO]
57 public AccessibleObject() {
58 name = null;
59 parent = null;
60 role = AccessibleRole.None;
61 state = AccessibleStates.None;
62 value = null;
65 // --- Properties ---
67 //Version 1.1
68 protected void UseStdAccessibleObjects(IntPtr handle){
71 //Version 1.1
72 protected void UseStdAccessibleObjects(IntPtr handle, int objid){
75 public virtual Rectangle Bounds {
76 get { return Rectangle.Empty; } // As per spec for default. Expect override.
79 public virtual string DefaultAction {
80 get {return null; }// As per spec for default. Expect override.
83 public virtual string Description {
84 get {return null; }// As per spec for default. Expect override.
87 public virtual string Help {
88 get {return null; }// As per spec for default. Expect override.
91 public virtual string KeyboardShortcut {
92 get {return null; }// As per spec for default. Expect override.
95 public virtual string Name {
96 get { return name; }
97 set { name = value; }
100 public virtual string Value {
101 get { return this.value; }
102 set { this.value = value; }
105 public virtual AccessibleObject Parent {
106 get { return parent; }
107 set { parent = value; }
110 public virtual AccessibleRole Role {
111 get { return role; }
112 set { role = value; }
115 public virtual AccessibleStates State {
116 get { return state; }
117 set { state = value; }
120 // --- Methods ---
122 public virtual void DoDefaultAction() {
123 return; //default action is "" and cannot be changed, must be overridden.
126 [MonoTODO]
127 public virtual AccessibleObject GetChild(int index) {
128 return null;
131 [MonoTODO]
132 public virtual int GetChildCount() {
133 return -1; //as per spec
136 [MonoTODO]
137 public virtual AccessibleObject GetFocused() {
138 return null;//FIXME: not quite to spec.
141 public virtual int GetHelpTopic(out string fileName) {
142 fileName = "";
143 return -1;//no help
146 public virtual AccessibleObject GetSelected() {
147 return null;
150 [MonoTODO]
151 public virtual AccessibleObject HitTest(int x,int y) {
152 return null; }
154 [MonoTODO]
155 public virtual AccessibleObject Navigate(AccessibleNavigation navdir) {
156 //by default, navagate back to here. Does this work?
157 //not to spec, but better than execption FIXME:
158 return this;
161 [MonoTODO]
162 public virtual void Select(AccessibleSelection flags) {
163 return;//FIXME: Not to spec. should be over ridden anyway.
166 //Not part of spec?
167 //[MonoTODO]
168 //[ComVisible(true)]
169 //protected void UseStdAccessibleObjects(IntPtr handle,int objid)
171 // throw new NotImplementedException ();
174 // --- Methods: IReflect ---
175 [MonoTODO]
176 FieldInfo IReflect.GetField( string name,BindingFlags bindingAttr) {
177 // FIXME
178 throw new NotImplementedException ();
181 [MonoTODO]
182 FieldInfo[] IReflect.GetFields (BindingFlags bindingAttr) {
183 // FIXME
184 throw new NotImplementedException ();
187 [MonoTODO]
188 MemberInfo[] IReflect.GetMember( string name, BindingFlags bindingAttr) {
189 // FIXME
190 throw new NotImplementedException ();
193 [MonoTODO]
194 MemberInfo[] IReflect.GetMembers( BindingFlags bindingAttr) {
195 // FIXME
196 throw new NotImplementedException ();
199 [MonoTODO]
200 MethodInfo IReflect.GetMethod( string name, BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers) {
201 // FIXME
202 throw new NotImplementedException ();
204 [MonoTODO]
205 MethodInfo IReflect.GetMethod( string name, BindingFlags bindingAttr) {
206 // FIXME
207 throw new NotImplementedException ();
212 [MonoTODO]
213 MethodInfo[] IReflect.GetMethods( BindingFlags bindingAttr) {
214 // FIXME
215 throw new NotImplementedException ();
218 [MonoTODO]
219 PropertyInfo[] IReflect.GetProperties( BindingFlags bindingAttr) {
220 // FIXME
221 throw new NotImplementedException ();
224 [MonoTODO]
225 PropertyInfo IReflect.GetProperty( string name, BindingFlags bindingAttr) {
226 // FIXME
227 throw new NotImplementedException ();
230 [MonoTODO]
231 PropertyInfo IReflect.GetProperty( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) {
232 // FIXME
233 throw new NotImplementedException ();
236 [MonoTODO]
237 //[Guid("")]
238 object IReflect.InvokeMember( string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) {
239 // FIXME
240 throw new NotImplementedException ();
243 [MonoTODO]
244 Type IReflect.UnderlyingSystemType {
245 //private Type UnderlyingSystemType {
246 get { throw new NotImplementedException (); }
249 [MonoTODO]
250 void IAccessible.accDoDefaultAction(object childID) {
251 //FIXME:
254 [MonoTODO]
255 int IAccessible.accChildCount{
256 get{
257 throw new NotImplementedException ();
261 [MonoTODO]
262 object IAccessible.accFocus{
263 get{
264 throw new NotImplementedException ();
268 [MonoTODO]
269 object IAccessible.accHitTest(int xLeft, int yTop) {
270 throw new NotImplementedException ();
273 [MonoTODO]
274 void IAccessible.accLocation(out int pxLeft, out int pyTop, out int pcxWidth, out int pcyHeight, object childID) {
275 throw new NotImplementedException ();
278 [MonoTODO]
279 object IAccessible.accNavigate(int navDir, object childID) {
280 throw new NotImplementedException ();
283 [MonoTODO]
284 object IAccessible.accParent {
285 get{
286 throw new NotImplementedException ();
290 [MonoTODO]
291 void IAccessible.accSelect(int flagsSelect, object childID) {
292 //FIXME:
295 [MonoTODO]
296 object IAccessible.accSelection {
299 throw new NotImplementedException ();
303 [MonoTODO]
304 object IAccessible.get_accChild(object childID) {
305 throw new NotImplementedException ();
308 [MonoTODO]
309 string IAccessible.get_accDefaultAction(object childID) {
310 throw new NotImplementedException ();
313 [MonoTODO]
314 string IAccessible.get_accDescription(object childID) {
315 throw new NotImplementedException ();
318 [MonoTODO]
319 string IAccessible.get_accHelp(object childID) {
320 throw new NotImplementedException ();
323 [MonoTODO]
324 int IAccessible.get_accHelpTopic(out string pszHelpFile,object childID) {
325 throw new NotImplementedException ();
328 [MonoTODO]
329 string IAccessible.get_accKeyboardShortcut(object childID) {
330 throw new NotImplementedException ();
333 [MonoTODO]
334 string IAccessible.get_accName(object childID) {
335 throw new NotImplementedException ();
338 [MonoTODO]
339 object IAccessible.get_accRole(object childID) {
340 throw new NotImplementedException ();
343 [MonoTODO]
344 object IAccessible.get_accState(object childID) {
345 throw new NotImplementedException ();
348 [MonoTODO]
349 string IAccessible.get_accValue(object childID) {
350 throw new NotImplementedException ();
353 [MonoTODO]
354 void IAccessible.set_accName(object childID, string newName) {
355 //FIXME:
358 [MonoTODO]
359 void IAccessible.set_accValue(object childID, string newValue) {
360 //FIXME:
362 #if false
363 #region Implementation of UnsafeNativeMethods.IEnumVariant
365 [MonoTODO]
366 void UnsafeNativeMethods.IEnumVariant.Clone (IEnumVariant[] v)
368 throw new NotImplementedException ();
371 [MonoTODO]
372 int UnsafeNativeMethods.IEnumVariant.Next (int n, IntPtr rgvar, int[] ns)
374 throw new NotImplementedException ();
377 [MonoTODO]
378 void UnsafeNativeMethods.IEnumVariant.Reset ()
380 throw new NotImplementedException ();
383 [MonoTODO]
384 void UnsafeNativeMethods.IEnumVariant.Skip (int n)
386 throw new NotImplementedException ();
388 #endregion Implementation of UnsafeNativeMethods.IEnumVariant
389 #endif