xref: /aoo42x/main/sd/inc/stlfamily.hxx (revision c45d927a)
1*c45d927aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*c45d927aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*c45d927aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*c45d927aSAndrew Rist  * distributed with this work for additional information
6*c45d927aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*c45d927aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*c45d927aSAndrew Rist  * "License"); you may not use this file except in compliance
9*c45d927aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*c45d927aSAndrew Rist  *
11*c45d927aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*c45d927aSAndrew Rist  *
13*c45d927aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*c45d927aSAndrew Rist  * software distributed under the License is distributed on an
15*c45d927aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c45d927aSAndrew Rist  * KIND, either express or implied.  See the License for the
17*c45d927aSAndrew Rist  * specific language governing permissions and limitations
18*c45d927aSAndrew Rist  * under the License.
19*c45d927aSAndrew Rist  *
20*c45d927aSAndrew Rist  *************************************************************/
21*c45d927aSAndrew Rist 
22*c45d927aSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SD_STLFAMILY_HXX
25cdf0e10cSrcweir #define _SD_STLFAMILY_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
28cdf0e10cSrcweir #include <com/sun/star/style/XStyle.hpp>
29cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
30cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
31cdf0e10cSrcweir #include <com/sun/star/beans/XPropertyState.hpp>
32cdf0e10cSrcweir #include <com/sun/star/lang/XComponent.hpp>
33cdf0e10cSrcweir #include <com/sun/star/lang/XSingleServiceFactory.hpp>
34cdf0e10cSrcweir #include <com/sun/star/container/XIndexAccess.hpp>
35cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp>
36cdf0e10cSrcweir #include <com/sun/star/container/XNamed.hpp>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #include <rtl/ref.hxx>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir #include <cppuhelper/implbase7.hxx>
41cdf0e10cSrcweir 
42cdf0e10cSrcweir #include <svl/style.hxx>
43cdf0e10cSrcweir 
44cdf0e10cSrcweir #include <editeng/unoipset.hxx>
45cdf0e10cSrcweir 
46cdf0e10cSrcweir class SdStyleSheet;
47cdf0e10cSrcweir class SdPage;
48cdf0e10cSrcweir struct SdStyleFamilyImpl;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir namespace css = ::com::sun::star;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir class SdStyleFamily : public ::cppu::WeakImplHelper7< css::container::XNameContainer, css::container::XNamed, css::container::XIndexAccess, css::lang::XSingleServiceFactory,  css::lang::XServiceInfo, css::lang::XComponent, css::beans::XPropertySet >
53cdf0e10cSrcweir {
54cdf0e10cSrcweir public:
55cdf0e10cSrcweir 	/// creates the style family for the given SfxStyleFamily
56cdf0e10cSrcweir 	SdStyleFamily( const rtl::Reference< SfxStyleSheetPool >& xPool, SfxStyleFamily nFamily );
57cdf0e10cSrcweir 
58cdf0e10cSrcweir 	/// creates the presentation family for the given masterpage
59cdf0e10cSrcweir 	SdStyleFamily( const rtl::Reference< SfxStyleSheetPool >& xPool, const SdPage* pMasterPage );
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 	virtual ~SdStyleFamily();
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 	// XServiceInfo
64cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName() throw(css::uno::RuntimeException);
65cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(css::uno::RuntimeException);
66cdf0e10cSrcweir     virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException);
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 	// XNamed
69cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getName(  ) throw (css::uno::RuntimeException);
70cdf0e10cSrcweir     virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 	// XNameAccess
73cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException);
74cdf0e10cSrcweir     virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() throw(css::uno::RuntimeException);
75cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(css::uno::RuntimeException);
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 	// XElementAccess
78cdf0e10cSrcweir     virtual css::uno::Type SAL_CALL getElementType() throw(css::uno::RuntimeException);
79cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasElements() throw(css::uno::RuntimeException);
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 	// XIndexAccess
82cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException) ;
83cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(css::lang::IndexOutOfBoundsException, css::lang::WrappedTargetException, css::uno::RuntimeException);
84cdf0e10cSrcweir 
85cdf0e10cSrcweir 	// XNameContainer
86cdf0e10cSrcweir 	virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const css::uno::Any& aElement ) throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, css::uno::RuntimeException);
87cdf0e10cSrcweir 	virtual void SAL_CALL removeByName( const ::rtl::OUString& Name ) throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException);
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 	// XNameReplace
90cdf0e10cSrcweir     virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const css::uno::Any& aElement ) throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException);
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	// XSingleServiceFactory
93cdf0e10cSrcweir     virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(  ) throw(css::uno::Exception, css::uno::RuntimeException);
94cdf0e10cSrcweir     virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const css::uno::Sequence< css::uno::Any >& aArguments ) throw(css::uno::Exception, css::uno::RuntimeException);
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	// XComponent
97cdf0e10cSrcweir     virtual void SAL_CALL dispose(  ) throw (css::uno::RuntimeException);
98cdf0e10cSrcweir     virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw (css::uno::RuntimeException);
99cdf0e10cSrcweir     virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) throw (css::uno::RuntimeException);
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     // XPropertySet
102cdf0e10cSrcweir 	virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw (css::uno::RuntimeException);
103cdf0e10cSrcweir 	virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw (css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException);
104cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
105cdf0e10cSrcweir 	virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference<css::beans::XPropertyChangeListener>& xListener ) throw (css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
106cdf0e10cSrcweir 	virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference<css::beans::XPropertyChangeListener>& aListener ) throw (css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
107cdf0e10cSrcweir     virtual void SAL_CALL addVetoableChangeListener(const ::rtl::OUString& PropertyName, const css::uno::Reference<css::beans::XVetoableChangeListener>& aListener ) throw (css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
108cdf0e10cSrcweir     virtual void SAL_CALL removeVetoableChangeListener(const ::rtl::OUString& PropertyName,const css::uno::Reference<css::beans::XVetoableChangeListener>&aListener ) throw (css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
109cdf0e10cSrcweir 
110cdf0e10cSrcweir private:
111cdf0e10cSrcweir 	void throwIfDisposed() const throw(css::uno::RuntimeException);
112cdf0e10cSrcweir 	SdStyleSheet* GetValidNewSheet( const css::uno::Any& rElement ) throw(css::lang::IllegalArgumentException);
113cdf0e10cSrcweir 	SdStyleSheet* GetSheetByName( const ::rtl::OUString& rName ) throw(css::container::NoSuchElementException, css::lang::WrappedTargetException );
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 	SfxStyleFamily mnFamily;
116cdf0e10cSrcweir 	rtl::Reference< SfxStyleSheetPool > mxPool;
117cdf0e10cSrcweir 	SdStyleFamilyImpl*	mpImpl;
118cdf0e10cSrcweir };
119cdf0e10cSrcweir 
120cdf0e10cSrcweir typedef rtl::Reference< SdStyleFamily > SdStyleFamilyRef;
121cdf0e10cSrcweir 
122cdf0e10cSrcweir #endif	   // _SD_STLFAMILY_HXX
123