Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
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.
15 : : *
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).
21 : : *
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.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _FILNOT_HXX_
29 : : #define _FILNOT_HXX_
30 : :
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"
37 : :
38 : :
39 : : namespace fileaccess {
40 : :
41 : : class shell;
42 : :
43 [ + - ]: 4380 : class ContentEventNotifier
44 : : {
45 : : private:
46 : : shell* m_pMyShell;
47 : : com::sun::star::uno::Reference< com::sun::star::ucb::XContent > m_xCreatorContent;
48 : : com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xCreatorId;
49 : : com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xOldId;
50 : : com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::uno::XInterface > > m_sListeners;
51 : : public:
52 : :
53 : : ContentEventNotifier(
54 : : shell* pMyShell,
55 : : const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
56 : : const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
57 : : const com::sun::star::uno::Sequence<
58 : : com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >& sListeners );
59 : :
60 : : ContentEventNotifier(
61 : : shell* pMyShell,
62 : : const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
63 : : const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
64 : : const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xOldId,
65 : : const com::sun::star::uno::Sequence<
66 : : com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >& sListeners );
67 : :
68 : : void notifyChildInserted( const rtl::OUString& aChildName );
69 : : void notifyDeleted( void );
70 : : void notifyRemoved( const rtl::OUString& aChildName );
71 : : void notifyExchanged( );
72 : : };
73 : :
74 : :
75 [ # # ]: 0 : class PropertySetInfoChangeNotifier
76 : : {
77 : : private:
78 : : com::sun::star::uno::Reference< com::sun::star::ucb::XContent > m_xCreatorContent;
79 : : com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xCreatorId;
80 : : com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::uno::XInterface > > m_sListeners;
81 : : public:
82 : : PropertySetInfoChangeNotifier(
83 : : const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
84 : : const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
85 : : const com::sun::star::uno::Sequence<
86 : : com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >& sListeners );
87 : :
88 : : void SAL_CALL notifyPropertyAdded( const rtl::OUString & aPropertyName );
89 : : void SAL_CALL notifyPropertyRemoved( const rtl::OUString & aPropertyName );
90 : : };
91 : :
92 : :
93 : : typedef boost::unordered_map< rtl::OUString,
94 : : com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >,
95 : : hashOUString,
96 : : equalOUString > ListenerMap;
97 : :
98 : : class PropertyChangeNotifier
99 : : {
100 : : private:
101 : : com::sun::star::uno::Reference< com::sun::star::ucb::XContent > m_xCreatorContent;
102 : : com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xCreatorId;
103 : : ListenerMap* m_pListeners;
104 : : public:
105 : : PropertyChangeNotifier(
106 : : const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
107 : : const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
108 : : ListenerMap* pListeners );
109 : :
110 : : ~PropertyChangeNotifier();
111 : :
112 : : void notifyPropertyChanged(
113 : : com::sun::star::uno::Sequence< com::sun::star::beans::PropertyChangeEvent > seqChanged );
114 : : };
115 : :
116 : :
117 : 120078 : class Notifier
118 : : {
119 : : public:
120 : : // Side effect of this function is the change of the name
121 : : virtual ContentEventNotifier* cEXC( const rtl::OUString aNewName ) = 0;
122 : : // Side effect is the change of the state of the object to "deleted".
123 : : virtual ContentEventNotifier* cDEL( void ) = 0;
124 : : virtual ContentEventNotifier* cCEL( void ) = 0;
125 : : virtual PropertySetInfoChangeNotifier* cPSL( void ) = 0;
126 : : virtual PropertyChangeNotifier* cPCL( void ) = 0;
127 : : virtual rtl::OUString getKey( void ) = 0;
128 : :
129 : : protected:
130 : 119849 : ~Notifier() {}
131 : : };
132 : :
133 : :
134 : : } // end namespace fileaccess
135 : :
136 : : #endif
137 : :
138 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|