[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.24
[framework/web/webkit-efl.git] / Tools / DumpRenderTree / gtk / AccessibilityUIElementGtk.cpp
1 /*
2  * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3  * Copyright (C) 2009 Jan Michael Alonzo
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
15  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
18  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
25  */
26
27 #include "config.h"
28 #include "AccessibilityUIElement.h"
29
30 #include "WebCoreSupport/DumpRenderTreeSupportGtk.h"
31 #include <JavaScriptCore/JSStringRef.h>
32 #include <atk/atk.h>
33 #include <gtk/gtk.h>
34 #include <wtf/Assertions.h>
35 #include <wtf/gobject/GOwnPtr.h>
36 #include <wtf/gobject/GRefPtr.h>
37
38 AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
39     : m_element(element)
40 {
41 }
42
43 AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other)
44     : m_element(other.m_element)
45 {
46 }
47
48 AccessibilityUIElement::~AccessibilityUIElement()
49 {
50 }
51
52 void AccessibilityUIElement::getLinkedUIElements(Vector<AccessibilityUIElement>& elements)
53 {
54     // FIXME: implement
55 }
56
57 void AccessibilityUIElement::getDocumentLinks(Vector<AccessibilityUIElement>&)
58 {
59     // FIXME: implement
60 }
61
62 void AccessibilityUIElement::getChildren(Vector<AccessibilityUIElement>& children)
63 {
64     int count = childrenCount();
65     for (int i = 0; i < count; i++) {
66         AtkObject* child = atk_object_ref_accessible_child(ATK_OBJECT(m_element), i);
67         children.append(AccessibilityUIElement(child));
68     }
69 }
70
71 void AccessibilityUIElement::getChildrenWithRange(Vector<AccessibilityUIElement>& elementVector, unsigned start, unsigned end)
72 {
73     for (unsigned i = start; i < end; i++) {
74         AtkObject* child = atk_object_ref_accessible_child(ATK_OBJECT(m_element), i);
75         elementVector.append(AccessibilityUIElement(child));
76     }
77 }
78
79 int AccessibilityUIElement::rowCount()
80 {
81     if (!m_element)
82         return 0;
83
84     ASSERT(ATK_IS_TABLE(m_element));
85
86     return atk_table_get_n_rows(ATK_TABLE(m_element));
87 }
88
89 int AccessibilityUIElement::columnCount()
90 {
91     if (!m_element)
92         return 0;
93
94     ASSERT(ATK_IS_TABLE(m_element));
95
96     return atk_table_get_n_columns(ATK_TABLE(m_element));
97 }
98
99 int AccessibilityUIElement::childrenCount()
100 {
101     if (!m_element)
102         return 0;
103
104     ASSERT(ATK_IS_OBJECT(m_element));
105
106     return atk_object_get_n_accessible_children(ATK_OBJECT(m_element));
107 }
108
109 AccessibilityUIElement AccessibilityUIElement::elementAtPoint(int x, int y)
110 {
111     // FIXME: implement
112     return 0;
113 }
114
115 AccessibilityUIElement AccessibilityUIElement::linkedUIElementAtIndex(unsigned index)
116 {
117     // FIXME: implement
118     return 0;
119 }
120
121 AccessibilityUIElement AccessibilityUIElement::getChildAtIndex(unsigned index)
122 {
123     Vector<AccessibilityUIElement> children;
124     getChildrenWithRange(children, index, index + 1);
125
126     if (children.size() == 1)
127         return children.at(0);
128
129     return 0;
130 }
131
132 unsigned AccessibilityUIElement::indexOfChild(AccessibilityUIElement* element)
133
134     // FIXME: implement
135     return 0;
136 }
137
138 gchar* attributeSetToString(AtkAttributeSet* attributeSet)
139 {
140     GString* str = g_string_new(0);
141     for (GSList* attributes = attributeSet; attributes; attributes = attributes->next) {
142         AtkAttribute* attribute = static_cast<AtkAttribute*>(attributes->data);
143         g_string_append(str, g_strconcat(attribute->name, ":", attribute->value, NULL));
144         if (attributes->next)
145             g_string_append(str, ", ");
146     }
147
148     return g_string_free(str, FALSE);
149 }
150
151 JSStringRef AccessibilityUIElement::allAttributes()
152 {
153     if (!m_element)
154         return JSStringCreateWithCharacters(0, 0);
155
156     ASSERT(ATK_IS_OBJECT(m_element));
157     return JSStringCreateWithUTF8CString(attributeSetToString(atk_object_get_attributes(ATK_OBJECT(m_element))));
158 }
159
160 JSStringRef AccessibilityUIElement::attributesOfLinkedUIElements()
161 {
162     // FIXME: implement
163     return JSStringCreateWithCharacters(0, 0);
164 }
165
166 JSStringRef AccessibilityUIElement::attributesOfDocumentLinks()
167 {
168     // FIXME: implement
169     return JSStringCreateWithCharacters(0, 0);
170 }
171
172 AccessibilityUIElement AccessibilityUIElement::titleUIElement()
173 {
174     // FIXME: implement
175     return 0;
176 }
177
178 AccessibilityUIElement AccessibilityUIElement::parentElement()
179 {
180     if (!m_element)
181         return 0;
182
183     ASSERT(ATK_IS_OBJECT(m_element));
184
185     AtkObject* parent =  atk_object_get_parent(ATK_OBJECT(m_element));
186     return parent ? AccessibilityUIElement(parent) : 0;
187 }
188
189 JSStringRef AccessibilityUIElement::attributesOfChildren()
190 {
191     // FIXME: implement
192     return JSStringCreateWithCharacters(0, 0);
193 }
194
195 JSStringRef AccessibilityUIElement::parameterizedAttributeNames()
196 {
197     // FIXME: implement
198     return JSStringCreateWithCharacters(0, 0);
199 }
200
201 JSStringRef AccessibilityUIElement::role()
202 {
203     AtkRole role = atk_object_get_role(ATK_OBJECT(m_element));
204
205     if (!role)
206         return JSStringCreateWithCharacters(0, 0);
207
208     const gchar* roleName = atk_role_get_name(role);
209     GOwnPtr<gchar> axRole(g_strdup_printf("AXRole: %s", roleName));
210
211     return JSStringCreateWithUTF8CString(axRole.get());
212 }
213
214 JSStringRef AccessibilityUIElement::subrole()
215 {
216     return 0;
217 }
218
219 JSStringRef AccessibilityUIElement::roleDescription()
220 {
221     return 0;
222 }
223
224 JSStringRef AccessibilityUIElement::title()
225 {
226     const gchar* name = atk_object_get_name(ATK_OBJECT(m_element));
227
228     if (!name)
229         return JSStringCreateWithCharacters(0, 0);
230
231     GOwnPtr<gchar> axTitle(g_strdup_printf("AXTitle: %s", name));
232
233     return JSStringCreateWithUTF8CString(axTitle.get());
234 }
235
236 JSStringRef AccessibilityUIElement::description()
237 {
238     const gchar* description = atk_object_get_description(ATK_OBJECT(m_element));
239
240     if (!description)
241         return JSStringCreateWithCharacters(0, 0);
242
243     GOwnPtr<gchar> axDesc(g_strdup_printf("AXDescription: %s", description));
244
245     return JSStringCreateWithUTF8CString(axDesc.get());
246 }
247
248 JSStringRef AccessibilityUIElement::stringValue()
249 {
250     // FIXME: implement
251     return JSStringCreateWithCharacters(0, 0);
252 }
253
254 JSStringRef AccessibilityUIElement::language()
255 {
256     // FIXME: implement
257     return JSStringCreateWithCharacters(0, 0);
258 }
259
260 JSStringRef AccessibilityUIElement::helpText() const
261 {
262     if (!m_element)
263         return JSStringCreateWithCharacters(0, 0);
264
265     ASSERT(ATK_IS_OBJECT(m_element));
266
267     CString helpText = DumpRenderTreeSupportGtk::accessibilityHelpText(ATK_OBJECT(m_element));
268     GOwnPtr<gchar> axHelpText(g_strdup_printf("AXHelp: %s", helpText.data()));
269     return JSStringCreateWithUTF8CString(axHelpText.get());
270 }
271
272 double AccessibilityUIElement::x()
273 {
274     int x, y;
275
276     atk_component_get_position(ATK_COMPONENT(m_element), &x, &y, ATK_XY_SCREEN);
277
278     return x;
279 }
280
281 double AccessibilityUIElement::y()
282 {
283     int x, y;
284
285     atk_component_get_position(ATK_COMPONENT(m_element), &x, &y, ATK_XY_SCREEN);
286
287     return y;
288 }
289
290 double AccessibilityUIElement::width()
291 {
292     int width, height;
293
294     atk_component_get_size(ATK_COMPONENT(m_element), &width, &height);
295
296     return width;
297 }
298
299 double AccessibilityUIElement::height()
300 {
301     int width, height;
302
303     atk_component_get_size(ATK_COMPONENT(m_element), &width, &height);
304
305     return height;
306 }
307
308 double AccessibilityUIElement::clickPointX()
309 {
310     return 0.f;
311 }
312
313 double AccessibilityUIElement::clickPointY()
314 {
315     return 0.f;
316 }
317
318 JSStringRef AccessibilityUIElement::orientation() const
319 {
320     return 0;
321 }
322
323 double AccessibilityUIElement::intValue() const
324 {
325     GValue value = { 0, { { 0 } } };
326
327     if (!ATK_IS_VALUE(m_element))
328         return 0.0f;
329
330     atk_value_get_current_value(ATK_VALUE(m_element), &value);
331
332     if (G_VALUE_HOLDS_DOUBLE(&value))
333         return g_value_get_double(&value);
334     else if (G_VALUE_HOLDS_INT(&value))
335         return static_cast<double>(g_value_get_int(&value));
336     else
337         return 0.0f;
338 }
339
340 double AccessibilityUIElement::minValue()
341 {
342     GValue value = { 0, { { 0 } } };
343
344     if (!ATK_IS_VALUE(m_element))
345         return 0.0f;
346
347     atk_value_get_minimum_value(ATK_VALUE(m_element), &value);
348
349     if (G_VALUE_HOLDS_DOUBLE(&value))
350         return g_value_get_double(&value);
351     else if (G_VALUE_HOLDS_INT(&value))
352         return static_cast<double>(g_value_get_int(&value));
353     else
354         return 0.0f;
355 }
356
357 double AccessibilityUIElement::maxValue()
358 {
359     GValue value = { 0, { { 0 } } };
360
361     if (!ATK_IS_VALUE(m_element))
362         return 0.0f;
363
364     atk_value_get_maximum_value(ATK_VALUE(m_element), &value);
365
366     if (G_VALUE_HOLDS_DOUBLE(&value))
367         return g_value_get_double(&value);
368     else if (G_VALUE_HOLDS_INT(&value))
369         return static_cast<double>(g_value_get_int(&value));
370     else
371         return 0.0f;
372 }
373
374 JSStringRef AccessibilityUIElement::valueDescription()
375 {
376     // FIXME: implement
377     return JSStringCreateWithCharacters(0, 0);
378 }
379
380 static bool checkElementState(PlatformUIElement element, AtkStateType stateType)
381 {
382     if (!ATK_IS_OBJECT(element))
383          return false;
384
385     GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(element)));
386     return atk_state_set_contains_state(stateSet.get(), stateType);
387 }
388
389 bool AccessibilityUIElement::isEnabled()
390 {
391     return checkElementState(m_element, ATK_STATE_ENABLED);
392 }
393
394 int AccessibilityUIElement::insertionPointLineNumber()
395 {
396     // FIXME: implement
397     return 0;
398 }
399
400 bool AccessibilityUIElement::isActionSupported(JSStringRef action)
401 {
402     // FIXME: implement
403     return false;
404 }
405
406 bool AccessibilityUIElement::isRequired() const
407 {
408     // FIXME: implement
409     return false;
410 }
411
412 bool AccessibilityUIElement::isFocused() const
413 {
414     if (!ATK_IS_OBJECT(m_element))
415         return false;
416
417     GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(m_element)));
418     gboolean isFocused = atk_state_set_contains_state(stateSet.get(), ATK_STATE_FOCUSED);
419
420     return isFocused;
421 }
422
423 bool AccessibilityUIElement::isSelected() const
424 {
425     return checkElementState(m_element, ATK_STATE_SELECTED);
426 }
427
428 int AccessibilityUIElement::hierarchicalLevel() const
429 {
430     // FIXME: implement
431     return 0;
432 }
433
434 bool AccessibilityUIElement::ariaIsGrabbed() const
435 {
436     return false;
437 }
438  
439 JSStringRef AccessibilityUIElement::ariaDropEffects() const
440 {   
441     return 0; 
442 }
443
444 bool AccessibilityUIElement::isExpanded() const
445 {
446     if (!ATK_IS_OBJECT(m_element))
447         return false;
448
449     GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(m_element)));
450     gboolean isExpanded = atk_state_set_contains_state(stateSet.get(), ATK_STATE_EXPANDED);
451
452     return isExpanded;
453 }
454
455 bool AccessibilityUIElement::isChecked() const
456 {
457     if (!ATK_IS_OBJECT(m_element))
458         return false;
459
460     GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(m_element)));
461     gboolean isChecked = atk_state_set_contains_state(stateSet.get(), ATK_STATE_CHECKED);
462
463     return isChecked;
464 }
465
466 JSStringRef AccessibilityUIElement::attributesOfColumnHeaders()
467 {
468     // FIXME: implement
469     return JSStringCreateWithCharacters(0, 0);
470 }
471
472 JSStringRef AccessibilityUIElement::attributesOfRowHeaders()
473 {
474     // FIXME: implement
475     return JSStringCreateWithCharacters(0, 0);
476 }
477
478 JSStringRef AccessibilityUIElement::attributesOfColumns()
479 {
480     // FIXME: implement
481     return JSStringCreateWithCharacters(0, 0);
482 }
483
484 JSStringRef AccessibilityUIElement::attributesOfRows()
485 {
486     // FIXME: implement
487     return JSStringCreateWithCharacters(0, 0);
488 }
489
490 JSStringRef AccessibilityUIElement::attributesOfVisibleCells()
491 {
492     // FIXME: implement
493     return JSStringCreateWithCharacters(0, 0);
494 }
495
496 JSStringRef AccessibilityUIElement::attributesOfHeader()
497 {
498     // FIXME: implement
499     return JSStringCreateWithCharacters(0, 0);
500 }
501
502 int AccessibilityUIElement::indexInTable()
503 {
504     // FIXME: implement
505     return 0;
506 }
507
508 static JSStringRef indexRangeInTable(PlatformUIElement element, bool isRowRange)
509 {
510     GOwnPtr<gchar> rangeString(g_strdup("{0, 0}"));
511
512     if (!element)
513         return JSStringCreateWithUTF8CString(rangeString.get());
514
515     ASSERT(ATK_IS_OBJECT(element));
516
517     AtkObject* axTable = atk_object_get_parent(ATK_OBJECT(element));
518     if (!axTable || !ATK_IS_TABLE(axTable))
519         return JSStringCreateWithUTF8CString(rangeString.get());
520
521     // Look for the cell in the table.
522     gint indexInParent = atk_object_get_index_in_parent(ATK_OBJECT(element));
523     if (indexInParent == -1)
524         return JSStringCreateWithUTF8CString(rangeString.get());
525
526     int row = -1;
527     int column = -1;
528     row = atk_table_get_row_at_index(ATK_TABLE(axTable), indexInParent);
529     column = atk_table_get_column_at_index(ATK_TABLE(axTable), indexInParent);
530
531     // Get the actual values, if row and columns are valid values.
532     if (row != -1 && column != -1) {
533         int base = 0;
534         int length = 0;
535         if (isRowRange) {
536             base = row;
537             length = atk_table_get_row_extent_at(ATK_TABLE(axTable), row, column);
538         } else {
539             base = column;
540             length = atk_table_get_column_extent_at(ATK_TABLE(axTable), row, column);
541         }
542         rangeString.set(g_strdup_printf("{%d, %d}", base, length));
543     }
544
545     return JSStringCreateWithUTF8CString(rangeString.get());
546 }
547
548 JSStringRef AccessibilityUIElement::rowIndexRange()
549 {
550     // Range in table for rows.
551     return indexRangeInTable(m_element, true);
552 }
553
554 JSStringRef AccessibilityUIElement::columnIndexRange()
555 {
556     // Range in table for columns.
557     return indexRangeInTable(m_element, false);
558 }
559
560 int AccessibilityUIElement::lineForIndex(int)
561 {
562     // FIXME: implement
563     return 0;
564 }
565
566 JSStringRef AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
567 {
568     // FIXME: implement
569     return JSStringCreateWithCharacters(0, 0);
570 }
571
572 JSStringRef AccessibilityUIElement::stringForRange(unsigned, unsigned) 
573 {
574     // FIXME: implement
575     return JSStringCreateWithCharacters(0, 0);
576
577
578 JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned, unsigned)
579 {
580     // FIXME: implement
581     return JSStringCreateWithCharacters(0, 0);
582 }
583
584 bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned location, unsigned length)
585 {
586     // FIXME: implement
587     return false;
588 }
589
590 AccessibilityUIElement AccessibilityUIElement::uiElementForSearchPredicate(AccessibilityUIElement* startElement, bool isDirectionNext, JSStringRef searchKey, JSStringRef searchText)
591 {
592     // FIXME: implement
593     return 0;
594 }
595
596 AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned column, unsigned row)
597 {
598     if (!m_element)
599         return 0;
600
601     ASSERT(ATK_IS_TABLE(m_element));
602
603     AtkObject* foundCell = atk_table_ref_at(ATK_TABLE(m_element), row, column);
604     return foundCell ? AccessibilityUIElement(foundCell) : 0;
605 }
606
607 JSStringRef AccessibilityUIElement::selectedTextRange()
608 {
609     // FIXME: implement
610     return JSStringCreateWithCharacters(0, 0);
611 }
612
613 void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
614 {
615     // FIXME: implement
616 }
617
618 JSStringRef AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
619 {
620     // FIXME: implement
621     return JSStringCreateWithCharacters(0, 0);
622 }
623
624 double AccessibilityUIElement::numberAttributeValue(JSStringRef attribute)
625 {
626     // FIXME: implement
627     return 0.0f;
628 }
629
630 bool AccessibilityUIElement::boolAttributeValue(JSStringRef attribute)
631 {
632     // FIXME: implement
633     return false;
634 }
635
636 bool AccessibilityUIElement::isAttributeSettable(JSStringRef attribute)
637 {
638     // FIXME: implement
639     return false;
640 }
641
642 bool AccessibilityUIElement::isAttributeSupported(JSStringRef attribute)
643 {
644     return false;
645 }
646
647 void AccessibilityUIElement::increment()
648 {
649     if (!m_element)
650         return;
651
652     ASSERT(ATK_IS_OBJECT(m_element));
653     DumpRenderTreeSupportGtk::incrementAccessibilityValue(ATK_OBJECT(m_element));
654 }
655
656 void AccessibilityUIElement::decrement()
657 {
658     if (!m_element)
659         return;
660
661     ASSERT(ATK_IS_OBJECT(m_element));
662     DumpRenderTreeSupportGtk::decrementAccessibilityValue(ATK_OBJECT(m_element));
663 }
664
665 void AccessibilityUIElement::press()
666 {
667     if (!m_element)
668         return;
669
670     ASSERT(ATK_IS_OBJECT(m_element));
671
672     if (!ATK_IS_ACTION(m_element))
673         return;
674
675     // Only one action per object is supported so far.
676     atk_action_do_action(ATK_ACTION(m_element), 0);
677 }
678
679 void AccessibilityUIElement::showMenu()
680 {
681     // FIXME: implement
682 }
683
684 AccessibilityUIElement AccessibilityUIElement::disclosedRowAtIndex(unsigned index)
685 {
686     return 0;
687 }
688
689 AccessibilityUIElement AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned index)
690 {
691     return 0;
692 }
693
694 AccessibilityUIElement AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index)
695 {
696     return 0;
697 }
698
699 AccessibilityUIElement AccessibilityUIElement::selectedRowAtIndex(unsigned index)
700 {
701     return 0;
702 }
703
704 AccessibilityUIElement AccessibilityUIElement::rowAtIndex(unsigned index)
705 {
706     return 0;
707 }
708
709 AccessibilityUIElement AccessibilityUIElement::disclosedByRow()
710 {
711     return 0;
712 }
713
714 JSStringRef AccessibilityUIElement::accessibilityValue() const
715 {
716     // FIXME: implement
717     return JSStringCreateWithCharacters(0, 0);
718 }
719
720 JSStringRef AccessibilityUIElement::documentEncoding()
721 {
722     AtkRole role = atk_object_get_role(ATK_OBJECT(m_element));
723     if (role != ATK_ROLE_DOCUMENT_FRAME)
724         return JSStringCreateWithCharacters(0, 0);
725
726     return JSStringCreateWithUTF8CString(atk_document_get_attribute_value(ATK_DOCUMENT(m_element), "Encoding"));
727 }
728
729 JSStringRef AccessibilityUIElement::documentURI()
730 {
731     AtkRole role = atk_object_get_role(ATK_OBJECT(m_element));
732     if (role != ATK_ROLE_DOCUMENT_FRAME)
733         return JSStringCreateWithCharacters(0, 0);
734
735     return JSStringCreateWithUTF8CString(atk_document_get_attribute_value(ATK_DOCUMENT(m_element), "URI"));
736 }
737
738 JSStringRef AccessibilityUIElement::url()
739 {
740     // FIXME: implement
741     return JSStringCreateWithCharacters(0, 0);
742 }
743
744 bool AccessibilityUIElement::addNotificationListener(JSObjectRef functionCallback)
745 {
746     // FIXME: implement
747     return false;
748 }
749
750 void AccessibilityUIElement::removeNotificationListener()
751 {
752     // FIXME: implement
753 }
754
755 bool AccessibilityUIElement::isFocusable() const
756 {
757     if (!ATK_IS_OBJECT(m_element))
758         return false;
759
760     GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(m_element)));
761     gboolean isFocusable = atk_state_set_contains_state(stateSet.get(), ATK_STATE_FOCUSABLE);
762
763     return isFocusable;
764 }
765
766 bool AccessibilityUIElement::isSelectable() const
767 {
768     // FIXME: implement
769     return false;
770 }
771
772 bool AccessibilityUIElement::isMultiSelectable() const
773 {
774     // FIXME: implement
775     return false;
776 }
777
778 bool AccessibilityUIElement::isSelectedOptionActive() const
779 {
780     // FIXME: implement
781     return false;
782 }
783
784 bool AccessibilityUIElement::isVisible() const
785 {
786     // FIXME: implement
787     return false;
788 }
789
790 bool AccessibilityUIElement::isOffScreen() const
791 {
792     // FIXME: implement
793     return false;
794 }
795
796 bool AccessibilityUIElement::isCollapsed() const
797 {
798     // FIXME: implement
799     return false;
800 }
801
802 bool AccessibilityUIElement::isIgnored() const
803 {
804     // FIXME: implement
805     return false;
806 }
807
808 bool AccessibilityUIElement::hasPopup() const
809 {
810     // FIXME: implement
811     return false;
812 }
813
814 void AccessibilityUIElement::takeFocus()
815 {
816     // FIXME: implement
817 }
818
819 void AccessibilityUIElement::takeSelection()
820 {
821     // FIXME: implement
822 }
823
824 void AccessibilityUIElement::addSelection()
825 {
826     // FIXME: implement
827 }
828
829 void AccessibilityUIElement::removeSelection()
830 {
831     // FIXME: implement
832 }
833
834 void AccessibilityUIElement::scrollToMakeVisible()
835 {
836     // FIXME: implement
837 }
838
839 void AccessibilityUIElement::scrollToMakeVisibleWithSubFocus(int x, int y, int width, int height)
840 {
841     // FIXME: implement
842 }
843
844 void AccessibilityUIElement::scrollToGlobalPoint(int x, int y)
845 {
846     // FIXME: implement
847 }