Skip to main content
summaryrefslogtreecommitdiffstats
blob: 6f93c9ac3e76446943f988873a0aa21fb1a4a89a (plain) (blame)
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
/*******************************************************************************
 * Copyright (c) 2006 Sybase, Inc. and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Sybase, Inc. - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.pagedesigner.css2.property;

import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
import org.w3c.dom.Element;
import org.w3c.dom.css.CSSValue;

/**
 * @author mengbo
 */
public interface ICSSPropertyMeta {
	public static final int PERCENTAGE_NONE = 0;

	public static final int PERCENTAGE_BOXSIZE = 1;

	public static final int PERCENTAGE_HEIGHT_CONTAININGBLOCK = 2;

	public static final int PERCENTAGE_FONT = 3;

	public static final int PERCENTAGE_WIDTH_CONTAININGBLOCK = 4;

	public static final Object NOT_SPECIFIED = "NOT_SPECIFIED";

	/**
	 * whether default inherit.
	 * 
	 * @return
	 */
	public boolean isInherited();

	/**
	 * initial value
	 * 
	 * @return
	 */
	public Object getInitialValue(String propertyName, ICSSStyle style);

	public Object getHTMLElementInitialValue(Element element, String htmltag,
			String propertyName);

	/**
	 * what's percentage value based on.
	 * 
	 * @return
	 */
	public int getPercentageType();

	/**
	 * for many CSS property, there is corresponding HTML attribute can also
	 * specify value for them. This method should check whether the element has
	 * corresponding HTML attribute provide value.
	 * 
	 * @param element
	 *            the element
	 * @param htmltag
	 *            the html tag name. This is for in case element is jsp/jsf
	 *            element, and have non html tag name.
	 * @param propertyName
	 *            the property name.
	 * @param style
	 *            the style
	 * @return null if no attribute override.
	 */
	public Object calculateHTMLAttributeOverride(Element element,
			String htmltag, String propertyName, ICSSStyle style);

	/**
	 * @param value
	 * @param propertyName
	 * @param style
	 * @return
	 */
	public Object calculateCSSValueResult(CSSValue value, String propertyName,
			ICSSStyle style);

}

Back to the top