1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessibleAction" script:language="StarBasic">
4
5
6'*************************************************************************
7'
8' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9'
10' Copyright 2000, 2010 Oracle and/or its affiliates.
11'
12' OpenOffice.org - a multi-platform office productivity suite
13'
14' This file is part of OpenOffice.org.
15'
16' OpenOffice.org is free software: you can redistribute it and/or modify
17' it under the terms of the GNU Lesser General Public License version 3
18' only, as published by the Free Software Foundation.
19'
20' OpenOffice.org is distributed in the hope that it will be useful,
21' but WITHOUT ANY WARRANTY; without even the implied warranty of
22' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23' GNU Lesser General Public License version 3 for more details
24' (a copy is included in the LICENSE file that accompanied this code).
25'
26' You should have received a copy of the GNU Lesser General Public License
27' version 3 along with OpenOffice.org.  If not, see
28' <http://www.openoffice.org/license.html>
29' for a copy of the LGPLv3 License.
30'
31'*************************************************************************
32*****
33'*************************************************************************
34
35
36
37' Be sure that all variables are dimensioned:
38option explicit
39
40
41
42
43Sub RunTest()
44
45'*************************************************************************
46' INTERFACE:
47' com.sun.star.accessibility.XAccessibleAction
48'*************************************************************************
49On Error Goto ErrHndl
50    Dim bOK As Boolean
51
52    Test.StartMethod("getAccessibleActionCount()")
53    Dim count As Long
54    bOK = true
55    count = oObj.getAccessibleActionCount()
56    bOK = bOK AND (count &gt; 0)
57    Test.MethodTested("getAccessibleActionCount()",bOK)
58
59    Test.StartMethod("getAccessibleActionDescription()")
60    Dim i As Long
61    Dim desc As String
62    bOK = true
63    i = 0
64    while ( i &lt; count)
65        desc = oObj.getAccessibleActionDescription(i)
66        Out.Log("Found action "+i+": "+desc)
67        bOK = bOK AND NOT isNull(desc)
68        i = i + 1
69    wend
70    Test.MethodTested("getAccessibleActionDescription()",bOK)
71
72    Test.StartMethod("getAccessibleActionKeyBinding()")
73    Dim key As Variant
74    bOK = true
75    i = 0
76    while ( i &lt; count)
77        key = oObj.getAccessibleActionKeyBinding(i)
78        if not isNull(key) then
79            out.Log("Found key in " + i)
80        end if
81        i = i + 1
82    wend
83    Test.MethodTested("getAccessibleActionKeyBinding()",bOK)
84
85    Test.StartMethod("doAccessibleAction()")
86    bOK = true
87    bOK = bOK AND oObj.doAccessibleAction(0)
88    Test.MethodTested("doAccessibleAction()",bOK)
89
90    'This delay is REQUIRED here to avoid soffice blocking
91    wait(1000)
92    ReCreateObj()
93
94Exit Sub
95ErrHndl:
96    Test.Exception()
97    bOK = false
98    resume next
99End Sub
100</script:module>
101