xref: /AOO42X/main/ucb/source/ucp/file/filnot.hxx (revision 9bce9b0d387299c68bd81d539e1478357a103de5)
1*6df1ea1fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*6df1ea1fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*6df1ea1fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*6df1ea1fSAndrew Rist  * distributed with this work for additional information
6*6df1ea1fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*6df1ea1fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*6df1ea1fSAndrew Rist  * "License"); you may not use this file except in compliance
9*6df1ea1fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*6df1ea1fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*6df1ea1fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*6df1ea1fSAndrew Rist  * software distributed under the License is distributed on an
15*6df1ea1fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*6df1ea1fSAndrew Rist  * KIND, either express or implied.  See the License for the
17*6df1ea1fSAndrew Rist  * specific language governing permissions and limitations
18*6df1ea1fSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*6df1ea1fSAndrew Rist  *************************************************************/
21*6df1ea1fSAndrew Rist 
22*6df1ea1fSAndrew Rist 
23cdf0e10cSrcweir #ifndef _FILNOT_HXX_
24cdf0e10cSrcweir #define _FILNOT_HXX_
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <hash_map>
27cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
28cdf0e10cSrcweir #include <com/sun/star/uno/XInterface.hpp>
29cdf0e10cSrcweir #include <com/sun/star/beans/PropertyChangeEvent.hpp>
30cdf0e10cSrcweir #include <com/sun/star/ucb/XContentIdentifier.hpp>
31cdf0e10cSrcweir #include "filglob.hxx"
32cdf0e10cSrcweir 
33cdf0e10cSrcweir 
34cdf0e10cSrcweir namespace fileaccess {
35cdf0e10cSrcweir 
36cdf0e10cSrcweir     class shell;
37cdf0e10cSrcweir     class BaseContent;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir     class ContentEventNotifier
40cdf0e10cSrcweir     {
41cdf0e10cSrcweir     private:
42cdf0e10cSrcweir         shell* m_pMyShell;
43cdf0e10cSrcweir         com::sun::star::uno::Reference< com::sun::star::ucb::XContent > m_xCreatorContent;
44cdf0e10cSrcweir         com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xCreatorId;
45cdf0e10cSrcweir         com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xOldId;
46cdf0e10cSrcweir         com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::uno::XInterface > > m_sListeners;
47cdf0e10cSrcweir     public:
48cdf0e10cSrcweir 
49cdf0e10cSrcweir         ContentEventNotifier(
50cdf0e10cSrcweir             shell* pMyShell,
51cdf0e10cSrcweir             const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
52cdf0e10cSrcweir             const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
53cdf0e10cSrcweir             const com::sun::star::uno::Sequence<
54cdf0e10cSrcweir             com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >& sListeners );
55cdf0e10cSrcweir 
56cdf0e10cSrcweir         ContentEventNotifier(
57cdf0e10cSrcweir             shell* pMyShell,
58cdf0e10cSrcweir             const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
59cdf0e10cSrcweir             const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
60cdf0e10cSrcweir             const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xOldId,
61cdf0e10cSrcweir             const com::sun::star::uno::Sequence<
62cdf0e10cSrcweir             com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >& sListeners );
63cdf0e10cSrcweir 
64cdf0e10cSrcweir         void notifyChildInserted( const rtl::OUString& aChildName );
65cdf0e10cSrcweir         void notifyDeleted( void );
66cdf0e10cSrcweir         void notifyRemoved( const rtl::OUString& aChildName );
67cdf0e10cSrcweir         void notifyExchanged( );
68cdf0e10cSrcweir     };
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 
71cdf0e10cSrcweir     class PropertySetInfoChangeNotifier
72cdf0e10cSrcweir     {
73cdf0e10cSrcweir     private:
74cdf0e10cSrcweir         shell* m_pMyShell;
75cdf0e10cSrcweir         com::sun::star::uno::Reference< com::sun::star::ucb::XContent > m_xCreatorContent;
76cdf0e10cSrcweir         com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xCreatorId;
77cdf0e10cSrcweir         com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::uno::XInterface > > m_sListeners;
78cdf0e10cSrcweir     public:
79cdf0e10cSrcweir         PropertySetInfoChangeNotifier(
80cdf0e10cSrcweir             shell* pMyShell,
81cdf0e10cSrcweir             const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
82cdf0e10cSrcweir             const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
83cdf0e10cSrcweir             const com::sun::star::uno::Sequence<
84cdf0e10cSrcweir             com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >& sListeners );
85cdf0e10cSrcweir 
86cdf0e10cSrcweir         void SAL_CALL notifyPropertyAdded( const rtl::OUString & aPropertyName );
87cdf0e10cSrcweir         void SAL_CALL notifyPropertyRemoved( const rtl::OUString & aPropertyName );
88cdf0e10cSrcweir     };
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 
91cdf0e10cSrcweir     typedef std::hash_map< rtl::OUString,
92cdf0e10cSrcweir                            com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >,
93cdf0e10cSrcweir                            hashOUString,
94cdf0e10cSrcweir                            equalOUString >      ListenerMap;
95cdf0e10cSrcweir 
96cdf0e10cSrcweir     class PropertyChangeNotifier
97cdf0e10cSrcweir     {
98cdf0e10cSrcweir     private:
99cdf0e10cSrcweir         shell* m_pMyShell;
100cdf0e10cSrcweir         com::sun::star::uno::Reference< com::sun::star::ucb::XContent > m_xCreatorContent;
101cdf0e10cSrcweir         com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xCreatorId;
102cdf0e10cSrcweir         ListenerMap* m_pListeners;
103cdf0e10cSrcweir     public:
104cdf0e10cSrcweir         PropertyChangeNotifier(
105cdf0e10cSrcweir             shell* pMyShell,
106cdf0e10cSrcweir             const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
107cdf0e10cSrcweir             const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
108cdf0e10cSrcweir             ListenerMap* pListeners );
109cdf0e10cSrcweir 
110cdf0e10cSrcweir         ~PropertyChangeNotifier();
111cdf0e10cSrcweir 
112cdf0e10cSrcweir         void notifyPropertyChanged(
113cdf0e10cSrcweir             com::sun::star::uno::Sequence< com::sun::star::beans::PropertyChangeEvent > seqChanged );
114cdf0e10cSrcweir     };
115cdf0e10cSrcweir 
116cdf0e10cSrcweir 
117cdf0e10cSrcweir     class Notifier
118cdf0e10cSrcweir     {
119cdf0e10cSrcweir     public:
120cdf0e10cSrcweir         // Side effect of this function is the change of the name
121cdf0e10cSrcweir         virtual ContentEventNotifier*          cEXC( const rtl::OUString aNewName ) = 0;
122cdf0e10cSrcweir         // Side effect is the change of the state of the object to "deleted".
123cdf0e10cSrcweir         virtual ContentEventNotifier*          cDEL( void ) = 0;
124cdf0e10cSrcweir         virtual ContentEventNotifier*          cCEL( void ) = 0;
125cdf0e10cSrcweir         virtual PropertySetInfoChangeNotifier* cPSL( void ) = 0;
126cdf0e10cSrcweir         virtual PropertyChangeNotifier*        cPCL( void ) = 0;
127cdf0e10cSrcweir         virtual rtl::OUString                  getKey( void ) = 0;
128cdf0e10cSrcweir     };
129cdf0e10cSrcweir 
130cdf0e10cSrcweir 
131cdf0e10cSrcweir }   // end namespace fileaccess
132cdf0e10cSrcweir 
133cdf0e10cSrcweir #endif
134