1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: filnot.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include <com/sun/star/uno/Sequence.hxx>
35 #include <com/sun/star/uno/XInterface.hpp>
36 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
37 #include <com/sun/star/ucb/XContentIdentifier.hpp>
38 #include "filglob.hxx"
41 namespace fileaccess
{
46 class ContentEventNotifier
50 com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> m_xCreatorContent
;
51 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
> m_xCreatorId
;
52 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
> m_xOldId
;
53 com::sun::star::uno::Sequence
< com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> > m_sListeners
;
58 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
>& xCreatorContent
,
59 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xCreatorId
,
60 const com::sun::star::uno::Sequence
<
61 com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> >& sListeners
);
65 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
>& xCreatorContent
,
66 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xCreatorId
,
67 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xOldId
,
68 const com::sun::star::uno::Sequence
<
69 com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> >& sListeners
);
71 void notifyChildInserted( const rtl::OUString
& aChildName
);
72 void notifyDeleted( void );
73 void notifyRemoved( const rtl::OUString
& aChildName
);
74 void notifyExchanged( );
78 class PropertySetInfoChangeNotifier
82 com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> m_xCreatorContent
;
83 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
> m_xCreatorId
;
84 com::sun::star::uno::Sequence
< com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> > m_sListeners
;
86 PropertySetInfoChangeNotifier(
88 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
>& xCreatorContent
,
89 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xCreatorId
,
90 const com::sun::star::uno::Sequence
<
91 com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> >& sListeners
);
93 void SAL_CALL
notifyPropertyAdded( const rtl::OUString
& aPropertyName
);
94 void SAL_CALL
notifyPropertyRemoved( const rtl::OUString
& aPropertyName
);
98 typedef std::hash_map
< rtl::OUString
,
99 com::sun::star::uno::Sequence
< com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> >,
101 equalOUString
> ListenerMap
;
103 class PropertyChangeNotifier
107 com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> m_xCreatorContent
;
108 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
> m_xCreatorId
;
109 ListenerMap
* m_pListeners
;
111 PropertyChangeNotifier(
113 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
>& xCreatorContent
,
114 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& xCreatorId
,
115 ListenerMap
* pListeners
);
117 ~PropertyChangeNotifier();
119 void notifyPropertyChanged(
120 com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyChangeEvent
> seqChanged
);
127 // Side effect of this function is the change of the name
128 virtual ContentEventNotifier
* cEXC( const rtl::OUString aNewName
) = 0;
129 // Side effect is the change of the state of the object to "deleted".
130 virtual ContentEventNotifier
* cDEL( void ) = 0;
131 virtual ContentEventNotifier
* cCEL( void ) = 0;
132 virtual PropertySetInfoChangeNotifier
* cPSL( void ) = 0;
133 virtual PropertyChangeNotifier
* cPCL( void ) = 0;
134 virtual rtl::OUString
getKey( void ) = 0;
138 } // end namespace fileaccess