2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 21:00:32 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2009-05-15 18:00:17 +02:00
|
|
|
|
2009-09-08 14:59:07 +02:00
|
|
|
#ifndef INCLUDED_CONFIGMGR_SOURCE_CHILDACCESS_HXX
|
|
|
|
#define INCLUDED_CONFIGMGR_SOURCE_CHILDACCESS_HXX
|
2009-05-15 18:00:17 +02:00
|
|
|
|
2014-05-28 15:24:46 +02:00
|
|
|
#include <sal/config.h>
|
2009-05-15 18:00:17 +02:00
|
|
|
|
2015-02-15 20:41:33 +00:00
|
|
|
#include <memory>
|
2009-07-02 14:21:36 +02:00
|
|
|
#include <vector>
|
2009-05-28 10:19:30 +02:00
|
|
|
|
2014-05-28 15:24:46 +02:00
|
|
|
#include <com/sun/star/container/XChild.hpp>
|
|
|
|
#include <com/sun/star/lang/NoSupportException.hpp>
|
|
|
|
#include <com/sun/star/lang/XUnoTunnel.hpp>
|
|
|
|
#include <com/sun/star/uno/Reference.hxx>
|
|
|
|
#include <com/sun/star/uno/RuntimeException.hpp>
|
|
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
|
|
|
#include <rtl/ref.hxx>
|
|
|
|
#include <sal/types.h>
|
2009-05-15 18:00:17 +02:00
|
|
|
|
|
|
|
#include "access.hxx"
|
|
|
|
|
2009-06-24 16:10:18 +02:00
|
|
|
namespace com { namespace sun { namespace star { namespace uno {
|
|
|
|
class Any;
|
2009-09-22 10:36:09 +02:00
|
|
|
class Type;
|
2009-06-24 16:10:18 +02:00
|
|
|
class XInterface;
|
|
|
|
} } } }
|
2009-05-20 17:20:08 +02:00
|
|
|
|
2009-05-15 18:00:17 +02:00
|
|
|
namespace configmgr {
|
|
|
|
|
2009-09-23 17:48:27 +02:00
|
|
|
class Components;
|
|
|
|
class Modifications;
|
2009-05-15 18:00:17 +02:00
|
|
|
class Node;
|
|
|
|
class RootAccess;
|
|
|
|
|
2009-05-18 15:03:21 +02:00
|
|
|
class ChildAccess:
|
2015-07-27 10:59:23 +02:00
|
|
|
public Access, public css::container::XChild,
|
|
|
|
public css::lang::XUnoTunnel
|
2009-05-18 15:03:21 +02:00
|
|
|
{
|
2009-05-15 18:00:17 +02:00
|
|
|
public:
|
2017-12-22 14:23:16 +02:00
|
|
|
static css::uno::Sequence< sal_Int8 > const & getTunnelId();
|
2009-05-15 18:00:17 +02:00
|
|
|
|
2009-05-20 13:33:52 +02:00
|
|
|
ChildAccess(
|
2009-09-23 17:48:27 +02:00
|
|
|
Components & components, rtl::Reference< RootAccess > const & root,
|
2012-12-10 23:06:10 +02:00
|
|
|
rtl::Reference< Access > const & parent, OUString const & name,
|
2009-05-29 15:19:40 +02:00
|
|
|
rtl::Reference< Node > const & node);
|
2009-05-20 13:33:52 +02:00
|
|
|
|
2009-05-18 15:03:21 +02:00
|
|
|
ChildAccess(
|
2009-09-23 17:48:27 +02:00
|
|
|
Components & components, rtl::Reference< RootAccess > const & root,
|
2009-05-19 17:32:24 +02:00
|
|
|
rtl::Reference< Node > const & node);
|
2009-05-18 15:03:21 +02:00
|
|
|
|
2016-03-07 19:48:23 +01:00
|
|
|
virtual std::vector<OUString> getAbsolutePath() override;
|
|
|
|
virtual std::vector<OUString> getRelativePath() override;
|
2009-09-22 17:15:42 +02:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual OUString getRelativePathRepresentation() override;
|
|
|
|
virtual rtl::Reference< Node > getNode() override;
|
2009-05-19 10:49:37 +02:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool isFinalized() override;
|
2009-07-29 15:30:40 +02:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual OUString getNameInternal() override;
|
2009-09-11 10:11:42 +02:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual rtl::Reference< RootAccess > getRootAccess() override;
|
|
|
|
virtual rtl::Reference< Access > getParentAccess() override;
|
2009-05-19 10:49:37 +02:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL acquire() throw () override;
|
|
|
|
virtual void SAL_CALL release() throw () override;
|
2009-09-22 10:36:09 +02:00
|
|
|
|
2015-07-27 10:59:23 +02:00
|
|
|
virtual css::uno::Reference< css::uno::XInterface >
|
2017-01-26 12:28:58 +01:00
|
|
|
SAL_CALL getParent() override;
|
2009-06-03 18:02:52 +02:00
|
|
|
|
|
|
|
virtual void SAL_CALL setParent(
|
2017-01-26 12:28:58 +01:00
|
|
|
css::uno::Reference< css::uno::XInterface > const &) override;
|
2009-06-03 18:02:52 +02:00
|
|
|
|
|
|
|
virtual sal_Int64 SAL_CALL getSomething(
|
2017-01-26 12:28:58 +01:00
|
|
|
css::uno::Sequence< sal_Int8 > const & aIdentifier) override;
|
2009-06-03 18:02:52 +02:00
|
|
|
|
2009-05-29 15:19:40 +02:00
|
|
|
void bind(
|
|
|
|
rtl::Reference< RootAccess > const & root,
|
2012-12-10 23:06:10 +02:00
|
|
|
rtl::Reference< Access > const & parent, OUString const & name)
|
2009-06-04 17:06:02 +02:00
|
|
|
throw ();
|
2009-05-20 13:33:52 +02:00
|
|
|
|
|
|
|
void unbind() throw ();
|
2009-05-15 18:00:17 +02:00
|
|
|
|
2014-01-24 16:32:25 +01:00
|
|
|
bool isInTransaction() const { return inTransaction_; }
|
2009-07-23 12:42:37 +02:00
|
|
|
void committed();
|
2009-06-24 16:10:18 +02:00
|
|
|
void setNode(rtl::Reference< Node > const & node);
|
2009-05-28 10:19:30 +02:00
|
|
|
|
2009-09-21 13:14:11 +02:00
|
|
|
void setProperty(
|
2015-07-27 10:59:23 +02:00
|
|
|
css::uno::Any const & value,
|
2009-09-21 13:14:11 +02:00
|
|
|
Modifications * localModifications);
|
2009-05-28 10:19:30 +02:00
|
|
|
|
2014-06-28 14:18:32 +01:00
|
|
|
css::uno::Any asValue();
|
|
|
|
static bool asSimpleValue(const rtl::Reference< Node > &rNode,
|
|
|
|
css::uno::Any &value,
|
|
|
|
Components &components);
|
2009-05-20 17:20:08 +02:00
|
|
|
|
2009-09-21 13:14:11 +02:00
|
|
|
void commitChanges(bool valid, Modifications * globalModifications);
|
2009-06-24 16:10:18 +02:00
|
|
|
|
2009-05-15 18:00:17 +02:00
|
|
|
private:
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~ChildAccess() override;
|
2009-05-18 15:03:21 +02:00
|
|
|
|
2009-10-09 15:34:20 +02:00
|
|
|
virtual void addTypes(
|
2015-10-12 16:04:04 +02:00
|
|
|
std::vector< css::uno::Type > * types) const override;
|
2009-10-09 15:34:20 +02:00
|
|
|
|
2009-07-02 14:21:36 +02:00
|
|
|
virtual void addSupportedServiceNames(
|
2016-03-07 19:48:23 +01:00
|
|
|
std::vector<OUString> * services) override;
|
2009-07-02 14:21:36 +02:00
|
|
|
|
2015-07-27 10:59:23 +02:00
|
|
|
virtual css::uno::Any SAL_CALL queryInterface(
|
2017-01-26 12:28:58 +01:00
|
|
|
css::uno::Type const & aType) override;
|
2009-09-22 10:36:09 +02:00
|
|
|
|
2014-01-24 16:32:25 +01:00
|
|
|
rtl::Reference< RootAccess > root_;
|
|
|
|
rtl::Reference< Access > parent_; // null if free node
|
|
|
|
OUString name_;
|
|
|
|
rtl::Reference< Node > node_;
|
2015-07-27 10:59:23 +02:00
|
|
|
std::unique_ptr< css::uno::Any > changedValue_;
|
2014-01-24 16:32:25 +01:00
|
|
|
bool inTransaction_;
|
2009-06-24 16:10:18 +02:00
|
|
|
// to determine if a free node can be inserted underneath some root
|
2015-02-15 20:41:33 +00:00
|
|
|
std::shared_ptr<osl::Mutex> lock_;
|
2009-05-15 18:00:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|