1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 package ifc.sheet;
29 
30 import lib.MultiPropertyTest;
31 
32 import com.sun.star.lang.Locale;
33 
34 /**
35 * Testing <code>com.sun.star.sheet.TableAutoFormatField</code>
36 * service properties :
37 * <ul>
38 *  <li><code> CharFontName</code></li>
39 *  <li><code> CharHeight</code></li>
40 *  <li><code> CharWeight</code></li>
41 *  <li><code> CharPosture</code></li>
42 *  <li><code> CharUnderline</code></li>
43 *  <li><code> CharCrossedOut</code></li>
44 *  <li><code> CharContoured</code></li>
45 *  <li><code> CharShadowed</code></li>
46 *  <li><code> CharColor</code></li>
47 *  <li><code> CharLocale</code></li>
48 *  <li><code> CellBackColor</code></li>
49 *  <li><code> IsCellBackgroundTransparent</code></li>
50 *  <li><code> ShadowFormat</code></li>
51 *  <li><code> ParaRightMargin </code></li>
52 *  <li><code> ParaLeftMargin </code></li>
53 *  <li><code> ParaBottomMargin    </code></li>
54 *  <li><code> ParaTopMargin </code></li>
55 *  <li><code> RotateReference </code></li>
56 *  <li><code> RotateAngle </code></li>
57 *  <li><code> Orientation </code></li>
58 *  <li><code> IsTextWrapped </code></li>
59 *  <li><code> VertJustify </code></li>
60 *  <li><code> HoriJustify </code></li>
61 *  <li><code> CharPostureComplex </code></li>
62 *  <li><code> CharPostureAsian    </code></li>
63 *  <li><code> CharWeightComplex </code></li>
64 *  <li><code> CharWeightAsian </code></li>
65 *  <li><code> CharHeightComplex </code></li>
66 *  <li><code> CharHeightAsian </code></li>
67 *  <li><code> CharFontPitchComplex    </code></li>
68 *  <li><code> CharFontPitchAsian </code></li>
69 *  <li><code> CharFontPitch </code></li>
70 *  <li><code> CharFontFamilyComplex </code></li>
71 *  <li><code> CharFontFamilyAsian </code></li>
72 *  <li><code> CharFontFamily </code></li>
73 *  <li><code> CharFontCharSetComplex </code></li>
74 *  <li><code> CharFontCharSetAsian    </code></li>
75 *  <li><code> CharFontCharSet </code></li>
76 *  <li><code> CharFontStyleNameComplex    </code></li>
77 *  <li><code> CharFontStyleNameAsian </code></li>
78 *  <li><code> CharFontStyleName </code></li>
79 *  <li><code> CharFontNameComplex </code></li>
80 *  <li><code> CharFontNameAsian </code></li>
81 * </ul> <p>
82 * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
83 * @see com.sun.star.sheet.TableAutoFormatField
84 */
85 public class _TableAutoFormatField extends MultiPropertyTest {
86 
87     /**
88     * Only some values can be used (which identify font name).
89     * In this property value is changed from 'Times New Roman'
90     * to 'Courier' and vise versa.
91     */
92     public void _CharFontName() {
93         testProperty("CharFontName", new PropertyTester() {
94             protected Object getNewValue(String p, Object old) {
95                 return "Courier".equals(old) ? "Times New Roman" : "Courier" ;
96             }
97         }) ;
98     }
99 
100     /**
101     * Locale values are predefined and can't be chaged arbitrary.
102     * In this property value is changed from ('de', 'DE', '')
103     * to ('es', 'ES', '') and vise versa.
104     */
105     public void _CharLocale() {
106         testProperty("CharLocale", new PropertyTester() {
107             protected Object getNewValue(String p, Object old) {
108                 return old == null || ((Locale)old).Language == "de" ?
109                     new Locale("es", "ES", "") : new Locale("de", "DE", "") ;
110             }
111         }) ;
112     }
113 
114     /**
115     * This property can be void, so if old value is <code> null </code>
116     * new value must be specified.
117     */
118     public void _ShadowFormat() {
119         testProperty("ShadowFormat", new PropertyTester() {
120             protected Object getNewValue(String p, Object old) {
121                 return old == null ? new com.sun.star.table.ShadowFormat() :
122                     super.getNewValue(p, old) ;
123             }
124         }) ;
125     }
126 
127 } //finish class _TableAutoFormatField
128 
129 
130 
131