2 // System.Windows.Forms.AccessibleObject.cs
5 // stubbed out by Jaak Simm (jaaksimm@firm.ee)
6 // Dennis Hayes (dennish@raytek.com)
7 // (C) 2002/3 Ximian, Inc
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:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
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.
32 using System
.Reflection
;
33 using System
.Globalization
;
36 using System
.Runtime
.InteropServices
;
37 using IEnumVariant
= System
.Windows
.Forms
.UnsafeNativeMethods
.IEnumVariant
;
39 namespace System
.Windows
.Forms
{
42 /// Provides information that accessibility applications use to adjust an application's UI for users with impairments.
45 public class AccessibleObject
: MarshalByRefObject
, IReflect
, IAccessible
{
46 private string defaultAction
;
47 private string description
;
49 private string keyboardShortcut
;
50 private AccessibleObject parent
;
51 private AccessibleRole role
;
52 private AccessibleStates state
;
55 // --- Constructor ---
57 public AccessibleObject() {
60 role
= AccessibleRole
.None
;
61 state
= AccessibleStates
.None
;
68 protected void UseStdAccessibleObjects(IntPtr handle
){
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
{
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
{
112 set { role = value; }
115 public virtual AccessibleStates State
{
116 get { return state; }
117 set { state = value; }
122 public virtual void DoDefaultAction() {
123 return; //default action is "" and cannot be changed, must be overridden.
127 public virtual AccessibleObject
GetChild(int index
) {
132 public virtual int GetChildCount() {
133 return -1; //as per spec
137 public virtual AccessibleObject
GetFocused() {
138 return null;//FIXME: not quite to spec.
141 public virtual int GetHelpTopic(out string fileName
) {
146 public virtual AccessibleObject
GetSelected() {
151 public virtual AccessibleObject
HitTest(int x
,int y
) {
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:
162 public virtual void Select(AccessibleSelection flags
) {
163 return;//FIXME: Not to spec. should be over ridden anyway.
169 //protected void UseStdAccessibleObjects(IntPtr handle,int objid)
171 // throw new NotImplementedException ();
174 // --- Methods: IReflect ---
176 FieldInfo IReflect
.GetField( string name
,BindingFlags bindingAttr
) {
178 throw new NotImplementedException ();
182 FieldInfo
[] IReflect
.GetFields (BindingFlags bindingAttr
) {
184 throw new NotImplementedException ();
188 MemberInfo
[] IReflect
.GetMember( string name
, BindingFlags bindingAttr
) {
190 throw new NotImplementedException ();
194 MemberInfo
[] IReflect
.GetMembers( BindingFlags bindingAttr
) {
196 throw new NotImplementedException ();
200 MethodInfo IReflect
.GetMethod( string name
, BindingFlags bindingAttr
, Binder binder
, Type
[] types
, ParameterModifier
[] modifiers
) {
202 throw new NotImplementedException ();
205 MethodInfo IReflect
.GetMethod( string name
, BindingFlags bindingAttr
) {
207 throw new NotImplementedException ();
213 MethodInfo
[] IReflect
.GetMethods( BindingFlags bindingAttr
) {
215 throw new NotImplementedException ();
219 PropertyInfo
[] IReflect
.GetProperties( BindingFlags bindingAttr
) {
221 throw new NotImplementedException ();
225 PropertyInfo IReflect
.GetProperty( string name
, BindingFlags bindingAttr
) {
227 throw new NotImplementedException ();
231 PropertyInfo IReflect
.GetProperty( string name
, BindingFlags bindingAttr
, Binder binder
, Type returnType
, Type
[] types
, ParameterModifier
[] modifiers
) {
233 throw new NotImplementedException ();
238 object IReflect
.InvokeMember( string name
, BindingFlags invokeAttr
, Binder binder
, object target
, object[] args
, ParameterModifier
[] modifiers
, CultureInfo culture
, string[] namedParameters
) {
240 throw new NotImplementedException ();
244 Type IReflect
.UnderlyingSystemType
{
245 //private Type UnderlyingSystemType {
246 get { throw new NotImplementedException (); }
250 void IAccessible
.accDoDefaultAction(object childID
) {
255 int IAccessible
.accChildCount
{
257 throw new NotImplementedException ();
262 object IAccessible
.accFocus
{
264 throw new NotImplementedException ();
269 object IAccessible
.accHitTest(int xLeft
, int yTop
) {
270 throw new NotImplementedException ();
274 void IAccessible
.accLocation(out int pxLeft
, out int pyTop
, out int pcxWidth
, out int pcyHeight
, object childID
) {
275 throw new NotImplementedException ();
279 object IAccessible
.accNavigate(int navDir
, object childID
) {
280 throw new NotImplementedException ();
284 object IAccessible
.accParent
{
286 throw new NotImplementedException ();
291 void IAccessible
.accSelect(int flagsSelect
, object childID
) {
296 object IAccessible
.accSelection
{
299 throw new NotImplementedException ();
304 object IAccessible
.get_accChild(object childID
) {
305 throw new NotImplementedException ();
309 string IAccessible
.get_accDefaultAction(object childID
) {
310 throw new NotImplementedException ();
314 string IAccessible
.get_accDescription(object childID
) {
315 throw new NotImplementedException ();
319 string IAccessible
.get_accHelp(object childID
) {
320 throw new NotImplementedException ();
324 int IAccessible
.get_accHelpTopic(out string pszHelpFile
,object childID
) {
325 throw new NotImplementedException ();
329 string IAccessible
.get_accKeyboardShortcut(object childID
) {
330 throw new NotImplementedException ();
334 string IAccessible
.get_accName(object childID
) {
335 throw new NotImplementedException ();
339 object IAccessible
.get_accRole(object childID
) {
340 throw new NotImplementedException ();
344 object IAccessible
.get_accState(object childID
) {
345 throw new NotImplementedException ();
349 string IAccessible
.get_accValue(object childID
) {
350 throw new NotImplementedException ();
354 void IAccessible
.set_accName(object childID
, string newName
) {
359 void IAccessible
.set_accValue(object childID
, string newValue
) {
363 #region Implementation of UnsafeNativeMethods.IEnumVariant
366 void UnsafeNativeMethods
.IEnumVariant
.Clone (IEnumVariant
[] v
)
368 throw new NotImplementedException ();
372 int UnsafeNativeMethods
.IEnumVariant
.Next (int n
, IntPtr rgvar
, int[] ns
)
374 throw new NotImplementedException ();
378 void UnsafeNativeMethods
.IEnumVariant
.Reset ()
380 throw new NotImplementedException ();
384 void UnsafeNativeMethods
.IEnumVariant
.Skip (int n
)
386 throw new NotImplementedException ();
388 #endregion Implementation of UnsafeNativeMethods.IEnumVariant