1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
{
33 class ContentEventNotifier
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
;
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
);
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
);
60 void notifyRemoved( const OUString
& aChildName
);
61 void notifyExchanged( );
65 class PropertySetInfoChangeNotifier
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
;
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
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
;
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
);
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;
123 } // end namespace fileaccess
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */