1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SFX2_DOCSTORAGEMODIFYLISTENER_HXX
25 #define SFX2_DOCSTORAGEMODIFYLISTENER_HXX
26 
27 #include "sfx2/dllapi.h"
28 
29 /** === begin UNO includes === **/
30 #include <com/sun/star/util/XModifyListener.hpp>
31 /** === end UNO includes === **/
32 
33 #include <cppuhelper/implbase1.hxx>
34 
35 namespace vos
36 {
37     class IMutex;
38 }
39 
40 //........................................................................
41 namespace sfx2
42 {
43 //........................................................................
44 
45 	//====================================================================
46 	//= IModifiableDocument
47 	//====================================================================
48     /** callback for the DocumentStorageModifyListener class
49     */
50     class SAL_NO_VTABLE IModifiableDocument
51     {
52     public:
53         /// indicates the root or a sub storage of the document has been modified
54         virtual void storageIsModified() = 0;
55     };
56 
57 	//====================================================================
58 	//= DocumentStorageModifyListener
59 	//====================================================================
60     typedef ::cppu::WeakImplHelper1 < ::com::sun::star::util::XModifyListener > DocumentStorageModifyListener_Base;
61 
62     class SFX2_DLLPUBLIC DocumentStorageModifyListener : public DocumentStorageModifyListener_Base
63     {
64         IModifiableDocument*    m_pDocument;
65         ::vos::IMutex&          m_rMutex;
66 
67     public:
68         DocumentStorageModifyListener( IModifiableDocument& _rDocument, ::vos::IMutex& _rMutex );
69 
70 	    void dispose();
71 
72         // XModifyListener
73         virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
74 
75         // XEventListener
76         virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
77 
78     protected:
79 	    virtual ~DocumentStorageModifyListener();
80 
81     private:
82         DocumentStorageModifyListener();                                                    // never implemented
83         DocumentStorageModifyListener( const DocumentStorageModifyListener& );              // never implemented
84         DocumentStorageModifyListener& operator=( const DocumentStorageModifyListener& );   // never implemented
85     };
86 
87 //........................................................................
88 } // namespace sfx2
89 //........................................................................
90 
91 #endif // SFX2_DOCSTORAGEMODIFYLISTENER_HXX
92