public PropertyList( PropertyList parentPropertyList, string space, string el) { this.parentPropertyList = parentPropertyList; this.nmspace = space; this.element = el; }
protected FObj(FObj parent, PropertyList propertyList) : base(parent) { this.properties = propertyList; propertyList.FObj = this; this.propMgr = MakePropertyManager(propertyList); this.name = "default FO"; SetWritingMode(); }
public override Property ConvertProperty( Property p, PropertyList propertyList, FObj fo) { if (p is ToBeImplementedProperty) { return p; } ToBeImplementedProperty val = new ToBeImplementedProperty(PropName); return val; }
public override Property ConvertProperty( Property p, PropertyList propertyList, FObj fo) { if (p is ListProperty) { return p; } else { return new ListProperty(p); } }
protected UnknownXMLObj(FObj parent, PropertyList propertyList, string space, string tag) : base(parent, propertyList, tag) { this.nmspace = space; if (!"".Equals(space)) { this.name = this.nmspace + ":" + tag; } else { this.name = "(none):" + tag; } }
protected virtual Property convertValueForProperty( string propName, PropertyMaker maker, PropertyList propertyList) { foreach (Property p in list) { Property prop = maker.ConvertShorthandProperty(propertyList, p, null); if (prop != null) { return prop; } } return null; }
public Property GetValueForProperty(string propName, PropertyMaker maker, PropertyList propertyList) { if (count() == 1) { string sval = ((Property)list[0]).GetString(); if (sval != null && sval.Equals("inherit")) { return propertyList.GetFromParentProperty(propName); } } return convertValueForProperty(propName, maker, propertyList); }
public override Property ConvertProperty( Property p, PropertyList propertyList, FObj fo) { if (p is NumberProperty) { return p; } Number val = p.GetNumber(); if (val != null) { return new NumberProperty(val); } return ConvertPropertyDatatype(p, propertyList, fo); }
public override Property ConvertProperty( Property p, PropertyList propertyList, FObj fo) { if (p is ColorTypeProperty) { return p; } ColorType val = p.GetColorType(); if (val != null) { return new ColorTypeProperty(val); } return ConvertPropertyDatatype(p, propertyList, fo); }
public override Property Make( PropertyList propertyList, string value, FObj fo) { int vlen = value.Length - 1; if (vlen > 0) { char q1 = value[0]; if (q1 == '"' || q1 == '\'') { if (value[vlen] == q1) { return new StringProperty(value.Substring(1, vlen - 2)); } Console.WriteLine("Warning String-valued property starts with quote" + " but doesn't end with quote: " + value); } } return new StringProperty(value); }
public override Property ConvertProperty( Property p, PropertyList propertyList, FObj fo) { if (IsAutoLengthAllowed()) { string pval = p.GetString(); if (pval != null && pval.Equals("auto")) { return new LengthProperty(new AutoLength()); } } if (p is LengthProperty) { return p; } Length val = p.GetLength(); if (val != null) { return new LengthProperty(val); } return ConvertPropertyDatatype(p, propertyList, fo); }
public PropertyManager(PropertyList pList) { this.properties = pList; }
internal Property MakeProperty(PropertyList propertyList, string propertyName) { Property p = null; PropertyMaker propertyMaker = FindMaker(propertyName); if (propertyMaker != null) { p = propertyMaker.Make(propertyList); } else { FonetDriver.ActiveDriver.FireFonetWarning("property " + propertyName + " ignored"); } return p; }
private Property ComputeProperty( PropertyList propertyList, PropertyMaker propertyMaker) { Property p = null; try { p = propertyMaker.Compute(propertyList); } catch (FonetException e) { FonetDriver.ActiveDriver.FireFonetError(e.Message); } return p; }
public override FObj Make(FObj parent, PropertyList propertyList) { return(new FObjMixed(parent, propertyList)); }
internal Property GetShorthand(PropertyList propertyList, string propertyName) { PropertyMaker propertyMaker = FindMaker(propertyName); if (propertyMaker != null) { return propertyMaker.GetShorthand(propertyList); } else { FonetDriver.ActiveDriver.FireFonetError("No maker for " + propertyName); return null; } }
protected Unknown(FObj parent, PropertyList propertyList) : base(parent, propertyList) { this.name = "unknown"; }
public virtual FObj Make(FObj parent, PropertyList propertyList) { return new FObj(parent, propertyList); }
public XMLElement(FObj parent, PropertyList propertyList, string tag) : base(parent, propertyList, tag) { Init(); }
protected Title(FObj parent, PropertyList propertyList) : base(parent, propertyList) { this.name = "fo:title"; }
public override FObj Make(FObj parent, PropertyList propertyList) { return new Unknown(parent, propertyList); }
internal PropertyList MakeList( string ns, string elementName, Attributes attributes, FObj parentFO) { Debug.Assert(ns != null, "Namespace should never be null."); string space = "http://www.w3.org/TR/1999/XSL/Format"; if (ns != null) { space = ns; } PropertyList parentPropertyList = parentFO != null ? parentFO.properties : null; PropertyList par = null; if (parentPropertyList != null && space.Equals(parentPropertyList.GetNameSpace())) { par = parentPropertyList; } PropertyList p = new PropertyList(par, space, elementName); p.SetBuilder(this); StringCollection propsDone = new StringCollection(); string fontsizeval = attributes.getValue(FONTSIZEATTR); if (fontsizeval != null) { PropertyMaker propertyMaker = FindMaker(FONTSIZEATTR); if (propertyMaker != null) { try { p.Add(FONTSIZEATTR, propertyMaker.Make(p, fontsizeval, parentFO)); } catch (FonetException) { } } propsDone.Add(FONTSIZEATTR); } for (int i = 0; i < attributes.getLength(); i++) { string attributeName = attributes.getQName(i); int sepchar = attributeName.IndexOf('.'); string propName = attributeName; string subpropName = null; Property propVal = null; if (sepchar > -1) { propName = attributeName.Substring(0, sepchar); subpropName = attributeName.Substring(sepchar + 1); } else if (propsDone.Contains(propName)) { continue; } PropertyMaker propertyMaker = FindMaker(propName); if (propertyMaker != null) { try { if (subpropName != null) { Property baseProp = p.GetExplicitBaseProperty(propName); if (baseProp == null) { string baseValue = attributes.getValue(propName); if (baseValue != null) { baseProp = propertyMaker.Make(p, baseValue, parentFO); propsDone.Add(propName); } } propVal = propertyMaker.Make(baseProp, subpropName, p, attributes.getValue(i), parentFO); } else { propVal = propertyMaker.Make(p, attributes.getValue(i), parentFO); } if (propVal != null) { p[propName] = propVal; } } catch (FonetException e) { FonetDriver.ActiveDriver.FireFonetError(e.Message); } } else { if (!attributeName.StartsWith("xmlns")) { FonetDriver.ActiveDriver.FireFonetWarning( "property " + attributeName + " ignored"); } } } return p; }
public override XMLElement Make(FObj parent, PropertyList propertyList) { return(new XMLElement(parent, propertyList, tag)); }
internal PropertyList MakeList( string ns, string elementName, Attributes attributes, FObj parentFO) { Debug.Assert(ns != null, "Namespace should never be null."); string space = "http://www.w3.org/TR/1999/XSL/Format"; if (ns != null) { space = ns; } PropertyList parentPropertyList = parentFO != null ? parentFO.properties : null; PropertyList par = null; if (parentPropertyList != null && space.Equals(parentPropertyList.GetNameSpace())) { par = parentPropertyList; } PropertyList p = new PropertyList(par, space, elementName); p.SetBuilder(this); StringCollection propsDone = new StringCollection(); string fontsizeval = attributes.getValue(FONTSIZEATTR); if (fontsizeval != null) { PropertyMaker propertyMaker = FindMaker(FONTSIZEATTR); if (propertyMaker != null) { try { p.Add(FONTSIZEATTR, propertyMaker.Make(p, fontsizeval, parentFO)); } catch (FonetException) { } } propsDone.Add(FONTSIZEATTR); } for (int i = 0; i < attributes.getLength(); i++) { string attributeName = attributes.getQName(i); int sepchar = attributeName.IndexOf('.'); string propName = attributeName; string subpropName = null; Property propVal = null; if (sepchar > -1) { propName = attributeName.Substring(0, sepchar); subpropName = attributeName.Substring(sepchar + 1); } else if (propsDone.Contains(propName)) { continue; } PropertyMaker propertyMaker = FindMaker(propName); if (propertyMaker != null) { try { if (subpropName != null) { Property baseProp = p.GetExplicitBaseProperty(propName); if (baseProp == null) { string baseValue = attributes.getValue(propName); if (baseValue != null) { baseProp = propertyMaker.Make(p, baseValue, parentFO); propsDone.Add(propName); } } propVal = propertyMaker.Make(baseProp, subpropName, p, attributes.getValue(i), parentFO); } else { propVal = propertyMaker.Make(p, attributes.getValue(i), parentFO); } if (propVal != null) { p[propName] = propVal; } } catch (FonetException e) { FonetDriver.ActiveDriver.FireFonetError(e.Message); } } else { if (!attributeName.StartsWith("xmlns")) { FonetDriver.ActiveDriver.FireFonetWarning( "property " + attributeName + " ignored"); } } } return(p); }
public override UnknownXMLObj Make(FObj parent, PropertyList propertyList) { return(new UnknownXMLObj(parent, propertyList, space, tag)); }
protected PropertyManager MakePropertyManager(PropertyList propertyList) { return new PropertyManager(propertyList); }
protected ToBeImplementedElement(FObj parent, PropertyList propertyList) : base(parent, propertyList) { }
public override FObj Make(FObj parent, PropertyList propertyList) { return new Title(parent, propertyList); }
public override FObj Make(FObj parent, PropertyList propertyList) { return new UnknownXMLObj(parent, propertyList, space, tag); }
public XMLObj(FObj parent, PropertyList propertyList, string tag) : base(parent, propertyList) { tagName = tag; }
protected UnknownXMLObj(FObj parent, PropertyList propertyList, string space, string tag) : base(parent, propertyList, tag) { this.nmspace = space; }
public virtual FObj Make(FObj parent, PropertyList propertyList) { return(new FObj(parent, propertyList)); }
public LengthBase(FObj parentFO, PropertyList plist, int iBaseType) { this.parentFO = parentFO; this.propertyList = plist; this.iBaseType = iBaseType; }
/// <summary> /// Return a Property object based on the passed Property object. /// This method is called if the Property object built by the parser /// isn't the right type for this property. /// It is overridden by subclasses when the property specification in /// foproperties.xml specifies conversion rules. /// </summary> /// <param name="p">The Property object return by the expression parser</param> /// <param name="propertyList">The PropertyList object being built for this FO.</param> /// <param name="fo">The current FO whose properties are being set.</param> /// <returns> /// A Property of the correct type or null if the parsed value /// can't be converted to the correct type. /// </returns> public virtual Property ConvertProperty(Property p, PropertyList propertyList, FObj fo) { return(null); }
protected PropertyManager MakePropertyManager(PropertyList propertyList) { return(new PropertyManager(propertyList)); }
protected virtual Property ConvertPropertyDatatype(Property p, PropertyList propertyList, FObj fo) { return(null); }
private void StartElement( string uri, string localName, Attributes attlist) { FObj.MakerBase fobjMaker = GetFObjMaker(uri, localName); PropertyListBuilder currentListBuilder = (PropertyListBuilder)this.propertylistTable[uri]; bool foreignXML = false; if (fobjMaker == null) { string fullName = uri + "^" + localName; if (!this.unknownFOs.ContainsKey(fullName)) { this.unknownFOs.Add(fullName, ""); FonetDriver.ActiveDriver.FireFonetError("Unknown formatting object " + fullName); } //if (namespaces.Contains(String.Intern(uri))) if (namespaces.Contains(uri)) { fobjMaker = Unknown.GetMaker(); } else { fobjMaker = UnknownXMLObj.GetMaker(uri, localName); foreignXML = true; } } PropertyList list = null; if (currentListBuilder != null) { list = currentListBuilder.MakeList(uri, localName, attlist, currentFObj); } else if (foreignXML) { list = null; } else { if (currentFObj == null) { throw new FonetException("Invalid XML or missing namespace"); } list = currentFObj.properties; } // FObj fobj = fobjMaker.InnerMake(currentFObj, list); if (rootFObj == null) { rootFObj = fobj; if (!fobj.ElementName.Equals("fo:root")) { throw new FonetException("Root element must" + " be root, not " + fobj.ElementName); } } else if (!(fobj is PageSequence)) { currentFObj.AddChild(fobj); } currentFObj = fobj; }
/// <summary> /// Return a Property object representing the initial value. /// </summary> /// <param name="propertyList">The PropertyList object being built for this FO.</param> /// <returns></returns> public virtual Property Make(PropertyList propertyList) { return(null); }
public override FObj Make(FObj parent, PropertyList propertyList) { return(new Unknown(parent, propertyList)); }
/// <summary> /// Return a Property object representing the initial value. /// </summary> /// <param name="propertyList">The PropertyList object being built for this FO.</param> /// <param name="parentFO">The parent FO for the FO whose property is being made.</param> /// <returns> /// A Property subclass object holding a "compound" property object /// initialized to the default values for each component. /// </returns> protected virtual Property MakeCompound(PropertyList propertyList, FObj parentFO) { return(null); }
public virtual bool IsCorrespondingForced(PropertyList propertyList) { return(false); }
public virtual Property GetShorthand(PropertyList propertyList) { return(null); }
protected FObjMixed(FObj parent, PropertyList propertyList) : base(parent, propertyList) { }
/// <summary> /// Return an object implementing the PercentBase interface. This is /// used to handle properties specified as a percentage of some "base /// length", such as the content width of their containing box. /// Overridden by subclasses which allow percent specifications. See /// the documentation on properties.xsl for details. /// </summary> /// <param name="fo"></param> /// <param name="pl"></param> /// <returns></returns> public virtual IPercentBase GetPercentBase(FObj fo, PropertyList pl) { return(null); }
public override FObj Make(FObj parent, PropertyList propertyList) { return new XMLElement(parent, propertyList, tag); }