2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* $RCSfile: unonrule.hxx,v $
|
|
|
|
*
|
2000-11-02 15:06:24 +00:00
|
|
|
* $Revision: 1.3 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2000-11-02 15:06:24 +00:00
|
|
|
* last change: $Author: cl $ $Date: 2000-11-02 16:06:24 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
* The Contents of this file are made available subject to the terms of
|
|
|
|
* either of the following licenses
|
|
|
|
*
|
|
|
|
* - GNU Lesser General Public License Version 2.1
|
|
|
|
* - Sun Industry Standards Source License Version 1.1
|
|
|
|
*
|
|
|
|
* Sun Microsystems Inc., October, 2000
|
|
|
|
*
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2000 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library 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 for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Sun Industry Standards Source License Version 1.1
|
|
|
|
* =================================================
|
|
|
|
* The contents of this file are subject to the Sun Industry Standards
|
|
|
|
* Source License Version 1.1 (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.openoffice.org/license.html.
|
|
|
|
*
|
|
|
|
* Software provided under this License is provided on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
|
|
|
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
|
|
|
|
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
|
|
|
|
* See the License for the specific provisions governing your rights and
|
|
|
|
* obligations concerning the Software.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* Copyright: 2000 by Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): _______________________________________
|
|
|
|
*
|
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef _SVX_UNONRULE_HXX
|
|
|
|
#define _SVX_UNONRULE_HXX
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUES_HPP_
|
|
|
|
#include <com/sun/star/beans/PropertyValues.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
|
|
|
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATE_HPP_
|
|
|
|
#include <com/sun/star/beans/PropertyState.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertySetInfo.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XMULTIPROPERTYSET_HPP_
|
|
|
|
#include <com/sun/star/beans/XMultiPropertySet.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XFASTPROPERTYSET_HPP_
|
|
|
|
#include <com/sun/star/beans/XFastPropertySet.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XVETOABLECHANGELISTENER_HPP_
|
|
|
|
#include <com/sun/star/beans/XVetoableChangeListener.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertyState.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATECHANGELISTENER_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertyStateChangeListener.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
|
|
|
|
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTIESCHANGELISTENER_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertiesChangeListener.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertyChangeListener.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYACCESS_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertyAccess.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCONTAINER_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertyContainer.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATECHANGEEVENT_HPP_
|
|
|
|
#include <com/sun/star/beans/PropertyStateChangeEvent.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_PROPERTYCHANGEEVENT_HPP_
|
|
|
|
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_CONTAINER_XCONTAINER_HPP_
|
|
|
|
#include <com/sun/star/container/XContainer.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_CONTAINER_XINDEXCONTAINER_HPP_
|
|
|
|
#include <com/sun/star/container/XIndexContainer.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_CONTAINER_XNAMEREPLACE_HPP_
|
|
|
|
#include <com/sun/star/container/XNameReplace.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_CONTAINER_XCONTAINERLISTENER_HPP_
|
|
|
|
#include <com/sun/star/container/XContainerListener.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_CONTAINER_XSET_HPP_
|
|
|
|
#include <com/sun/star/container/XSet.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_CONTAINER_CONTAINEREVENT_HPP_
|
|
|
|
#include <com/sun/star/container/ContainerEvent.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_CONTAINER_XINDEXREPLACE_HPP_
|
|
|
|
#include <com/sun/star/container/XIndexReplace.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
|
|
|
|
#include <com/sun/star/container/XNameContainer.hpp>
|
|
|
|
#endif
|
2000-09-28 11:35:03 +00:00
|
|
|
#ifndef _COM_SUN_STAR_CONTAINER_XNAMED_HPP_
|
|
|
|
#include <com/sun/star/container/XNamed.hpp>
|
|
|
|
#endif
|
2000-11-02 15:06:24 +00:00
|
|
|
#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
|
|
|
|
#include <com/sun/star/lang/XUnoTunnel.hpp>
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#include <unotools/servicehelper.hxx>
|
|
|
|
|
|
|
|
#ifndef _SVX_NUMITEM_HXX //autogen
|
|
|
|
#include <numitem.hxx>
|
|
|
|
#endif
|
|
|
|
|
2000-11-02 15:06:24 +00:00
|
|
|
#include <cppuhelper/implbase3.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
class SdrModel;
|
|
|
|
|
2000-11-02 15:06:24 +00:00
|
|
|
class SvxUnoNumberingRules : public ::cppu::WeakAggImplHelper3< ::com::sun::star::container::XIndexReplace, ::com::sun::star::container::XNamed, ::com::sun::star::lang::XUnoTunnel >
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
private:
|
2000-09-28 11:35:03 +00:00
|
|
|
SvxNumBulletItem* mpBulletItem;
|
|
|
|
sal_Bool mbOwnRule; // is true if we own this item, would be much nicer if we could set a refcount on items, but we can't
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
SvxUnoNumberingRules( SdrModel* pModel ) throw();
|
2000-09-28 11:35:03 +00:00
|
|
|
SvxUnoNumberingRules(SvxNumBulletItem* pBulletItem) throw();
|
2000-09-18 16:07:07 +00:00
|
|
|
virtual ~SvxUnoNumberingRules() throw();
|
|
|
|
|
|
|
|
UNO3_GETIMPLEMENTATION_DECL( SvxUnoNumberingRules )
|
|
|
|
|
|
|
|
//XIndexReplace
|
|
|
|
virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
//XIndexAccess
|
|
|
|
virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException) ;
|
|
|
|
virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
//XElementAccess
|
|
|
|
virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
2000-09-28 11:35:03 +00:00
|
|
|
// XNamed
|
|
|
|
virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
//Intern
|
|
|
|
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> getNumberingRuleByIndex( sal_Int32 nIndex ) const throw();
|
|
|
|
void setNumberingRuleByIndex( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rProperties, sal_Int32 nIndex ) throw(::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException );
|
|
|
|
|
2000-09-28 11:35:03 +00:00
|
|
|
sal_Bool isInserted() const { return !mbOwnRule; }
|
|
|
|
void invalidate() { mpBulletItem = NULL; mbOwnRule = sal_False; }
|
|
|
|
|
|
|
|
SvxNumRule* GetNumRule() const throw() { return mpBulletItem ? mpBulletItem->GetNumRule() : NULL; }
|
|
|
|
|
|
|
|
// WARNING: Calling this method while isInserted() returns sal_False will make you
|
|
|
|
// the owner of this SvxNumBulletItem and isInserted will become sal_True;
|
|
|
|
SvxNumBulletItem* GetNumBulletItem() throw() { if( mbOwnRule ) mbOwnRule = sal_False; return mpBulletItem; }
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|