LibreOffice Module reportdesign (master)  1
Groups.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 #ifndef INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_GROUPS_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_GROUPS_HXX
21 
22 #include <com/sun/star/report/XGroups.hpp>
23 #include <cppuhelper/compbase.hxx>
24 #include <cppuhelper/basemutex.hxx>
26 #include <com/sun/star/uno/XComponentContext.hpp>
27 #include <vector>
28 
29 
30 namespace reportdesign
31 {
32  typedef ::cppu::WeakComponentImplHelper< css::report::XGroups> GroupsBase;
37  class OGroups : public cppu::BaseMutex,
38  public GroupsBase
39  {
40  typedef ::std::vector< css::uno::Reference< css::report::XGroup > > TGroups;
42  css::uno::Reference< css::uno::XComponentContext > m_xContext;
43  css::uno::WeakReference< css::report::XReportDefinition > m_xParent;
44  TGroups m_aGroups;
45  private:
46  OGroups& operator=(const OGroups&) = delete;
47  OGroups(const OGroups&) = delete;
48  void checkIndex(sal_Int32 _nIndex);
49  protected:
50  // TODO: VirtualFunctionFinder: This is virtual function!
51 
52  virtual ~OGroups() override;
53 
56  // TODO: VirtualFunctionFinder: This is virtual function!
57 
58  virtual void SAL_CALL disposing() override;
59  public:
60  OGroups( const css::uno::Reference< css::report::XReportDefinition >& _xParent
61  ,const css::uno::Reference< css::uno::XComponentContext >& context);
62 
63  // XGroups
64  // Attributes
65  virtual css::uno::Reference< css::report::XReportDefinition > SAL_CALL getReportDefinition() override;
66  // Methods
67  virtual css::uno::Reference< css::report::XGroup > SAL_CALL createGroup( ) override;
68  // XIndexContainer
69  virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const css::uno::Any& Element ) override;
70  virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) override;
71  // XIndexReplace
72  virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const css::uno::Any& Element ) override;
73  // XIndexAccess
74  virtual ::sal_Int32 SAL_CALL getCount( ) override;
75  virtual css::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) override;
76  // XElementAccess
77  virtual css::uno::Type SAL_CALL getElementType( ) override;
78  virtual sal_Bool SAL_CALL hasElements( ) override;
79  // XChild
80  virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
81  virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
82  // XContainer
83  virtual void SAL_CALL addContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
84  virtual void SAL_CALL removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
85 
86  // XComponent
87  virtual void SAL_CALL dispose() override;
88  virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
89  {
90  cppu::WeakComponentImplHelperBase::addEventListener(aListener);
91  }
92  virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
93  {
94  cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
95  }
96  };
97 }
98 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_GROUPS_HXX
99 
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL replaceByIndex(::sal_Int32 Index, const css::uno::Any &Element) override
Definition: Groups.cxx:116
virtual ::sal_Int32 SAL_CALL getCount() override
Definition: Groups.cxx:136
virtual css::uno::Reference< css::report::XReportDefinition > SAL_CALL getReportDefinition() override
Definition: Groups.cxx:63
OGroups & operator=(const OGroups &)=delete
virtual css::uno::Any SAL_CALL getByIndex(::sal_Int32 Index) override
Definition: Groups.cxx:142
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: Groups.hxx:88
virtual void SAL_CALL removeContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
Definition: Groups.cxx:180
virtual css::uno::Type SAL_CALL getElementType() override
Definition: Groups.cxx:152
virtual void SAL_CALL insertByIndex(::sal_Int32 Index, const css::uno::Any &Element) override
Definition: Groups.cxx:74
virtual sal_Bool SAL_CALL hasElements() override
Definition: Groups.cxx:157
implementation of a
Definition: Groups.hxx:37
css::uno::WeakReference< css::report::XReportDefinition > m_xParent
Definition: Groups.hxx:43
::std::vector< css::uno::Reference< css::report::XGroup > > TGroups
Definition: Groups.hxx:40
::cppu::WeakComponentImplHelper< css::report::XGroups > GroupsBase
Definition: Groups.hxx:32
virtual void SAL_CALL disposing() override
this function is called upon disposing the component
Definition: Groups.cxx:52
virtual void SAL_CALL removeByIndex(::sal_Int32 Index) override
Definition: Groups.cxx:100
virtual void SAL_CALL dispose() override
Definition: Groups.cxx:45
void checkIndex(sal_Int32 _nIndex)
Definition: Groups.cxx:185
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
Definition: Groups.cxx:169
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
Definition: Groups.cxx:164
unsigned char sal_Bool
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: Groups.hxx:92
::comphelper::OInterfaceContainerHelper2 m_aContainerListeners
Definition: Groups.hxx:41
OGroups(const OGroups &)=delete
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: Groups.hxx:42
virtual ~OGroups() override
Definition: Groups.cxx:41
struct _ADOIndex Index
virtual css::uno::Reference< css::report::XGroup > SAL_CALL createGroup() override
Definition: Groups.cxx:68
virtual void SAL_CALL addContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
Definition: Groups.cxx:175