Exemple #1
0
        protected PageSequenceMaster(FObj parent, PropertyList propertyList)
            : base(parent, propertyList)
        {
            this.name = "fo:page-sequence-master";

            subSequenceSpecifiers = new ArrayList();

            if (parent.GetName().Equals("fo:layout-master-set"))
            {
                this.layoutMasterSet = (LayoutMasterSet)parent;
                string pm = this.properties.GetProperty("master-name").GetString();
                if (pm == null)
                {
                    FonetDriver.ActiveDriver.FireFonetWarning(
                        "page-sequence-master does not have a page-master-name and so is being ignored");
                }
                else
                {
                    this.layoutMasterSet.addPageSequenceMaster(pm, this);
                }
            }
            else
            {
                throw new FonetException("fo:page-sequence-master must be child "
                    + "of fo:layout-master-set, not "
                    + parent.GetName());
            }
        }
Exemple #2
0
        public Block(FObj parent, PropertyList propertyList) : base(parent, propertyList)
        {
            this.name = "fo:block";

            switch (parent.GetName())
            {
                case "fo:basic-link":
                case "fo:block":
                case "fo:block-container":
                case "fo:float":
                case "fo:flow":
                case "fo:footnote-body":
                case "fo:inline":
                case "fo:inline-container":
                case "fo:list-item-body":
                case "fo:list-item-label":
                case "fo:marker":
                case "fo:multi-case":
                case "fo:static-content":
                case "fo:table-caption":
                case "fo:table-cell":
                case "fo:wrapper":
                    break;
                default:
                    throw new FonetException(
                        "fo:block must be child of " +
                            "fo:basic-link, fo:block, fo:block-container, fo:float, fo:flow, fo:footnote-body, fo:inline, fo:inline-container, fo:list-item-body, fo:list-item-label, fo:marker, fo:multi-case, fo:static-content, fo:table-caption, fo:table-cell or fo:wrapper " +
                            "not " + parent.GetName());
            }
            this.span = this.properties.GetProperty("span").GetEnum();
            ts = propMgr.getTextDecoration(parent);
        }
Exemple #3
0
        protected Flow(FObj parent, PropertyList propertyList)
            : base(parent, propertyList)
        {
            this.name = GetElementName();

            if (parent.GetName().Equals("fo:page-sequence"))
            {
                this.pageSequence = (PageSequence)parent;
            }
            else
            {
                throw new FonetException("flow must be child of "
                    + "page-sequence, not "
                    + parent.GetName());
            }
            SetFlowName(GetProperty("flow-name").GetString());

            if (pageSequence.IsFlowSet)
            {
                if (this.name.Equals("fo:flow"))
                {
                    throw new FonetException("Only a single fo:flow permitted"
                        + " per fo:page-sequence");
                }
                else
                {
                    throw new FonetException(this.name
                        + " not allowed after fo:flow");
                }
            }
            pageSequence.AddFlow(this);
        }
Exemple #4
0
        protected SimplePageMaster(FObj parent, PropertyList propertyList)
            : base(parent, propertyList)
        {
            this.name = "fo:simple-page-master";

            if (parent.GetName().Equals("fo:layout-master-set"))
            {
                this.layoutMasterSet = (LayoutMasterSet)parent;
                masterName = this.properties.GetProperty("master-name").GetString();
                if (masterName == null)
                {
                    FonetDriver.ActiveDriver.FireFonetWarning(
                        "simple-page-master does not have a master-name and so is being ignored");
                }
                else
                {
                    this.layoutMasterSet.addSimplePageMaster(this);
                }
            }
            else
            {
                throw new FonetException("fo:simple-page-master must be child "
                    + "of fo:layout-master-set, not "
                    + parent.GetName());
            }
            _regions = new Hashtable();
        }
Exemple #5
0
 public AbstractTableBody(FObj parent, PropertyList propertyList) : base(parent, propertyList)
 {
     if (!(parent is Table))
     {
         FonetDriver.ActiveDriver.FireFonetError(
             "A table body must be child of fo:table, not " + parent.GetName());
     }
 }
Exemple #6
0
        protected InlineContainer(FObj parent, PropertyList propertyList)
            : base(parent, propertyList)
        {
            this.name = "fo:inline-container";

            BorderAndPadding bap = propMgr.GetBorderAndPadding();
            BackgroundProps bProps = propMgr.GetBackgroundProps();
            MarginInlineProps mProps = propMgr.GetMarginInlineProps();
            RelativePositionProps mRelProps = propMgr.GetRelativePositionProps();
        }
Exemple #7
0
 public PageMasterReference(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     this.name = GetElementName();
     if (GetProperty("master-reference") != null)
     {
         SetMasterName(GetProperty("master-reference").GetString());
     }
     validateParent(parent);
 }
Exemple #8
0
 protected internal Root(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     this.name = "fo:root";
     pageSequences = new ArrayList();
     if (parent != null)
     {
         throw new FonetException("root must be root element");
     }
 }
 protected override Property ConvertPropertyDatatype(
     Property p, PropertyList propertyList, FObj fo)
 {
     String nameval = p.GetNCname();
     if (nameval != null)
     {
         return new ColorTypeProperty(new ColorType(nameval));
     }
     return base.ConvertPropertyDatatype(p, propertyList, fo);
 }
Exemple #10
0
        public RetrieveMarker(FObj parent, PropertyList propertyList)
            : base(parent, propertyList)
        {
            this.name = "fo:retrieve-marker";

            this.retrieveClassName =
                this.properties.GetProperty("retrieve-class-name").GetString();
            this.retrievePosition =
                this.properties.GetProperty("retrieve-position").GetEnum();
            this.retrieveBoundary =
                this.properties.GetProperty("retrieve-boundary").GetEnum();
        }
Exemple #11
0
 public override Property ConvertProperty(Property p,
                                          PropertyList propertyList,
                                          FObj fo)
 {
     if (p is EnumProperty)
     {
         return p;
     }
     else
     {
         return null;
     }
 }
        public ConditionalPageMasterReference(FObj parent, PropertyList propertyList)
            : base(parent, propertyList)
        {
            this.name = GetElementName();
            if (GetProperty("master-reference") != null)
            {
                SetMasterName(GetProperty("master-reference").GetString());
            }

            validateParent(parent);

            setPagePosition(this.properties.GetProperty("page-position").GetEnum());
            setOddOrEven(this.properties.GetProperty("odd-or-even").GetEnum());
            setBlankOrNotBlank(this.properties.GetProperty("blank-or-not-blank").GetEnum());
        }
Exemple #13
0
        protected override Property ConvertPropertyDatatype(Property p, PropertyList propertyList, FObj fo)
        {
            {
                Number numval =
                    p.GetNumber();
                if (numval != null)
                {
                    return new LengthProperty(
                        new PercentLength(numval.DoubleValue(),
                                          GetPercentBase(fo, propertyList)));
                }
            }

            return base.ConvertPropertyDatatype(p, propertyList, fo);
        }
        protected override Property MakeCompound(PropertyList pList, FObj fo)
        {
            LengthPair p = new LengthPair();
            Property subProp;

            subProp = GetSubpropMaker("block-progression-direction").Make(pList,
                                                                          getDefaultForBlockProgressionDirection(), fo);
            p.SetComponent("block-progression-direction", subProp, true);

            subProp = GetSubpropMaker("inline-progression-direction").Make(pList,
                                                                           getDefaultForInlineProgressionDirection(), fo);
            p.SetComponent("inline-progression-direction", subProp, true);

            return new LengthPairProperty(p);
        }
Exemple #15
0
        public Marker(FObj parent, PropertyList propertyList)
            : base(parent, propertyList)
        {
            this.name = "fo:marker";

            this.markerClassName =
                this.properties.GetProperty("marker-class-name").GetString();
            ts = propMgr.getTextDecoration(parent);

            try
            {
                parent.AddMarker(this.markerClassName);
            }
            catch (FonetException)
            {
            }
        }
Exemple #16
0
        public Inline(FObj parent, PropertyList propertyList)
            : base(parent, propertyList)
        {
            this.name = "fo:inline";
            if (parent.GetName().Equals("fo:flow"))
            {
                throw new FonetException("inline formatting objects cannot"
                    + " be directly under flow");
            }

            AccessibilityProps mAccProps = propMgr.GetAccessibilityProps();
            AuralProps mAurProps = propMgr.GetAuralProps();
            BorderAndPadding bap = propMgr.GetBorderAndPadding();
            BackgroundProps bProps = propMgr.GetBackgroundProps();
            MarginInlineProps mProps = propMgr.GetMarginInlineProps();
            RelativePositionProps mRelProps = propMgr.GetRelativePositionProps();
            ts = propMgr.getTextDecoration(parent);
        }
 public RepeatablePageMasterReference(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     string mr = GetProperty("maximum-repeats").GetString();
     if (mr.Equals("no-limit"))
     {
         setMaximumRepeats(INFINITE);
     }
     else
     {
         try
         {
             setMaximumRepeats(Int32.Parse(mr));
         }
         catch (FormatException)
         {
             throw new FonetException("Invalid number for 'maximum-repeats' property");
         }
     }
 }
Exemple #18
0
        protected internal LayoutMasterSet(FObj parent, PropertyList propertyList)
            : base(parent, propertyList)
        {
            this.name = "fo:layout-master-set";
            this.simplePageMasters = new Hashtable();
            this.pageSequenceMasters = new Hashtable();

            if (parent.GetName().Equals("fo:root"))
            {
                this.root = (Root)parent;
                root.setLayoutMasterSet(this);
            }
            else
            {
                throw new FonetException("fo:layout-master-set must be child of fo:root, not "
                    + parent.GetName());
            }
            allRegions = new Hashtable();

        }
Exemple #19
0
        protected void validateParent(FObj parent)
        {
            if (parent.GetName().Equals("fo:page-sequence-master"))
            {
                _pageSequenceMaster = (PageSequenceMaster)parent;

                if (MasterName == null)
                {
                    FonetDriver.ActiveDriver.FireFonetWarning(
                        GetElementName() + " does not have a master-reference and so is being ignored");
                }
                else
                {
                    _pageSequenceMaster.AddSubsequenceSpecifier(this);
                }
            }
            else
            {
                throw new FonetException(GetElementName() + " must be"
                    + "child of fo:page-sequence-master, not "
                    + parent.GetName());
            }
        }
        public RepeatablePageMasterAlternatives(FObj parent, PropertyList propertyList)
            : base(parent, propertyList)
        {
            this.name = "fo:repeatable-page-master-alternatives";

            conditionalPageMasterRefs = new ArrayList();

            if (parent.GetName().Equals("fo:page-sequence-master"))
            {
                this.pageSequenceMaster = (PageSequenceMaster)parent;
                this.pageSequenceMaster.AddSubsequenceSpecifier(this);
            }
            else
            {
                throw new FonetException("fo:repeatable-page-master-alternatives"
                    + "must be child of fo:page-sequence-master, not "
                    + parent.GetName());
            }

            string mr = GetProperty("maximum-repeats").GetString();
            if (mr.Equals("no-limit"))
            {
                setMaximumRepeats(INFINITE);
            }
            else
            {
                try
                {
                    setMaximumRepeats(Int32.Parse(mr));
                }
                catch (FormatException)
                {
                    throw new FonetException("Invalid number for 'maximum-repeats' property");
                }
            }

        }
Exemple #21
0
 protected RegionStart(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
 }
Exemple #22
0
 protected MultiSwitch(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     this.name = "fo:multi-switch";
 }
Exemple #23
0
 public Leader(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
 }
Exemple #24
0
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return(new TableBody(parent, propertyList));
 }
Exemple #25
0
 protected BlockContainer(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     this.name = "fo:block-container";
     this.span = this.properties.GetProperty("span").GetEnum();
 }
Exemple #26
0
 public override IPercentBase GetPercentBase(FObj fo, PropertyList propertyList)
 {
     return(new LengthBase(fo, propertyList, LengthBase.CONTAINING_BOX));
 }
Exemple #27
0
 public PageNumberCitation(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     this.name = "fo:page-number-citation";
 }
Exemple #28
0
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return(new PageNumberCitation(parent, propertyList));
 }
Exemple #29
0
 public ListBlock(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     this.name = "fo:list-block";
 }
Exemple #30
0
 protected MultiPropertySet(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     this.name = "fo:multi-property-set";
 }
Exemple #31
0
 protected TableCaption(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
 }
Exemple #32
0
 public Wrapper(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     this.name = "fo:wrapper";
 }
Exemple #33
0
        public virtual Status Layout(Area area, Region region)
        {
            if (this.marker == MarkerStart)
            {
                this.marker = 0;
            }

            BodyAreaContainer bac = (BodyAreaContainer)area;

            bool      prevChildMustKeepWithNext = false;
            ArrayList pageMarker = this.getMarkerSnapshot(new ArrayList());

            int numChildren = this.children.Count;

            if (numChildren == 0)
            {
                throw new FonetException("fo:flow must contain block-level children");
            }
            for (int i = this.marker; i < numChildren; i++)
            {
                FObj fo = (FObj)children[i];

                if (bac.isBalancingRequired(fo))
                {
                    bac.resetSpanArea();

                    this.Rollback(markerSnapshot);
                    i = this.marker - 1;
                    continue;
                }
                Area currentArea = bac.getNextArea(fo);
                currentArea.setIDReferences(bac.getIDReferences());
                if (bac.isNewSpanArea())
                {
                    this.marker    = i;
                    markerSnapshot = this.getMarkerSnapshot(new ArrayList());
                }
                SetContentWidth(currentArea.getContentWidth());

                _status = fo.Layout(currentArea);

                if (_status.isIncomplete())
                {
                    if ((prevChildMustKeepWithNext) && (_status.laidOutNone()))
                    {
                        this.marker = i - 1;
                        FObj prevChild = (FObj)children[this.marker];
                        prevChild.RemoveAreas();
                        prevChild.ResetMarker();
                        prevChild.RemoveID(area.getIDReferences());
                        _status = new Status(Status.AREA_FULL_SOME);
                        return(_status);
                    }
                    if (bac.isLastColumn())
                    {
                        if (_status.getCode() == Status.FORCE_COLUMN_BREAK)
                        {
                            this.marker = i;
                            _status     =
                                new Status(Status.FORCE_PAGE_BREAK);
                            return(_status);
                        }
                        else
                        {
                            this.marker = i;
                            return(_status);
                        }
                    }
                    else
                    {
                        if (_status.isPageBreak())
                        {
                            this.marker = i;
                            return(_status);
                        }
                        ((ColumnArea)currentArea).incrementSpanIndex();
                        i--;
                    }
                }
                if (_status.getCode() == Status.KEEP_WITH_NEXT)
                {
                    prevChildMustKeepWithNext = true;
                }
                else
                {
                    prevChildMustKeepWithNext = false;
                }
            }
            return(_status);
        }
Exemple #34
0
        public override IPercentBase GetPercentBase(FObj fo, PropertyList propertyList)
        {
            return new LengthBase(fo, propertyList, LengthBase.INH_FONTSIZE);

        }
Exemple #35
0
 public PageNumber(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     this.name = "fo:page-number";
 }
Exemple #36
0
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return(new InlineContainer(parent, propertyList));
 }
Exemple #37
0
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return(new Root(parent, propertyList));
 }
Exemple #38
0
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return new LayoutMasterSet(parent, propertyList);
 }
 public Character(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     this.name = "fo:character";
 }
Exemple #40
0
 public BasicLink(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     this.name = "fo:basic-link";
 }
Exemple #41
0
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return(new RetrieveMarker(parent, propertyList));
 }
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return(new Declarations(parent, propertyList));
 }
Exemple #43
0
        public override Property ConvertProperty(Property p, PropertyList pList, FObj fo)
        {
            if (p is CondLengthProperty)
            {
                return p;
            }
            if (!(p is EnumProperty))
            {
                p = m_shorthandMaker.ConvertProperty(p, pList, fo);
            }
            if (p != null)
            {
                Property prop = MakeCompound(pList, fo);
                CondLength pval = prop.GetCondLength();

                pval.SetComponent("length", p, false);
                return prop;
            }
            else
            {
                return null;
            }
        }
Exemple #44
0
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return new Root(parent, propertyList);
 }
Exemple #45
0
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return(new MultiSwitch(parent, propertyList));
 }
        public override Property ConvertProperty(Property p, PropertyList pList, FObj fo)
        {
            if (p is LengthRangeProperty)
            {
                return p;
            }
            if (!(p is EnumProperty))
            {
                p = m_shorthandMaker.ConvertProperty(p, pList, fo);
            }
            if (p != null)
            {
                Property prop = MakeCompound(pList, fo);
                LengthRange pval = prop.GetLengthRange();

                pval.SetComponent("minimum", p, false);
                pval.SetComponent("optimum", p, false);
                pval.SetComponent("maximum", p, false);
                return prop;
            }
            else
            {
                return null;
            }
        }
Exemple #47
0
 public Table(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     this.name = "fo:table";
 }
Exemple #48
0
        public override Status Layout(Area area)
        {
            if (this.marker == MarkerStart)
            {
                AbsolutePositionProps mAbsProps = propMgr.GetAbsolutePositionProps();
                BorderAndPadding      bap       = propMgr.GetBorderAndPadding();
                BackgroundProps       bProps    = propMgr.GetBackgroundProps();
                MarginProps           mProps    = propMgr.GetMarginProps();

                this.marker   = 0;
                this.position = this.properties.GetProperty("position").GetEnum();
                this.top      = this.properties.GetProperty("top").GetLength().MValue();
                this.bottom   = this.properties.GetProperty("bottom").GetLength().MValue();
                this.left     = this.properties.GetProperty("left").GetLength().MValue();
                this.right    = this.properties.GetProperty("right").GetLength().MValue();
                this.width    = this.properties.GetProperty("width").GetLength().MValue();
                this.height   = this.properties.GetProperty("height").GetLength().MValue();
                span          = this.properties.GetProperty("span").GetEnum();

                string id = this.properties.GetProperty("id").GetString();
                area.getIDReferences().InitializeID(id, area);
            }

            AreaContainer container = (AreaContainer)area;

            if ((this.width == 0) && (this.height == 0))
            {
                width  = right - left;
                height = bottom - top;
            }

            this.areaContainer =
                new AreaContainer(propMgr.GetFontState(container.getFontInfo()),
                                  container.getXPosition() + left,
                                  container.GetYPosition() - top, width, height,
                                  position);

            areaContainer.setPage(area.getPage());
            areaContainer.setBackground(propMgr.GetBackgroundProps());
            areaContainer.setBorderAndPadding(propMgr.GetBorderAndPadding());
            areaContainer.start();

            areaContainer.setAbsoluteHeight(0);
            areaContainer.setIDReferences(area.getIDReferences());

            int numChildren = this.children.Count;

            for (int i = this.marker; i < numChildren; i++)
            {
                FObj   fo     = (FObj)children[i];
                Status status = fo.Layout(areaContainer);
            }

            areaContainer.end();
            if (position == Position.ABSOLUTE)
            {
                areaContainer.SetHeight(height);
            }
            area.addChild(areaContainer);

            return(new Status(Status.OK));
        }
Exemple #49
0
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return(new LayoutMasterSet(parent, propertyList));
 }
Exemple #50
0
 public SinglePageMasterReference(
     FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     this.state = FIRST;
 }
        protected override Property MakeCompound(PropertyList pList, FObj fo)
        {
            LengthRange p = new LengthRange();
            Property subProp;

            subProp = GetSubpropMaker("minimum").Make(pList,
                                                      GetDefaultForMinimum(), fo);
            p.SetComponent("minimum", subProp, true);

            subProp = GetSubpropMaker("optimum").Make(pList,
                                                      GetDefaultForOptimum(), fo);
            p.SetComponent("optimum", subProp, true);

            subProp = GetSubpropMaker("maximum").Make(pList,
                                                      GetDefaultForMaximum(), fo);
            p.SetComponent("maximum", subProp, true);

            return new LengthRangeProperty(p);
        }
Exemple #52
0
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return(new SinglePageMasterReference(parent, propertyList));
 }
            public override IPercentBase GetPercentBase(FObj fo, PropertyList propertyList)
            {
                return new LengthBase(fo, propertyList, LengthBase.CONTAINING_BOX);

            }
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return(new RegionBefore(parent, propertyList));
 }
 protected RegionBefore(FObj parent, PropertyList propertyList)
     : base(parent, propertyList)
 {
     precedence = this.properties.GetProperty("precedence").GetEnum();
 }
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return(new Character(parent, propertyList));
 }
Exemple #57
0
 public PropertyInfo(PropertyMaker maker, PropertyList plist, FObj fo)
 {
     this.maker = maker;
     this.plist = plist;
     this.fo = fo;
 }
Exemple #58
0
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return(new ExternalGraphic(parent, propertyList));
 }
Exemple #59
0
 public override FObj Make(FObj parent, PropertyList propertyList)
 {
     return new BasicLink(parent, propertyList);
 }
Exemple #60
0
 public ExternalGraphic(FObj parent, PropertyList propertyList) : base(parent, propertyList)
 {
     this.name = "fo:external-graphic";
 }