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 .
22 #include <boost/unordered_map.hpp>
23 #include <com/sun/star/uno/Sequence.hxx>
24 #include <com/sun/star/uno/XInterface.hpp>
25 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
26 #include <com/sun/star/ucb/XContentIdentifier.hpp>
27 #include "filglob.hxx"
30 namespace fileaccess
{
34 class ContentEventNotifier
38 com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> m_xCreatorContent
;
39 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
> m_xCreatorId
;
40 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
> m_xOldId
;
41 com::sun::star::uno::Sequence
< com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> > m_sListeners
;
46 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
>& xCreatorContent
,
47 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xCreatorId
,
48 const com::sun::star::uno::Sequence
<
49 com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> >& sListeners
);
53 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
>& xCreatorContent
,
54 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xCreatorId
,
55 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xOldId
,
56 const com::sun::star::uno::Sequence
<
57 com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> >& sListeners
);
59 void notifyChildInserted( const rtl::OUString
& aChildName
);
60 void notifyDeleted( void );
61 void notifyRemoved( const rtl::OUString
& aChildName
);
62 void notifyExchanged( );
66 class PropertySetInfoChangeNotifier
69 com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> m_xCreatorContent
;
70 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
> m_xCreatorId
;
71 com::sun::star::uno::Sequence
< com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> > m_sListeners
;
73 PropertySetInfoChangeNotifier(
74 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
>& xCreatorContent
,
75 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xCreatorId
,
76 const com::sun::star::uno::Sequence
<
77 com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> >& sListeners
);
79 void SAL_CALL
notifyPropertyAdded( const rtl::OUString
& aPropertyName
);
80 void SAL_CALL
notifyPropertyRemoved( const rtl::OUString
& aPropertyName
);
84 typedef boost::unordered_map
< rtl::OUString
,
85 com::sun::star::uno::Sequence
< com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> >,
87 equalOUString
> ListenerMap
;
89 class PropertyChangeNotifier
92 com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> m_xCreatorContent
;
93 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
> m_xCreatorId
;
94 ListenerMap
* m_pListeners
;
96 PropertyChangeNotifier(
97 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
>& xCreatorContent
,
98 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xCreatorId
,
99 ListenerMap
* pListeners
);
101 ~PropertyChangeNotifier();
103 void notifyPropertyChanged(
104 com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyChangeEvent
> seqChanged
);
111 // Side effect of this function is the change of the name
112 virtual ContentEventNotifier
* cEXC( const rtl::OUString aNewName
) = 0;
113 // Side effect is the change of the state of the object to "deleted".
114 virtual ContentEventNotifier
* cDEL( void ) = 0;
115 virtual ContentEventNotifier
* cCEL( void ) = 0;
116 virtual PropertySetInfoChangeNotifier
* cPSL( void ) = 0;
117 virtual PropertyChangeNotifier
* cPCL( void ) = 0;
118 virtual rtl::OUString
getKey( void ) = 0;
125 } // end namespace fileaccess
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */