2009-05-15 11:00:17 -05:00
|
|
|
/*************************************************************************
|
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* Copyright 2009 by Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
|
|
|
*
|
|
|
|
* $RCSfile: code,v $
|
|
|
|
*
|
|
|
|
* $Revision: 1.4 $
|
|
|
|
*
|
|
|
|
* This file is part of OpenOffice.org.
|
|
|
|
*
|
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef INCLUDED_CONFIGMGR_CHILDACCESS_HXX
|
|
|
|
#define INCLUDED_CONFIGMGR_CHILDACCESS_HXX
|
|
|
|
|
|
|
|
#include "sal/config.h"
|
|
|
|
|
2009-06-04 11:08:16 -05:00
|
|
|
#include <memory>
|
2009-07-02 07:21:36 -05:00
|
|
|
#include <vector>
|
2009-05-28 03:19:30 -05:00
|
|
|
|
2009-05-26 10:25:36 -05:00
|
|
|
#include "com/sun/star/container/XChild.hpp"
|
|
|
|
#include "com/sun/star/lang/NoSupportException.hpp"
|
2009-05-18 08:03:21 -05:00
|
|
|
#include "com/sun/star/lang/XUnoTunnel.hpp"
|
2009-05-26 10:25:36 -05:00
|
|
|
#include "com/sun/star/uno/Reference.hxx"
|
2009-05-18 08:03:21 -05:00
|
|
|
#include "com/sun/star/uno/RuntimeException.hpp"
|
|
|
|
#include "com/sun/star/uno/Sequence.hxx"
|
2009-05-26 10:25:36 -05:00
|
|
|
#include "cppuhelper/implbase2.hxx"
|
2009-05-29 08:19:40 -05:00
|
|
|
#include "osl/interlck.h"
|
2009-05-15 11:00:17 -05:00
|
|
|
#include "rtl/ref.hxx"
|
2009-05-18 08:03:21 -05:00
|
|
|
#include "sal/types.h"
|
2009-05-15 11:00:17 -05:00
|
|
|
|
|
|
|
#include "access.hxx"
|
|
|
|
|
2009-06-24 09:10:18 -05:00
|
|
|
namespace com { namespace sun { namespace star { namespace uno {
|
|
|
|
class Any;
|
|
|
|
class XInterface;
|
|
|
|
} } } }
|
2009-05-20 10:20:08 -05:00
|
|
|
|
2009-05-15 11:00:17 -05:00
|
|
|
namespace configmgr {
|
|
|
|
|
|
|
|
class Node;
|
|
|
|
class RootAccess;
|
|
|
|
|
2009-05-18 08:03:21 -05:00
|
|
|
class ChildAccess:
|
2009-05-26 10:25:36 -05:00
|
|
|
public cppu::ImplInheritanceHelper2<
|
|
|
|
Access, com::sun::star::container::XChild,
|
|
|
|
com::sun::star::lang::XUnoTunnel >
|
2009-05-18 08:03:21 -05:00
|
|
|
{
|
2009-05-15 11:00:17 -05:00
|
|
|
public:
|
2009-05-18 08:03:21 -05:00
|
|
|
static com::sun::star::uno::Sequence< sal_Int8 > getTunnelId();
|
2009-05-15 11:00:17 -05:00
|
|
|
|
2009-05-20 06:33:52 -05:00
|
|
|
ChildAccess(
|
2009-05-29 08:19:40 -05:00
|
|
|
rtl::Reference< RootAccess > const & root,
|
2009-05-29 09:48:52 -05:00
|
|
|
rtl::Reference< Access > const & parent, rtl::OUString const & name,
|
2009-05-29 08:19:40 -05:00
|
|
|
rtl::Reference< Node > const & node);
|
2009-05-20 06:33:52 -05:00
|
|
|
|
2009-05-18 08:03:21 -05:00
|
|
|
ChildAccess(
|
2009-05-19 03:49:37 -05:00
|
|
|
rtl::Reference< RootAccess > const & root,
|
2009-05-19 10:32:24 -05:00
|
|
|
rtl::Reference< Node > const & node);
|
2009-05-18 08:03:21 -05:00
|
|
|
|
2009-07-13 10:15:58 -05:00
|
|
|
virtual rtl::OUString getPath();
|
|
|
|
|
2009-05-19 03:49:37 -05:00
|
|
|
virtual rtl::Reference< Node > getNode();
|
|
|
|
|
2009-06-04 03:46:43 -05:00
|
|
|
virtual rtl::Reference< RootAccess > getRootAccess();
|
|
|
|
|
|
|
|
virtual rtl::Reference< Access > getParentAccess();
|
2009-05-19 03:49:37 -05:00
|
|
|
|
2009-06-03 11:02:52 -05:00
|
|
|
virtual rtl::OUString SAL_CALL getName()
|
|
|
|
throw (com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
|
|
|
|
SAL_CALL getParent()
|
|
|
|
throw (com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
virtual void SAL_CALL setParent(
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
|
|
|
|
const &)
|
|
|
|
throw (
|
|
|
|
com::sun::star::lang::NoSupportException,
|
|
|
|
com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
virtual sal_Int64 SAL_CALL getSomething(
|
|
|
|
com::sun::star::uno::Sequence< sal_Int8 > const & aIdentifier)
|
|
|
|
throw (com::sun::star::uno::RuntimeException);
|
|
|
|
|
2009-05-29 08:19:40 -05:00
|
|
|
oslInterlockedCount acquireCounting();
|
|
|
|
|
|
|
|
void releaseNondeleting();
|
|
|
|
|
|
|
|
void bind(
|
|
|
|
rtl::Reference< RootAccess > const & root,
|
2009-06-04 10:06:02 -05:00
|
|
|
rtl::Reference< Access > const & parent, rtl::OUString const & name)
|
|
|
|
throw ();
|
2009-05-20 06:33:52 -05:00
|
|
|
|
|
|
|
void unbind() throw ();
|
2009-05-15 11:00:17 -05:00
|
|
|
|
2009-06-24 09:10:18 -05:00
|
|
|
void markAsModified();
|
2009-06-23 10:14:12 -05:00
|
|
|
|
2009-06-24 09:10:18 -05:00
|
|
|
bool isInTransaction() const { return inTransaction_; }
|
2009-05-26 10:25:36 -05:00
|
|
|
|
2009-06-24 09:10:18 -05:00
|
|
|
void notInTransaction() { inTransaction_ = false; }
|
2009-05-26 10:25:36 -05:00
|
|
|
|
2009-06-24 09:10:18 -05:00
|
|
|
void setNode(rtl::Reference< Node > const & node);
|
2009-05-28 03:19:30 -05:00
|
|
|
|
2009-06-24 09:10:18 -05:00
|
|
|
void setProperty(com::sun::star::uno::Any const & value);
|
2009-05-28 03:19:30 -05:00
|
|
|
|
2009-05-20 10:20:08 -05:00
|
|
|
com::sun::star::uno::Any asValue();
|
|
|
|
|
2009-06-24 09:10:18 -05:00
|
|
|
void commitChanges();
|
|
|
|
|
2009-05-15 11:00:17 -05:00
|
|
|
private:
|
2009-05-18 08:03:21 -05:00
|
|
|
virtual ~ChildAccess();
|
|
|
|
|
2009-07-02 07:21:36 -05:00
|
|
|
virtual void addSupportedServiceNames(
|
|
|
|
std::vector< rtl::OUString > * services);
|
|
|
|
|
2009-05-29 08:19:40 -05:00
|
|
|
rtl::Reference< RootAccess > root_;
|
|
|
|
rtl::Reference< Access > parent_; // null iff free node
|
2009-05-29 09:48:52 -05:00
|
|
|
rtl::OUString name_;
|
2009-05-19 10:32:24 -05:00
|
|
|
rtl::Reference< Node > node_;
|
2009-06-24 09:10:18 -05:00
|
|
|
std::auto_ptr< com::sun::star::uno::Any > changedValue_;
|
|
|
|
bool inTransaction_;
|
|
|
|
// to determine if a free node can be inserted underneath some root
|
2009-05-15 11:00:17 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|