1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package ifc.presentation;
25 
26 import lib.MultiPropertyTest;
27 import lib.Status;
28 import lib.StatusException;
29 
30 import com.sun.star.presentation.XPresentation;
31 
32 /**
33 * Testing <code>com.sun.star.presentation.Presentation</code>
34 * service properties :
35 * <ul>
36 *  <li><code> AllowAnimations</code></li>
37 *  <li><code> CustomShow</code></li>
38 *  <li><code> FirstPage</code></li>
39 *  <li><code> IsAlwaysOnTop</code></li>
40 *  <li><code> IsAutomatic</code></li>
41 *  <li><code> IsEndless</code></li>
42 *  <li><code> IsFullScreen</code></li>
43 *  <li><code> IsLivePresentation</code></li>
44 *  <li><code> IsMouseVisible</code></li>
45 *  <li><code> Pause</code></li>
46 *  <li><code> StartWithNavigator</code></li>
47 *  <li><code> UsePen</code></li>
48 * </ul> <p>
49 * This test needs the following object relations :
50 * <ul>
51 *  <li> <code>'Presentation'</code> (of type <code>XPresentation</code>):
52 *   for test of property <code>IsLivePresentation</code>
53 *   presentation start needed </li>
54 * <ul> <p>
55 * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
56 * @see com.sun.star.presentation.Presentation
57 * @see com.sun.star.presentation.XPresentation
58 */
59 public class _Presentation extends MultiPropertyTest {
60 
_IsLivePresentation()61     public void _IsLivePresentation() {
62         XPresentation aPresentation = (XPresentation)
63             tEnv.getObjRelation("Presentation");
64         if (aPresentation == null) throw new StatusException(Status.failed
65             ("Relation 'Presentation' not found"));
66 
67         aPresentation.start();
68         testProperty("IsLivePresentation");
69     }
70 
71     protected PropertyTester CustomShowTester = new PropertyTester() {
72         protected Object getNewValue(String propName, Object oldValue)
73                 throws java.lang.IllegalArgumentException {
74             if ( ((String)oldValue).equals("SecondPresentation") ) {
75                 return new String("FirstPresentation");
76             } else {
77                 return new String("SecondPresentation");
78             }
79         }
80     };
81 
_CustomShow()82     public void _CustomShow() {
83         testProperty("CustomShow", CustomShowTester);
84     }
85 }  // finish class _Presentation
86 
87 
88