Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / ucb / source / ucp / file / filnot.hxx
blobee6a2467b5eeeb2ad43093ad17044b88f61628d3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef _FILNOT_HXX_
20 #define _FILNOT_HXX_
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 {
32 class shell;
34 class ContentEventNotifier
36 private:
37 shell* m_pMyShell;
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;
42 public:
44 ContentEventNotifier(
45 shell* pMyShell,
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 );
51 ContentEventNotifier(
52 shell* pMyShell,
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
68 private:
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;
72 public:
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 > >,
86 hashOUString,
87 equalOUString > ListenerMap;
89 class PropertyChangeNotifier
91 private:
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;
95 public:
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 );
108 class Notifier
110 public:
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;
120 protected:
121 ~Notifier() {}
125 } // end namespace fileaccess
127 #endif
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */