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 _EMBEDDOCACCESS_HXX_
25 #define _EMBEDDOCACCESS_HXX_
26 
27 #include <cppuhelper/weak.hxx>
28 
29 #define OLESERV_SAVEOBJECT	    1
30 #define OLESERV_CLOSE		    2
31 #define OLESERV_NOTIFY		    3
32 #define OLESERV_NOTIFYCLOSING	4
33 #define OLESERV_SHOWOBJECT	    5
34 #define OLESERV_DEACTIVATE	    6
35 
36 #include <oleidl.h>
37 #ifndef __MINGW32__
38 #if defined(_MSC_VER) && (_MSC_VER > 1310)
39 #pragma warning(disable : 4265)
40 #include <atldbcli.h>
41 #else
42 #include <atlcomcli.h>
43 #endif
44 #endif
45 #include <cppuhelper/weak.hxx>
46 
47 class EmbedDocument_Impl;
48 struct LockedEmbedDocument_Impl
49 {
50 private:
51 	EmbedDocument_Impl* m_pEmbedDocument;
52 
53 public:
54     LockedEmbedDocument_Impl();
55     LockedEmbedDocument_Impl( EmbedDocument_Impl* pEmbedDocument );
56     LockedEmbedDocument_Impl( const LockedEmbedDocument_Impl& aDocLock );
57 
58     ~LockedEmbedDocument_Impl();
59 
60     LockedEmbedDocument_Impl& operator=( const LockedEmbedDocument_Impl& aDocLock );
61 
GetEmbedDocumentLockedEmbedDocument_Impl62     EmbedDocument_Impl* GetEmbedDocument() { return m_pEmbedDocument; }
63 
64     void ExecuteMethod( sal_Int16 nId );
65 };
66 
67 class EmbeddedDocumentInstanceAccess_Impl : public ::cppu::OWeakObject
68 {
69 	::osl::Mutex m_aMutex;
70 	EmbedDocument_Impl* m_pEmbedDocument;
71 
72 	public:
EmbeddedDocumentInstanceAccess_Impl(EmbedDocument_Impl * pDoc)73 	EmbeddedDocumentInstanceAccess_Impl( EmbedDocument_Impl* pDoc )
74 	: m_pEmbedDocument( pDoc )
75 	{}
76 
77 	LockedEmbedDocument_Impl GetEmbedDocument();
78 	void ClearEmbedDocument();
79 };
80 
81 #endif
82