bump product version to 4.1.6.2
[LibreOffice.git] / include / svl / brdcst.hxx
blob258cf6066e58def07b9949dccab128920e287bf0
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 _SFXBRDCST_HXX
20 #define _SFXBRDCST_HXX
22 #include "svl/svldllapi.h"
23 #include <tools/rtti.hxx>
24 #include <vector>
26 class SfxListener;
27 class SfxHint;
29 //-------------------------------------------------------------------------
31 class SVL_DLLPUBLIC SfxBroadcaster
33 friend class SfxListener;
34 typedef std::vector<SfxListener*> SfxListenerArr_Impl;
36 SfxListenerArr_Impl m_Listeners;
38 private:
39 void AddListener( SfxListener& rListener );
40 void RemoveListener( SfxListener& rListener );
41 const SfxBroadcaster& operator=(const SfxBroadcaster &); // verboten
43 protected:
44 void Forward(SfxBroadcaster& rBC, const SfxHint& rHint);
45 virtual void ListenersGone();
47 public:
48 TYPEINFO();
50 SfxBroadcaster();
51 SfxBroadcaster( const SfxBroadcaster &rBC );
52 virtual ~SfxBroadcaster();
54 void Broadcast( const SfxHint &rHint );
55 bool HasListeners() const;
56 size_t GetListenerCount() const
58 return m_Listeners.size();
60 SfxListener* GetListener( sal_uInt16 nNo ) const
62 return m_Listeners[nNo];
66 #endif
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */