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