Update ooo320-m1
[ooovba.git] / ucb / source / ucp / file / filnot.hxx
blob3f2bc5338699f0bc8a20595b5adc5bc4e2148027
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: filnot.hxx,v $
10 * $Revision: 1.6 $
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 ************************************************************************/
30 #ifndef _FILNOT_HXX_
31 #define _FILNOT_HXX_
33 #include <hash_map>
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 {
43 class shell;
44 class BaseContent;
46 class ContentEventNotifier
48 private:
49 shell* m_pMyShell;
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;
54 public:
56 ContentEventNotifier(
57 shell* pMyShell,
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 );
63 ContentEventNotifier(
64 shell* pMyShell,
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
80 private:
81 shell* m_pMyShell;
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;
85 public:
86 PropertySetInfoChangeNotifier(
87 shell* pMyShell,
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 > >,
100 hashOUString,
101 equalOUString > ListenerMap;
103 class PropertyChangeNotifier
105 private:
106 shell* m_pMyShell;
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;
110 public:
111 PropertyChangeNotifier(
112 shell* pMyShell,
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 );
124 class Notifier
126 public:
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
140 #endif