merge the formfield patch from ooo-build
[ooovba.git] / embeddedobj / source / msole / ownview.hxx
blob9d65bb13b090fef2b2e5f616270d493024a3ae37
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ownview.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __OWNVIEW_HXX_
32 #define __OWNVIEW_HXX_
34 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
35 #include <com/sun/star/util/XCloseListener.hpp>
36 #include <com/sun/star/document/XEventListener.hpp>
37 #include <com/sun/star/frame/XModel.hpp>
38 #include <com/sun/star/io/XStream.hpp>
39 #include <com/sun/star/io/XInputStream.hpp>
40 #include <cppuhelper/implbase2.hxx>
42 #include <osl/mutex.hxx>
44 class OwnView_Impl : public ::cppu::WeakImplHelper2 < ::com::sun::star::util::XCloseListener,
45 ::com::sun::star::document::XEventListener >
47 ::osl::Mutex m_aMutex;
49 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
50 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel;
52 ::rtl::OUString m_aTempFileURL;
53 ::rtl::OUString m_aNativeTempURL;
55 ::rtl::OUString m_aFilterName;
57 sal_Bool m_bBusy;
59 sal_Bool m_bUseNative;
61 private:
62 sal_Bool CreateModelFromURL( const ::rtl::OUString& aFileURL );
64 sal_Bool CreateModel( sal_Bool bUseNative );
66 sal_Bool ReadContentsAndGenerateTempFile( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xStream, sal_Bool bParseHeader );
68 void CreateNative();
70 public:
71 static ::rtl::OUString GetFilterNameFromExtentionAndInStream(
72 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
73 const ::rtl::OUString& aNameWithExtention,
74 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInputStream );
76 OwnView_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
77 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xStream );
78 virtual ~OwnView_Impl();
80 sal_Bool Open();
82 void Close();
84 virtual void SAL_CALL notifyEvent( const ::com::sun::star::document::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
86 virtual void SAL_CALL queryClosing( const ::com::sun::star::lang::EventObject& Source, sal_Bool GetsOwnership ) throw (::com::sun::star::util::CloseVetoException, ::com::sun::star::uno::RuntimeException);
87 virtual void SAL_CALL notifyClosing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
89 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
92 #endif