Version 7.1.7.1, tag libreoffice-7.1.7.1
[LibreOffice.git] / svx / source / unodraw / UnoNameItemTable.hxx
blob1bb0b8276bbab791888e61f1890ec67b2d214768
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_SVX_SOURCE_UNODRAW_UNONAMEITEMTABLE_HXX
21 #define INCLUDED_SVX_SOURCE_UNODRAW_UNONAMEITEMTABLE_HXX
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/container/XNameContainer.hpp>
26 #include <cppuhelper/implbase.hxx>
28 #include <memory>
29 #include <vector>
30 #include <svl/lstner.hxx>
31 #include <svx/xit.hxx>
33 class SdrModel;
34 class SfxItemPool;
35 class SfxItemSet;
37 typedef std::vector< std::unique_ptr< SfxItemSet > > ItemPoolVector;
38 class SvxUnoNameItemTable : public cppu::WeakImplHelper< css::container::XNameContainer, css::lang::XServiceInfo >,
39 public SfxListener
41 private:
42 SdrModel* mpModel;
43 SfxItemPool* mpModelPool;
44 sal_uInt16 mnWhich;
45 sal_uInt8 mnMemberId;
47 ItemPoolVector maItemSetVector;
49 void ImplInsertByName( const OUString& aName, const css::uno::Any& aElement );
51 public:
52 SvxUnoNameItemTable( SdrModel* pModel, sal_uInt16 nWhich, sal_uInt8 nMemberId ) throw();
53 virtual ~SvxUnoNameItemTable() throw() override;
55 virtual NameOrIndex* createItem() const = 0;
56 virtual bool isValid( const NameOrIndex* pItem ) const;
58 void dispose();
60 // SfxListener
61 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) throw () override;
63 // XServiceInfo
64 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
66 // XNameContainer
67 virtual void SAL_CALL insertByName( const OUString& aName, const css::uno::Any& aElement ) override;
68 virtual void SAL_CALL removeByName( const OUString& Name ) override;
70 // XNameReplace
71 virtual void SAL_CALL replaceByName( const OUString& aName, const css::uno::Any& aElement ) override;
73 // XNameAccess
74 virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
75 virtual css::uno::Sequence< OUString > SAL_CALL getElementNames( ) override;
76 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
78 // XElementAccess
79 virtual sal_Bool SAL_CALL hasElements( ) override;
82 #endif // INCLUDED_SVX_SOURCE_UNODRAW_UNONAMEITEMTABLE_HXX
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */