1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
31 #include <boost/unordered_map.hpp>
32 #include <com/sun/star/uno/Sequence.hxx>
33 #include <com/sun/star/uno/XInterface.hpp>
34 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
35 #include <com/sun/star/ucb/XContentIdentifier.hpp>
36 #include "filglob.hxx"
39 namespace fileaccess
{
44 class ContentEventNotifier
48 com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> m_xCreatorContent
;
49 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
> m_xCreatorId
;
50 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
> m_xOldId
;
51 com::sun::star::uno::Sequence
< com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> > m_sListeners
;
56 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
>& xCreatorContent
,
57 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xCreatorId
,
58 const com::sun::star::uno::Sequence
<
59 com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> >& sListeners
);
63 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
>& xCreatorContent
,
64 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xCreatorId
,
65 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xOldId
,
66 const com::sun::star::uno::Sequence
<
67 com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> >& sListeners
);
69 void notifyChildInserted( const rtl::OUString
& aChildName
);
70 void notifyDeleted( void );
71 void notifyRemoved( const rtl::OUString
& aChildName
);
72 void notifyExchanged( );
76 class PropertySetInfoChangeNotifier
80 com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> m_xCreatorContent
;
81 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
> m_xCreatorId
;
82 com::sun::star::uno::Sequence
< com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> > m_sListeners
;
84 PropertySetInfoChangeNotifier(
86 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
>& xCreatorContent
,
87 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xCreatorId
,
88 const com::sun::star::uno::Sequence
<
89 com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> >& sListeners
);
91 void SAL_CALL
notifyPropertyAdded( const rtl::OUString
& aPropertyName
);
92 void SAL_CALL
notifyPropertyRemoved( const rtl::OUString
& aPropertyName
);
96 typedef boost::unordered_map
< rtl::OUString
,
97 com::sun::star::uno::Sequence
< com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> >,
99 equalOUString
> ListenerMap
;
101 class PropertyChangeNotifier
105 com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> m_xCreatorContent
;
106 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
> m_xCreatorId
;
107 ListenerMap
* m_pListeners
;
109 PropertyChangeNotifier(
111 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
>& xCreatorContent
,
112 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xCreatorId
,
113 ListenerMap
* pListeners
);
115 ~PropertyChangeNotifier();
117 void notifyPropertyChanged(
118 com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyChangeEvent
> seqChanged
);
125 // Side effect of this function is the change of the name
126 virtual ContentEventNotifier
* cEXC( const rtl::OUString aNewName
) = 0;
127 // Side effect is the change of the state of the object to "deleted".
128 virtual ContentEventNotifier
* cDEL( void ) = 0;
129 virtual ContentEventNotifier
* cCEL( void ) = 0;
130 virtual PropertySetInfoChangeNotifier
* cPSL( void ) = 0;
131 virtual PropertyChangeNotifier
* cPCL( void ) = 0;
132 virtual rtl::OUString
getKey( void ) = 0;
139 } // end namespace fileaccess
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */