1*a20fd023SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*a20fd023SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*a20fd023SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*a20fd023SAndrew Rist * distributed with this work for additional information 6*a20fd023SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*a20fd023SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*a20fd023SAndrew Rist * "License"); you may not use this file except in compliance 9*a20fd023SAndrew Rist * with the License. You may obtain a copy of the License at 10*a20fd023SAndrew Rist * 11*a20fd023SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*a20fd023SAndrew Rist * 13*a20fd023SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*a20fd023SAndrew Rist * software distributed under the License is distributed on an 15*a20fd023SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*a20fd023SAndrew Rist * KIND, either express or implied. See the License for the 17*a20fd023SAndrew Rist * specific language governing permissions and limitations 18*a20fd023SAndrew Rist * under the License. 19*a20fd023SAndrew Rist * 20*a20fd023SAndrew Rist *************************************************************/ 21*a20fd023SAndrew Rist 22*a20fd023SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _EMBEDDOCACCESS_HXX_ 25cdf0e10cSrcweir #define _EMBEDDOCACCESS_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <cppuhelper/weak.hxx> 28cdf0e10cSrcweir 29cdf0e10cSrcweir #define OLESERV_SAVEOBJECT 1 30cdf0e10cSrcweir #define OLESERV_CLOSE 2 31cdf0e10cSrcweir #define OLESERV_NOTIFY 3 32cdf0e10cSrcweir #define OLESERV_NOTIFYCLOSING 4 33cdf0e10cSrcweir #define OLESERV_SHOWOBJECT 5 34cdf0e10cSrcweir #define OLESERV_DEACTIVATE 6 35cdf0e10cSrcweir 36cdf0e10cSrcweir #include <oleidl.h> 37cdf0e10cSrcweir #ifndef __MINGW32__ 38cdf0e10cSrcweir #if defined(_MSC_VER) && (_MSC_VER > 1310) 39cdf0e10cSrcweir #pragma warning(disable : 4265) 40cdf0e10cSrcweir #include <atldbcli.h> 41cdf0e10cSrcweir #else 42cdf0e10cSrcweir #include <atlcomcli.h> 43cdf0e10cSrcweir #endif 44cdf0e10cSrcweir #endif 45cdf0e10cSrcweir #include <cppuhelper/weak.hxx> 46cdf0e10cSrcweir 47cdf0e10cSrcweir class EmbedDocument_Impl; 48cdf0e10cSrcweir struct LockedEmbedDocument_Impl 49cdf0e10cSrcweir { 50cdf0e10cSrcweir private: 51cdf0e10cSrcweir EmbedDocument_Impl* m_pEmbedDocument; 52cdf0e10cSrcweir 53cdf0e10cSrcweir public: 54cdf0e10cSrcweir LockedEmbedDocument_Impl(); 55cdf0e10cSrcweir LockedEmbedDocument_Impl( EmbedDocument_Impl* pEmbedDocument ); 56cdf0e10cSrcweir LockedEmbedDocument_Impl( const LockedEmbedDocument_Impl& aDocLock ); 57cdf0e10cSrcweir 58cdf0e10cSrcweir ~LockedEmbedDocument_Impl(); 59cdf0e10cSrcweir 60cdf0e10cSrcweir LockedEmbedDocument_Impl& operator=( const LockedEmbedDocument_Impl& aDocLock ); 61cdf0e10cSrcweir GetEmbedDocumentLockedEmbedDocument_Impl62cdf0e10cSrcweir EmbedDocument_Impl* GetEmbedDocument() { return m_pEmbedDocument; } 63cdf0e10cSrcweir 64cdf0e10cSrcweir void ExecuteMethod( sal_Int16 nId ); 65cdf0e10cSrcweir }; 66cdf0e10cSrcweir 67cdf0e10cSrcweir class EmbeddedDocumentInstanceAccess_Impl : public ::cppu::OWeakObject 68cdf0e10cSrcweir { 69cdf0e10cSrcweir ::osl::Mutex m_aMutex; 70cdf0e10cSrcweir EmbedDocument_Impl* m_pEmbedDocument; 71cdf0e10cSrcweir 72cdf0e10cSrcweir public: EmbeddedDocumentInstanceAccess_Impl(EmbedDocument_Impl * pDoc)73cdf0e10cSrcweir EmbeddedDocumentInstanceAccess_Impl( EmbedDocument_Impl* pDoc ) 74cdf0e10cSrcweir : m_pEmbedDocument( pDoc ) 75cdf0e10cSrcweir {} 76cdf0e10cSrcweir 77cdf0e10cSrcweir LockedEmbedDocument_Impl GetEmbedDocument(); 78cdf0e10cSrcweir void ClearEmbedDocument(); 79cdf0e10cSrcweir }; 80cdf0e10cSrcweir 81cdf0e10cSrcweir #endif 82