bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / inc / stlfamily.hxx
blobfbaa825505cce2316ecc72190d985d3d71ac7169
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SD_INC_STLFAMILY_HXX
21 #define INCLUDED_SD_INC_STLFAMILY_HXX
23 #include <memory>
24 #include <com/sun/star/uno/Any.hxx>
25 #include <com/sun/star/beans/XPropertySet.hpp>
26 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <com/sun/star/lang/XComponent.hpp>
28 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
29 #include <com/sun/star/container/XIndexAccess.hpp>
30 #include <com/sun/star/container/XNameContainer.hpp>
31 #include <com/sun/star/container/XNamed.hpp>
33 #include <rtl/ref.hxx>
35 #include <cppuhelper/implbase.hxx>
37 #include <svl/style.hxx>
39 class SdStyleSheet;
40 class SdPage;
41 struct SdStyleFamilyImpl;
43 class SdStyleFamily : public ::cppu::WeakImplHelper< css::container::XNameContainer, css::container::XNamed, css::container::XIndexAccess, css::lang::XSingleServiceFactory, css::lang::XServiceInfo, css::lang::XComponent, css::beans::XPropertySet >
45 public:
46 /// creates the style family for the given SfxStyleFamily
47 SdStyleFamily( const rtl::Reference< SfxStyleSheetPool >& xPool, SfxStyleFamily nFamily );
49 /// creates the presentation family for the given masterpage
50 SdStyleFamily( const rtl::Reference< SfxStyleSheetPool >& xPool, const SdPage* pMasterPage );
52 virtual ~SdStyleFamily() override;
54 // XServiceInfo
55 virtual OUString SAL_CALL getImplementationName() override;
56 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
57 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
59 // XNamed
60 virtual OUString SAL_CALL getName( ) override;
61 virtual void SAL_CALL setName( const OUString& aName ) override;
63 // XNameAccess
64 virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
65 virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
66 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
68 // XElementAccess
69 virtual css::uno::Type SAL_CALL getElementType() override;
70 virtual sal_Bool SAL_CALL hasElements() override;
72 // XIndexAccess
73 virtual sal_Int32 SAL_CALL getCount() override ;
74 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
76 // XNameContainer
77 virtual void SAL_CALL insertByName( const OUString& aName, const css::uno::Any& aElement ) override;
78 virtual void SAL_CALL removeByName( const OUString& Name ) override;
80 // XNameReplace
81 virtual void SAL_CALL replaceByName( const OUString& aName, const css::uno::Any& aElement ) override;
83 // XSingleServiceFactory
84 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( ) override;
85 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
87 // XComponent
88 virtual void SAL_CALL dispose( ) override;
89 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
90 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
92 // XPropertySet
93 virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override;
94 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
95 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
96 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference<css::beans::XPropertyChangeListener>& xListener ) override;
97 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference<css::beans::XPropertyChangeListener>& aListener ) override;
98 virtual void SAL_CALL addVetoableChangeListener(const OUString& PropertyName, const css::uno::Reference<css::beans::XVetoableChangeListener>& aListener ) override;
99 virtual void SAL_CALL removeVetoableChangeListener(const OUString& PropertyName,const css::uno::Reference<css::beans::XVetoableChangeListener>&aListener ) override;
101 private:
102 /// @throws css::uno::RuntimeException
103 void throwIfDisposed() const;
104 /// @throws css::lang::IllegalArgumentException
105 SdStyleSheet* GetValidNewSheet( const css::uno::Any& rElement );
106 /// @throws css::container::NoSuchElementException
107 /// @throws css::lang::WrappedTargetException
108 SdStyleSheet* GetSheetByName( const OUString& rName );
110 SfxStyleFamily mnFamily;
111 rtl::Reference< SfxStyleSheetPool > mxPool;
112 std::unique_ptr<SdStyleFamilyImpl> mpImpl;
115 typedef rtl::Reference< SdStyleFamily > SdStyleFamilyRef;
117 #endif // INCLUDED_SD_INC_STLFAMILY_HXX
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */