LibreOffice Module svx (master)  1
UnoNameItemTable.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SVX_SOURCE_UNODRAW_UNONAMEITEMTABLE_HXX
21 #define INCLUDED_SVX_SOURCE_UNODRAW_UNONAMEITEMTABLE_HXX
22 
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/container/XNameContainer.hpp>
25 
26 #include <cppuhelper/implbase.hxx>
27 
28 #include <memory>
29 #include <vector>
30 #include <svl/lstner.hxx>
31 #include <svx/xit.hxx>
32 
33 class SdrModel;
34 class SfxItemPool;
35 class SfxItemSet;
36 
37 typedef std::vector< std::unique_ptr< SfxItemSet > > ItemPoolVector;
38 class SvxUnoNameItemTable : public cppu::WeakImplHelper< css::container::XNameContainer, css::lang::XServiceInfo >,
39  public SfxListener
40 {
41 private:
44  sal_uInt16 mnWhich;
46 
48 
49  void ImplInsertByName( const OUString& aName, const css::uno::Any& aElement );
50 
51 public:
52  SvxUnoNameItemTable( SdrModel* pModel, sal_uInt16 nWhich, sal_uInt8 nMemberId ) throw();
53  virtual ~SvxUnoNameItemTable() throw() override;
54 
55  virtual NameOrIndex* createItem() const = 0;
56  virtual bool isValid( const NameOrIndex* pItem ) const;
57 
58  void dispose();
59 
60  // SfxListener
61  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) throw () override;
62 
63  // XServiceInfo
64  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
65 
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;
69 
70  // XNameReplace
71  virtual void SAL_CALL replaceByName( const OUString& aName, const css::uno::Any& aElement ) override;
72 
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;
77 
78  // XElementAccess
79  virtual sal_Bool SAL_CALL hasElements( ) override;
80 };
81 
82 #endif // INCLUDED_SVX_SOURCE_UNODRAW_UNONAMEITEMTABLE_HXX
83 
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxItemPool * mpModelPool
virtual NameOrIndex * createItem() const =0
virtual void SAL_CALL insertByName(const OUString &aName, const css::uno::Any &aElement) override
ItemPoolVector maItemSetVector
virtual bool isValid(const NameOrIndex *pItem) const
virtual void SAL_CALL removeByName(const OUString &Name) override
void ImplInsertByName(const OUString &aName, const css::uno::Any &aElement)
std::vector< std::unique_ptr< SfxItemSet > > ItemPoolVector
Definition: unomtabl.cxx:50
virtual void SAL_CALL replaceByName(const OUString &aName, const css::uno::Any &aElement) override
std::vector< std::unique_ptr< SfxItemSet > > ItemPoolVector
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
SvxUnoNameItemTable(SdrModel *pModel, sal_uInt16 nWhich, sal_uInt8 nMemberId)
unsigned char sal_Bool
virtual ~SvxUnoNameItemTable() override
virtual sal_Bool SAL_CALL hasElements() override
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
unsigned char sal_uInt8
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override