bump product version to 5.0.4.1
[LibreOffice.git] / ucb / source / ucp / file / filnot.hxx
blob327ec4832fffdb1c91ba5f807f8b0be700fbef97
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_UCB_SOURCE_UCP_FILE_FILNOT_HXX
20 #define INCLUDED_UCB_SOURCE_UCP_FILE_FILNOT_HXX
22 #include <com/sun/star/uno/Sequence.hxx>
23 #include <com/sun/star/uno/XInterface.hpp>
24 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
25 #include <com/sun/star/ucb/XContentIdentifier.hpp>
26 #include "filglob.hxx"
27 #include <unordered_map>
29 namespace fileaccess {
31 class shell;
33 class ContentEventNotifier
35 private:
36 shell* m_pMyShell;
37 com::sun::star::uno::Reference< com::sun::star::ucb::XContent > m_xCreatorContent;
38 com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xCreatorId;
39 com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xOldId;
40 com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::uno::XInterface > > m_sListeners;
41 public:
43 ContentEventNotifier(
44 shell* pMyShell,
45 const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
46 const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
47 const com::sun::star::uno::Sequence<
48 com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >& sListeners );
50 ContentEventNotifier(
51 shell* pMyShell,
52 const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
53 const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
54 const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xOldId,
55 const com::sun::star::uno::Sequence<
56 com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >& sListeners );
58 void notifyChildInserted( const OUString& aChildName );
59 void notifyDeleted();
60 void notifyRemoved( const OUString& aChildName );
61 void notifyExchanged( );
65 class PropertySetInfoChangeNotifier
67 private:
68 com::sun::star::uno::Reference< com::sun::star::ucb::XContent > m_xCreatorContent;
69 com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xCreatorId;
70 com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::uno::XInterface > > m_sListeners;
71 public:
72 PropertySetInfoChangeNotifier(
73 const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
74 const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
75 const com::sun::star::uno::Sequence<
76 com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >& sListeners );
78 void SAL_CALL notifyPropertyAdded( const OUString & aPropertyName );
79 void SAL_CALL notifyPropertyRemoved( const OUString & aPropertyName );
83 typedef std::unordered_map< OUString,
84 com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >,
85 OUStringHash > ListenerMap;
87 class PropertyChangeNotifier
89 private:
90 com::sun::star::uno::Reference< com::sun::star::ucb::XContent > m_xCreatorContent;
91 com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xCreatorId;
92 ListenerMap* m_pListeners;
93 public:
94 PropertyChangeNotifier(
95 const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
96 const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
97 ListenerMap* pListeners );
99 ~PropertyChangeNotifier();
101 void notifyPropertyChanged(
102 const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyChangeEvent >& seqChanged );
106 class Notifier
108 public:
109 // Side effect of this function is the change of the name
110 virtual ContentEventNotifier* cEXC( const OUString& aNewName ) = 0;
111 // Side effect is the change of the state of the object to "deleted".
112 virtual ContentEventNotifier* cDEL() = 0;
113 virtual ContentEventNotifier* cCEL() = 0;
114 virtual PropertySetInfoChangeNotifier* cPSL() = 0;
115 virtual PropertyChangeNotifier* cPCL() = 0;
116 virtual OUString getKey() = 0;
118 protected:
119 ~Notifier() {}
123 } // end namespace fileaccess
125 #endif
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */