/* -*- 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 .
*/
protected: // we can't just hold a vector of XContentRefs, as after initialization they're all empty // cause we load them only on access
std::vector<Documents::iterator>
m_aDocuments; // for an efficient index access
Documents m_aDocumentMap; // for an efficient name access
protected: /** Additionally to our own approvals which new elements must pass, derived classes can specify an additional approval instance here.
Every time a new element is inserted into the container (or an element is replaced with a new one), this new element must pass our own internal approval, plus the approval given here.
*/ void setElementApproval(const PContainerApprove& _pElementApproval ) { m_pElementApproval = _pElementApproval; } const PContainerApprove& getElementApproval() const { return m_pElementApproval; }
/** create an object from its persistent data within the configuration. To be overwritten by derived classes. @param _rName the name the object has within the container @return the newly created object or an empty reference if something went wrong
*/ virtual css::uno::Reference< css::ucb::XContent > createObject( const OUString& _rName) = 0;
/** get the object specified by the given name. If desired, the object will be read if not already done so.<BR> @param _rName the object name @param _bReadIfNecessary if sal_True, the object will be created if necessary @return the property set interface of the object. Usually the return value is not NULL, but if so, then the object could not be read from the configuration @throws NoSuchElementException if there is no object with the given name. @see createObject
*/
css::uno::Reference< css::ucb::XContent >
implGetByName(const OUString& _rName, bool _bCreateIfNecessary);
/** quickly checks if there already is an element with a given name. No access to the configuration occurs, i.e. if there is such an object which is not already loaded, it won't be loaded now. @param _rName the object name to check @return sal_True if there already exists such an object
*/ virtualbool checkExistence(const OUString& _rName);
/** append a new object to the container. No plausibility checks are done, e.g. if the object is non-NULL or if the name is already used by another object or anything like this. This method is for derived classes which may support different methods to create and/or append objects, and don't want to deal with the internal structures of this class.<BR> The old component will not be disposed, this is the callers responsibility, too. @param _rName the name of the new object @param _rxNewObject the new object (not surprising, is it ?) @see createConfigKey @see implReplace @see implRemove
*/ void implAppend( const OUString& _rName, const css::uno::Reference< css::ucb::XContent >& _rxNewObject
);
/** remove all references to an object from the container. No plausibility checks are done, e.g. whether or not there exists an object with the given name. This is the responsibility of the caller.<BR> Additionally the node for the given object will be removed from the registry (including all sub nodes).<BR> The old component will not be disposed, this is the callers responsibility, too. @param _rName the objects name @see implReplace @see implAppend
*/ void implRemove(const OUString& _rName);
/** remove an object in the container. No plausibility checks are done, e.g. whether or not there exists an object with the given name or the object is non-NULL. This is the responsibility of the caller.<BR> Additionally all object-related information within the registry will be deleted. The new object config node, where the caller may want to store the new objects information, is returned.<BR> The old component will not be disposed, this is the callers responsibility, too. @param _rName the objects name @param _rxNewObject the new object @param _rNewObjectNode the configuration node where the new object may be stored @see implAppend @see implRemove
*/ void implReplace( const OUString& _rName, const css::uno::Reference< css::ucb::XContent >& _rxNewObject
);
/** approve that the object given may be inserted into the container. Should be overridden by derived classes, the default implementation just checks the object to be non-void.
@throws IllegalArgumentException if the name or the object are invalid @throws ElementExistException if the object already exists in the container, or another object with the same name already exists @throws WrappedTargetException if another error occurs which prevents insertion of the object into the container
*/ void approveNewObject( const OUString& _sName, const css::uno::Reference< css::ucb::XContent >& _rxObject
) const;
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.