1<?xml version="1.0" encoding="UTF-8"?> 2<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sc_AccessibleEditableTextPara_HeaderFooter" script:language="StarBasic"> 3 4'************************************************************************* 5' 6' Licensed to the Apache Software Foundation (ASF) under one 7' or more contributor license agreements. See the NOTICE file 8' distributed with this work for additional information 9' regarding copyright ownership. The ASF licenses this file 10' to you under the Apache License, Version 2.0 (the 11' "License"); you may not use this file except in compliance 12' with the License. You may obtain a copy of the License at 13' 14' http://www.apache.org/licenses/LICENSE-2.0 15' 16' Unless required by applicable law or agreed to in writing, 17' software distributed under the License is distributed on an 18' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 19' KIND, either express or implied. See the License for the 20' specific language governing permissions and limitations 21' under the License. 22' 23'************************************************************************* 24 25 26 27' Be sure that all variables are dimensioned: 28option explicit 29 30 31' REQUIRED VARIABLES for interface/service tests: 32 33' "com::sun::star::accessibility::XAccessibleEditableText#optional" 34 ' needs the following Global variables: 35global hasChangeableAttrs as boolean 36 37' "com::sun::star::accessibility::XAccessibleSelection#optional" 38 ' needs the following Global variables: 39' Global multiSelection As Boolean 40 41' "com::sun::star::accessibility::XAccessibleText" 42 ' needs the following Global variables: 43global accText as String 44Global readOnly as Boolean 45 46Global accButton as Object 47 48Sub CreateObj() 49 50'************************************************************************* 51' COMPONENT: 52' com.sun.star.sc.AccessibleEditableTextPara_HeaderFooter 53'************************************************************************* 54On Error Goto ErrHndl 55 Dim oMSF As Object, oWin As Object 56 Dim thRunner As Object, xRoot As Object 57 Dim tk As Object 58 59 oDoc = utils.createDocument("scalc", cObjectName) 60 oMSF = getProcessServiceManager() 61 thRunner = oMSF.createInstance("basichelper.ThreadRunner") 62 tk = createUNOService("com.sun.star.awt.Toolkit") 63 wait(1000) 64 thRunner.initialize(Array("OpenToolkitDialog",".uno:EditHeaderAndFooter",oDoc)) 65 wait(1000) 66 oWin = tk.getActiveTopWindow() 67 xRoot = utils.at_getAccessibleObject(oWin) 68' utils.at_printAccessibleTree(xRoot) 69 oObj = utils.at_getAccessibleObjectForRole(xRoot, _ 70 com.sun.star.accessibility.AccessibleRole.PARAGRAPH,"Paragraph 0") 71 accButton = utils.at_getAccessibleObjectForRole(xRoot, _ 72 com.sun.star.accessibility.AccessibleRole.PUSH_BUTTON,"Cancel") 73 accText = "My AccessibleEditableTextPara_HeaderFooter text" 74 oObj.setText(accText) 75 readOnly = false 76 77 hasChangeableAttrs = false 78 79Exit Sub 80ErrHndl: 81 Test.Exception() 82End Sub 83 84Sub fireEvent() 85 Dim myText as String 86 myText = oObj.getText() 87 oObj.setText(myText + "dummy") 88 wait(1000) 89 oObj.setText(myText) 90 wait(1000) 91 accButton.grabFocus() 92End Sub 93 94</script:module> 95