summaryrefslogtreecommitdiffstats
path: root/wizards/com/sun/star/wizards/web/data/CGDesign.java
blob: 384c3cc9e142689aa3ae7c46777099a2e26b0fef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2008 by Sun Microsystems, Inc.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * $RCSfile: CGDesign.java,v $
 * $Revision: 1.6 $
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/
package com.sun.star.wizards.web.data;

import com.sun.star.wizards.common.*;
import org.w3c.dom.Node;


public class CGDesign extends ConfigGroup implements XMLProvider {

     public String cp_Layout;
     public String cp_Style;
     public String cp_BackgroundImage;
     public String cp_IconSet;
     //public int cp_OptimizeDisplay;

     public boolean cp_DisplayTitle;
     public boolean cp_DisplayDescription;
     public boolean cp_DisplayAuthor;
     public boolean cp_DisplayCreateDate;
     public boolean cp_DisplayUpdateDate;
     public boolean cp_DisplayFilename;
     public boolean cp_DisplayFileFormat;
     public boolean cp_DisplayFormatIcon;
     public boolean cp_DisplayPages;
     public boolean cp_DisplaySize;
     public int cp_OptimizeDisplaySize;



     private final String TRUE = "true";
     private final String FALSE = null;

     private String styleName;


     public Node createDOM(Node parent) {
         return XMLHelper.addElement(parent, "design", new String[0] ,
           new String[0]
            );

     }

    private static final Short SHORT_TRUE = new Short((short)1);
    private static final Short SHORT_FALSE = new Short((short)0);


    public short[] getStyle() {
        CGStyle style = ((CGStyle) ((CGSettings)root).cp_Styles.getElement(cp_Style));
        return new short[] { (short) ((CGSettings)root).cp_Styles.getIndexOf(style)};
    }

    public void setStyle(short[] newStyle) {
        Object o = ((CGStyle) ((CGSettings)root).cp_Styles.getElementAt(newStyle[0]));
        cp_Style =  (String)((CGSettings)root).cp_Styles.getKey(o);
    }

    public int getLayout() {
        CGLayout layout = ((CGLayout) ((CGSettings)root).cp_Layouts.getElement(cp_Layout));
        return layout.cp_Index;
    }

    public void setLayout(int layoutIndex) {
        CGLayout layout = (CGLayout)((CGSettings)root).cp_Layouts.getElementAt(layoutIndex);
        cp_Layout = (String)((CGSettings)root).cp_Layouts.getKey(layout);
    }

}