1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _EMBEDDOCACCESS_HXX_
29 #define _EMBEDDOCACCESS_HXX_
30 
31 #include <cppuhelper/weak.hxx>
32 
33 #define OLESERV_SAVEOBJECT	    1
34 #define OLESERV_CLOSE		    2
35 #define OLESERV_NOTIFY		    3
36 #define OLESERV_NOTIFYCLOSING	4
37 #define OLESERV_SHOWOBJECT	    5
38 #define OLESERV_DEACTIVATE	    6
39 
40 #include <oleidl.h>
41 #ifndef __MINGW32__
42 #if defined(_MSC_VER) && (_MSC_VER > 1310)
43 #pragma warning(disable : 4265)
44 #include <atldbcli.h>
45 #else
46 #include <atlcomcli.h>
47 #endif
48 #endif
49 #include <cppuhelper/weak.hxx>
50 
51 class EmbedDocument_Impl;
52 struct LockedEmbedDocument_Impl
53 {
54 private:
55 	EmbedDocument_Impl* m_pEmbedDocument;
56 
57 public:
58     LockedEmbedDocument_Impl();
59     LockedEmbedDocument_Impl( EmbedDocument_Impl* pEmbedDocument );
60     LockedEmbedDocument_Impl( const LockedEmbedDocument_Impl& aDocLock );
61 
62     ~LockedEmbedDocument_Impl();
63 
64     LockedEmbedDocument_Impl& operator=( const LockedEmbedDocument_Impl& aDocLock );
65 
66     EmbedDocument_Impl* GetEmbedDocument() { return m_pEmbedDocument; }
67 
68     void ExecuteMethod( sal_Int16 nId );
69 };
70 
71 class EmbeddedDocumentInstanceAccess_Impl : public ::cppu::OWeakObject
72 {
73 	::osl::Mutex m_aMutex;
74 	EmbedDocument_Impl* m_pEmbedDocument;
75 
76 	public:
77 	EmbeddedDocumentInstanceAccess_Impl( EmbedDocument_Impl* pDoc )
78 	: m_pEmbedDocument( pDoc )
79 	{}
80 
81 	LockedEmbedDocument_Impl GetEmbedDocument();
82 	void ClearEmbedDocument();
83 };
84 
85 #endif
86