cid#1636693 COPY_INSTEAD_OF_MOVE
[LibreOffice.git] / reportdesign / source / core / inc / Groups.hxx
blobd025248885808384ee8cbd5fe091f108f0dbe575
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 .
19 #ifndef INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_GROUPS_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_GROUPS_HXX
22 #include <com/sun/star/report/XGroups.hpp>
23 #include <cppuhelper/compbase.hxx>
24 #include <cppuhelper/basemutex.hxx>
25 #include <comphelper/interfacecontainer3.hxx>
26 #include <unotools/weakref.hxx>
27 #include <com/sun/star/uno/XComponentContext.hpp>
28 #include <vector>
31 namespace reportdesign
33 class OReportDefinition;
35 typedef ::cppu::WeakComponentImplHelper< css::report::XGroups> GroupsBase;
36 /** \class OGroups Defines the implementation of a \interface com:::sun::star::report::XGroups
37 * \ingroup reportdesign_api
40 class OGroups : public cppu::BaseMutex,
41 public GroupsBase
43 typedef ::std::vector< css::uno::Reference< css::report::XGroup > > TGroups;
44 ::comphelper::OInterfaceContainerHelper3<css::container::XContainerListener> m_aContainerListeners;
45 css::uno::Reference< css::uno::XComponentContext > m_xContext;
46 unotools::WeakReference< OReportDefinition > m_xParent;
47 TGroups m_aGroups;
48 private:
49 OGroups& operator=(const OGroups&) = delete;
50 OGroups(const OGroups&) = delete;
51 void checkIndex(sal_Int32 _nIndex);
52 protected:
53 // TODO: VirtualFunctionFinder: This is virtual function!
55 virtual ~OGroups() override;
57 /** this function is called upon disposing the component
59 // TODO: VirtualFunctionFinder: This is virtual function!
61 virtual void SAL_CALL disposing() override;
62 public:
63 OGroups( const rtl::Reference< OReportDefinition >& _xParent
64 ,css::uno::Reference< css::uno::XComponentContext > context);
66 // XGroups
67 // Attributes
68 virtual css::uno::Reference< css::report::XReportDefinition > SAL_CALL getReportDefinition() override;
69 // Methods
70 virtual css::uno::Reference< css::report::XGroup > SAL_CALL createGroup( ) override;
71 // XIndexContainer
72 virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const css::uno::Any& Element ) override;
73 virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) override;
74 // XIndexReplace
75 virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const css::uno::Any& Element ) override;
76 // XIndexAccess
77 virtual ::sal_Int32 SAL_CALL getCount( ) override;
78 virtual css::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) override;
79 // XElementAccess
80 virtual css::uno::Type SAL_CALL getElementType( ) override;
81 virtual sal_Bool SAL_CALL hasElements( ) override;
82 // XChild
83 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
84 virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
85 // XContainer
86 virtual void SAL_CALL addContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
87 virtual void SAL_CALL removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
89 // XComponent
90 virtual void SAL_CALL dispose() override;
91 virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
93 cppu::WeakComponentImplHelperBase::addEventListener(aListener);
95 virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
97 cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
101 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_GROUPS_HXX
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */