LibreOffice Module svx (master) 1
shapecollection.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#pragma once
20
23#include <com/sun/star/drawing/XShapes.hpp>
24#include <com/sun/star/lang/XServiceInfo.hpp>
25#include <com/sun/star/uno/XComponentContext.hpp>
26#include <com/sun/star/lang/XComponent.hpp>
27#include <mutex>
28#include <vector>
29
31 : public cppu::WeakAggImplHelper3<css::drawing::XShapes, css::lang::XServiceInfo,
32 css::lang::XComponent>
33{
34private:
35 std::mutex m_aMutex;
36 std::vector<css::uno::Reference<css::drawing::XShape>> maShapeContainer;
38 bool bDisposed = false;
39 bool bInDispose = false;
40
41public:
42 SvxShapeCollection() noexcept;
43
44 // XInterface
45 virtual void SAL_CALL release() noexcept override;
46
47 // XComponent
48 virtual void SAL_CALL dispose() override;
49 virtual void SAL_CALL
50 addEventListener(const css::uno::Reference<css::lang::XEventListener>& aListener) override;
51 virtual void SAL_CALL
52 removeEventListener(const css::uno::Reference<css::lang::XEventListener>& aListener) override;
53
54 // XIndexAccess
55 virtual sal_Int32 SAL_CALL getCount() override;
56 virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override;
57
58 // XElementAccess
59 virtual css::uno::Type SAL_CALL getElementType() override;
60 virtual sal_Bool SAL_CALL hasElements() override;
61
62 // XShapes
63 virtual void SAL_CALL add(const css::uno::Reference<css::drawing::XShape>& xShape) override;
64 virtual void SAL_CALL remove(const css::uno::Reference<css::drawing::XShape>& xShape) override;
65
66 // XServiceInfo
67 virtual OUString SAL_CALL getImplementationName() override;
68 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
69 virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
70
71 void getAllShapes(std::vector<css::uno::Reference<css::drawing::XShape>>& rShapes) const;
72};
73
74/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOIndex Index
void getAllShapes(std::vector< css::uno::Reference< css::drawing::XShape > > &rShapes) const
Definition: unoshcol.cxx:201
virtual void SAL_CALL remove(const css::uno::Reference< css::drawing::XShape > &xShape) override
Definition: unoshcol.cxx:150
std::vector< css::uno::Reference< css::drawing::XShape > > maShapeContainer
SvxShapeCollection() noexcept
Definition: unoshcol.cxx:31
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unoshcol.cxx:175
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: unoshcol.cxx:135
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unoshcol.cxx:196
virtual void SAL_CALL add(const css::uno::Reference< css::drawing::XShape > &xShape) override
Definition: unoshcol.cxx:143
virtual sal_Int32 SAL_CALL getCount() override
Definition: unoshcol.cxx:157
virtual void SAL_CALL release() noexcept override
Definition: unoshcol.cxx:36
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: unoshcol.cxx:164
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unoshcol.cxx:191
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: unoshcol.cxx:128
virtual void SAL_CALL dispose() override
Definition: unoshcol.cxx:69
virtual OUString SAL_CALL getImplementationName() override
Definition: unoshcol.cxx:186
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > maEventListeners
virtual sal_Bool SAL_CALL hasElements() override
Definition: unoshcol.cxx:180
Type
unsigned char sal_Bool