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 package com.sun.star.wizards.web.data;
24 
25 import com.sun.star.wizards.common.*;
26 import org.w3c.dom.Node;
27 
28 public class CGDesign extends ConfigGroup implements XMLProvider
29 {
30 
31     public String cp_Layout;
32     public String cp_Style;
33     public String cp_BackgroundImage;
34     public String cp_IconSet;
35     //public int cp_OptimizeDisplay;
36     public boolean cp_DisplayTitle;
37     public boolean cp_DisplayDescription;
38     public boolean cp_DisplayAuthor;
39     public boolean cp_DisplayCreateDate;
40     public boolean cp_DisplayUpdateDate;
41     public boolean cp_DisplayFilename;
42     public boolean cp_DisplayFileFormat;
43     public boolean cp_DisplayFormatIcon;
44     public boolean cp_DisplayPages;
45     public boolean cp_DisplaySize;
46     public int cp_OptimizeDisplaySize;
47     private final String TRUE = "true";
48     private final String FALSE = null;
49     private String styleName;
50 
createDOM(Node parent)51     public Node createDOM(Node parent)
52     {
53         return XMLHelper.addElement(parent, "design", new String[0],
54                 new String[0]);
55 
56     }
57     private static final Short SHORT_TRUE = new Short((short) 1);
58     private static final Short SHORT_FALSE = new Short((short) 0);
59 
getStyle()60     public short[] getStyle()
61     {
62         CGStyle style = ((CGStyle) ((CGSettings) root).cp_Styles.getElement(cp_Style));
63         return new short[]
64                 {
65                     (short) ((CGSettings) root).cp_Styles.getIndexOf(style)
66                 };
67     }
68 
setStyle(short[] newStyle)69     public void setStyle(short[] newStyle)
70     {
71         Object o = ((CGSettings) root).cp_Styles.getElementAt(newStyle[0]);
72         cp_Style = (String) ((CGSettings) root).cp_Styles.getKey(o);
73     }
74 
getLayout()75     public int getLayout()
76     {
77         CGLayout layout = ((CGLayout) ((CGSettings) root).cp_Layouts.getElement(cp_Layout));
78         return layout.cp_Index;
79     }
80 
setLayout(int layoutIndex)81     public void setLayout(int layoutIndex)
82     {
83         CGLayout layout = (CGLayout) ((CGSettings) root).cp_Layouts.getElementAt(layoutIndex);
84         cp_Layout = (String) ((CGSettings) root).cp_Layouts.getKey(layout);
85     }
86 }
87 
88