/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/** abstract Atom for the layout */ class LayoutAtom
{ public:
LayoutAtom(LayoutNode& rLayoutNode) : mrLayoutNode(rLayoutNode) {} virtual ~LayoutAtom() { }
private:
sal_Int32 mnType;
ParamMap maMap; /// Aspect ratio is not integer, so not part of maMap. double mfAspectRatio = 0;
/// Determines the connector shape type for conn algorithm
sal_Int32 getConnectorType();
};
typedef std::shared_ptr< AlgAtom > AlgAtomPtr;
/// Finds optimal grid to layout children that have fixed aspect ratio. class SnakeAlg
{ public: staticvoid layoutShapeChildren(const AlgAtom& rAlg, const ShapePtr& rShape, const std::vector<Constraint>& rConstraints);
};
/** * Lays out child layout nodes along a vertical path and works with the trapezoid shape to create a * pyramid.
*/ class PyraAlg
{ public: staticvoid layoutShapeChildren(const ShapePtr& rShape);
};
/** * Specifies the size and position for all child layout nodes.
*/ class CompositeAlg
{ public: staticvoid layoutShapeChildren(AlgAtom& rAlg, const ShapePtr& rShape, const std::vector<Constraint>& rConstraints);
private: /** * Apply rConstraint to the rProperties shared layout state. * * Note that the order in which constraints are applied matters, given that constraints can refer to * each other, and in case A depends on B and A is applied before B, the effect of A won't be * updated when B is applied.
*/ staticvoid applyConstraintToLayout(const Constraint& rConstraint,
LayoutPropertyMap& rProperties);
/** * Decides if a certain reference type (e.g. "right") can be inferred from the available properties * in rMap (e.g. left and width). Returns true if rValue is written to.
*/ staticbool inferFromLayoutProperty(const LayoutProperty& rMap, sal_Int32 nRefType,
sal_Int32& rValue);
};
class ForEachAtom
: public LayoutAtom
{ public: explicit ForEachAtom(LayoutNode& rLayoutNode, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttributes);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.