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="sd_AccessibleSlideView" script:language="StarBasic">
4
5
6'*************************************************************************
7'
8'  Licensed to the Apache Software Foundation (ASF) under one
9'  or more contributor license agreements.  See the NOTICE file
10'  distributed with this work for additional information
11'  regarding copyright ownership.  The ASF licenses this file
12'  to you under the Apache License, Version 2.0 (the
13'  "License"); you may not use this file except in compliance
14'  with the License.  You may obtain a copy of the License at
15'
16'    http://www.apache.org/licenses/LICENSE-2.0
17'
18'  Unless required by applicable law or agreed to in writing,
19'  software distributed under the License is distributed on an
20'  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21'  KIND, either express or implied.  See the License for the
22'  specific language governing permissions and limitations
23'  under the License.
24'
25'*************************************************************************
26
27
28
29
30
31' Be sure that all variables are dimensioned:
32option explicit
33
34
35' REQUIRED VARIABLES for interface/service tests:
36Global oDP1 As Object
37Global oDP2 As Object
38Global oCntr As Object
39Global multiSelection As Boolean
40
41
42Sub CreateObj()
43
44'*************************************************************************
45' COMPONENT:
46' sd.AccessibleSlideView
47'*************************************************************************
48On Error Goto ErrHndl
49    Dim oDPs As Object
50    Dim oWin As Object, xRoot As Object
51    Dim oSearchedContext As Object
52
53    oDoc = utils.createImpressDocument(cObjectName)
54    Out.Log("Getting drawpages...")
55    oDPs = oDoc.getDrawPages()
56    oDP1 = oDPs.insertNewByIndex(1)
57    oDP2 = oDPs.insertNewByIndex(2)
58    switchOutlineView(oDoc)
59    oWin = utils.at_getCurrentWindow(oDoc)
60    xRoot = utils.at_getAccessibleObject(oWin)
61    oSearchedContext = utils.at_getAccessibleObjectForRole(xRoot, com.sun.star.accessibility.AccessibleRole.DOCUMENT)
62    oObj = oSearchedContext
63    oCntr = oDoc.getCurrentController()
64    multiSelection = true
65
66Exit Sub
67ErrHndl:
68    Test.Exception()
69End Sub
70
71Sub switchOutlineView(xDoc as Object)
72On Error Goto ErrHndl
73
74        Dim Contrl as Variant, disp as Variant, transf as Object
75        Dim URL as new com.sun.star.util.URL
76        Dim noProps()
77        Dim res as Boolean
78
79        Contrl = xDoc.getCurrentController()
80        URL.Complete = "slot:27011"
81        transf = createUnoService("com.sun.star.util.URLTransformer")
82        res = transf.parseStrict(URL)
83
84        out.log("URL parsed :" + res)
85
86        disp = Contrl.queryDispatch(URL, "", 0)
87
88        out.log("disp get.")
89
90        disp.dispatch(URL, noProps())
91Exit Sub
92ErrHndl:
93    Test.Exception()
94End Sub
95
96
97
98Sub DisposeObj()
99    utils.closeObject(oDoc)
100End Sub
101
102' This method is used for XAccessibleEventBroadcaster interface
103Sub fireEvent()
104    oCntr.setCurrentPage(oDP1)
105    oCntr.setCurrentPage(oDP2)
106End Sub
107
108</script:module>
109