Bump for 3.6-28
[LibreOffice.git] / ucb / source / ucp / file / filnot.hxx
blob3c146acde5ad9af47cedd76d8ebd6ee1367f6811
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 ************************************************************************/
28 #ifndef _FILNOT_HXX_
29 #define _FILNOT_HXX_
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 {
41 class shell;
42 class BaseContent;
44 class ContentEventNotifier
46 private:
47 shell* m_pMyShell;
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;
52 public:
54 ContentEventNotifier(
55 shell* pMyShell,
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 );
61 ContentEventNotifier(
62 shell* pMyShell,
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
78 private:
79 shell* m_pMyShell;
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;
83 public:
84 PropertySetInfoChangeNotifier(
85 shell* pMyShell,
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 > >,
98 hashOUString,
99 equalOUString > ListenerMap;
101 class PropertyChangeNotifier
103 private:
104 shell* m_pMyShell;
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;
108 public:
109 PropertyChangeNotifier(
110 shell* pMyShell,
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 );
122 class Notifier
124 public:
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;
134 protected:
135 ~Notifier() {}
139 } // end namespace fileaccess
141 #endif
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */