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 14:06:56 +02:00
|
|
|
|
2009-09-08 14:59:07 +02:00
|
|
|
#ifndef INCLUDED_CONFIGMGR_SOURCE_ROOTACCESS_HXX
|
|
|
|
#define INCLUDED_CONFIGMGR_SOURCE_ROOTACCESS_HXX
|
2009-05-15 14:06:56 +02:00
|
|
|
|
2014-05-28 15:24:46 +02:00
|
|
|
#include <sal/config.h>
|
2009-05-15 14:06:56 +02:00
|
|
|
|
2015-02-15 20:41:33 +00:00
|
|
|
#include <memory>
|
2009-09-22 10:36:09 +02:00
|
|
|
#include <set>
|
2009-10-09 15:34:20 +02:00
|
|
|
#include <vector>
|
2009-09-22 10:36:09 +02:00
|
|
|
|
2014-05-28 15:24:46 +02:00
|
|
|
#include <com/sun/star/lang/WrappedTargetException.hpp>
|
|
|
|
#include <com/sun/star/uno/RuntimeException.hpp>
|
|
|
|
#include <com/sun/star/util/ChangesSet.hpp>
|
|
|
|
#include <com/sun/star/util/XChangesBatch.hpp>
|
|
|
|
#include <com/sun/star/util/XChangesNotifier.hpp>
|
|
|
|
#include <rtl/ref.hxx>
|
|
|
|
#include <rtl/ustring.hxx>
|
|
|
|
#include <sal/types.h>
|
2009-05-15 14:06:56 +02:00
|
|
|
|
|
|
|
#include "access.hxx"
|
2009-09-23 17:48:27 +02:00
|
|
|
#include "modifications.hxx"
|
2009-09-22 17:15:42 +02:00
|
|
|
#include "path.hxx"
|
2009-05-15 14:06:56 +02:00
|
|
|
|
2009-07-02 14:21:36 +02:00
|
|
|
namespace com { namespace sun { namespace star {
|
|
|
|
namespace uno {
|
|
|
|
class Any;
|
|
|
|
class Type;
|
|
|
|
}
|
|
|
|
namespace util { class XChangesListener; }
|
|
|
|
} } }
|
2009-05-26 17:25:36 +02:00
|
|
|
|
2009-05-15 14:06:56 +02:00
|
|
|
namespace configmgr {
|
|
|
|
|
2009-09-22 10:36:09 +02:00
|
|
|
class Broadcaster;
|
2009-09-23 17:48:27 +02:00
|
|
|
class Components;
|
2009-05-15 14:06:56 +02:00
|
|
|
class Node;
|
|
|
|
|
2009-09-22 10:36:09 +02:00
|
|
|
class RootAccess:
|
|
|
|
public Access, public com::sun::star::util::XChangesNotifier,
|
|
|
|
public com::sun::star::util::XChangesBatch
|
|
|
|
{
|
2009-05-15 14:06:56 +02:00
|
|
|
public:
|
2009-05-19 10:49:37 +02:00
|
|
|
RootAccess(
|
2012-12-10 23:06:10 +02:00
|
|
|
Components & components, OUString const & pathRepresenation,
|
|
|
|
OUString const & locale, bool update);
|
2009-05-15 14:06:56 +02:00
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual Path getAbsolutePath() SAL_OVERRIDE;
|
2009-09-23 16:07:30 +02:00
|
|
|
|
2009-10-15 16:31:42 +02:00
|
|
|
virtual void initBroadcaster(
|
2014-03-26 16:37:00 +01:00
|
|
|
Modifications::Node const & modifications, Broadcaster * broadcaster) SAL_OVERRIDE;
|
2009-10-15 16:31:42 +02:00
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual void SAL_CALL acquire() throw () SAL_OVERRIDE;
|
2009-09-22 10:36:09 +02:00
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual void SAL_CALL release() throw () SAL_OVERRIDE;
|
2009-09-22 10:36:09 +02:00
|
|
|
|
2012-12-10 23:06:10 +02:00
|
|
|
OUString getAbsolutePathRepresentation();
|
2010-04-16 11:36:30 +02:00
|
|
|
|
2014-06-12 14:06:28 +02:00
|
|
|
OUString getLocale() const { return locale_;}
|
2009-05-15 14:06:56 +02:00
|
|
|
|
2014-06-09 10:09:42 +02:00
|
|
|
bool isUpdate() const { return update_;}
|
2009-05-19 10:49:37 +02:00
|
|
|
|
2011-08-31 00:37:22 -04:00
|
|
|
void setAlive(bool b);
|
|
|
|
|
2011-12-13 12:37:00 +01:00
|
|
|
virtual void SAL_CALL addChangesListener(
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
|
|
|
|
const & aListener)
|
2014-03-26 16:37:00 +01:00
|
|
|
throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2011-02-07 18:52:27 +01:00
|
|
|
|
2011-12-13 12:37:00 +01:00
|
|
|
virtual void SAL_CALL removeChangesListener(
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
|
|
|
|
const & aListener)
|
2014-03-26 16:37:00 +01:00
|
|
|
throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2011-12-13 12:37:00 +01:00
|
|
|
|
|
|
|
virtual void SAL_CALL commitChanges()
|
|
|
|
throw (
|
|
|
|
com::sun::star::lang::WrappedTargetException,
|
2014-01-27 15:35:34 +00:00
|
|
|
com::sun::star::uno::RuntimeException,
|
2014-03-26 16:37:00 +01:00
|
|
|
std::exception) SAL_OVERRIDE;
|
2011-12-13 12:37:00 +01:00
|
|
|
|
|
|
|
virtual sal_Bool SAL_CALL hasPendingChanges()
|
2014-03-26 16:37:00 +01:00
|
|
|
throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2011-12-13 12:37:00 +01:00
|
|
|
|
|
|
|
virtual com::sun::star::util::ChangesSet SAL_CALL getPendingChanges()
|
2014-03-26 16:37:00 +01:00
|
|
|
throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2011-02-07 18:52:27 +01:00
|
|
|
|
2009-05-15 14:06:56 +02:00
|
|
|
private:
|
|
|
|
virtual ~RootAccess();
|
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual Path getRelativePath() SAL_OVERRIDE;
|
2009-09-22 17:15:42 +02:00
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual OUString getRelativePathRepresentation() SAL_OVERRIDE;
|
2009-07-13 17:15:58 +02:00
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual rtl::Reference< Node > getNode() SAL_OVERRIDE;
|
2009-05-15 14:06:56 +02:00
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual bool isFinalized() SAL_OVERRIDE;
|
2009-07-29 15:30:40 +02:00
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual OUString getNameInternal() SAL_OVERRIDE;
|
2009-09-11 10:11:42 +02:00
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual rtl::Reference< RootAccess > getRootAccess() SAL_OVERRIDE;
|
2009-06-04 10:46:43 +02:00
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual rtl::Reference< Access > getParentAccess() SAL_OVERRIDE;
|
2009-05-15 18:00:17 +02:00
|
|
|
|
2009-10-09 15:34:20 +02:00
|
|
|
virtual void addTypes(std::vector< com::sun::star::uno::Type > * types)
|
2014-03-26 16:37:00 +01:00
|
|
|
const SAL_OVERRIDE;
|
2009-10-09 15:34:20 +02:00
|
|
|
|
2009-07-02 14:21:36 +02:00
|
|
|
virtual void addSupportedServiceNames(
|
2014-03-26 16:37:00 +01:00
|
|
|
std::vector< OUString > * services) SAL_OVERRIDE;
|
2009-07-02 14:21:36 +02:00
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual void initDisposeBroadcaster(Broadcaster * broadcaster) SAL_OVERRIDE;
|
2009-09-22 10:36:09 +02:00
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual void clearListeners() throw () SAL_OVERRIDE;
|
2009-09-22 17:15:42 +02:00
|
|
|
|
2009-07-02 14:21:36 +02:00
|
|
|
virtual com::sun::star::uno::Any SAL_CALL queryInterface(
|
|
|
|
com::sun::star::uno::Type const & aType)
|
2014-03-26 16:37:00 +01:00
|
|
|
throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2009-05-29 16:48:52 +02:00
|
|
|
|
2012-12-10 23:06:10 +02:00
|
|
|
virtual OUString SAL_CALL getImplementationName()
|
2014-03-26 16:37:00 +01:00
|
|
|
throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2009-05-26 17:25:36 +02:00
|
|
|
|
2009-09-22 10:36:09 +02:00
|
|
|
typedef
|
|
|
|
std::multiset<
|
|
|
|
com::sun::star::uno::Reference<
|
|
|
|
com::sun::star::util::XChangesListener > >
|
|
|
|
ChangesListeners;
|
|
|
|
|
2012-12-10 23:06:10 +02:00
|
|
|
OUString pathRepresentation_;
|
|
|
|
OUString locale_;
|
2009-09-22 17:15:42 +02:00
|
|
|
Path path_;
|
2009-05-19 17:32:24 +02:00
|
|
|
rtl::Reference< Node > node_;
|
2012-12-10 23:06:10 +02:00
|
|
|
OUString name_;
|
2009-09-22 10:36:09 +02:00
|
|
|
ChangesListeners changesListeners_;
|
2010-11-25 20:36:03 +00:00
|
|
|
|
2015-02-15 20:41:33 +00:00
|
|
|
std::shared_ptr<osl::Mutex> lock_;
|
2011-08-31 00:37:22 -04:00
|
|
|
|
|
|
|
bool update_:1;
|
|
|
|
bool finalized_:1;
|
|
|
|
bool alive_:1;
|
2009-05-15 14:06:56 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|