/* -*- 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 .
*/
/** An ordered list of value ranges. The insertion operation will merge consecutive value ranges.
*/ class OOX_DLLPUBLIC ValueRangeSet
{ public:
ValueRangeSet() {}
/** Inserts the passed value range into the range list. */ void insert( const ValueRange& rRange );
/** Returns the ordered list of all value ranges. */ const ValueRangeVector& getRanges() const { return maRanges; }
private:
ValueRangeVector maRanges;
};
/** Template for a 2-dimensional array of objects.
This class template provides a similar interface to the ::std::vector template.
*/ template< typename Type > class Matrix
{ public: typedef ::std::vector< Type > container_type; typedeftypename container_type::value_type value_type; typedeftypename container_type::pointer pointer; typedeftypename container_type::reference reference; typedeftypename container_type::const_reference const_reference; typedeftypename container_type::size_type size_type; typedeftypename container_type::iterator iterator; typedeftypename container_type::const_iterator const_iterator;
/** Static helper functions for improved API container handling. */ class OOX_DLLPUBLIC ContainerHelper
{ public:
/** Returns a name that is not used in the passed name container.
@param rxNameAccess com.sun.star.container.XNameAccess interface of the name container.
@param rSuggestedName Suggested name for the object.
@return An unused name. Will be equal to the suggested name, if not contained, otherwise a numerical index will be appended.
*/ static OUString getUnusedName( const css::uno::Reference< css::container::XNameAccess >& rxNameAccess, const OUString& rSuggestedName,
sal_Unicode cSeparator );
/** Inserts an object into a name container.
@param rxNameContainer com.sun.star.container.XNameContainer interface of the name container.
The function will use an unused name to insert the object, based on the suggested object name. It is possible to specify whether the existing object or the new inserted object will be renamed, if the container already has an object with the name suggested for the new object.
@param rxNameContainer com.sun.star.container.XNameContainer interface of the name container.
@param rSuggestedName Suggested name for the object.
@param rObject The object to be inserted.
The new object will be inserted with a name not yet extant in the container (this is done by appending a numerical index to the suggested name).
@return The final name the object is inserted with. Will always be equal to the suggested name, if parameter bRenameOldExisting is true.
*/ static OUString insertByUnusedName( const css::uno::Reference< css::container::XNameContainer >& rxNameContainer, const OUString& rSuggestedName,
sal_Unicode cSeparator, const css::uno::Any& rObject );
// std::vector and std::map element access --------------------------------
/** Returns the pointer to an existing element of the passed vector, or a
null pointer, if the passed index is out of bounds. */ template< typename VectorType > staticconsttypename VectorType::value_type*
getVectorElement( const VectorType& rVector, sal_Int32 nIndex );
/** Returns the pointer to an existing element of the passed vector, or a
null pointer, if the passed index is out of bounds. */ template< typename VectorType > statictypename VectorType::value_type*
getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex );
/** Returns the reference to an existing element of the passed vector, or
the passed default value, if the passed index is out of bounds. */ template< typename VectorType > staticconsttypename VectorType::value_type&
getVectorElement( const VectorType& rVector, sal_Int32 nIndex, consttypename VectorType::value_type& rDefault );
/** Returns the pointer to an existing element of the passed map, or a null
pointer, if an element with the passed key does not exist. */ template< typename MapType > staticconsttypename MapType::mapped_type*
getMapElement( const MapType& rMap, consttypename MapType::key_type& rKey );
/** Returns the reference to an existing element of the passed map, or the
passed default value, if an element with the passed key does not exist. */ template< typename MapType > staticconsttypename MapType::mapped_type&
getMapElement( const MapType& rMap, consttypename MapType::key_type& rKey, consttypename MapType::mapped_type& rDefault );
/** Creates a UNO sequence of sequences from a matrix with copies of all elements.
@param rMatrix The matrix to be converted to a sequence of sequences.
@return A com.sun.star.uno.Sequence object containing com.sun.star.uno.Sequence objects with copies of all objects contained in the passed matrix.
*/ template< typename MatrixType > static css::uno::Sequence< css::uno::Sequence< typename MatrixType::value_type > >
matrixToSequenceSequence( const MatrixType& rMatrix );
};
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.