Bump version to 6.4.0.12
[LibreOffice.git] / embeddedobj / source / msole / ownview.hxx
blob4afcb9e80b17b5fc31b3083095bffc45f29ea399
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_EMBEDDEDOBJ_SOURCE_MSOLE_OWNVIEW_HXX
21 #define INCLUDED_EMBEDDEDOBJ_SOURCE_MSOLE_OWNVIEW_HXX
23 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
24 #include <com/sun/star/util/XCloseListener.hpp>
25 #include <com/sun/star/document/XEventListener.hpp>
26 #include <com/sun/star/frame/XModel.hpp>
27 #include <com/sun/star/io/XInputStream.hpp>
28 #include <cppuhelper/implbase.hxx>
30 #include <osl/mutex.hxx>
32 class OwnView_Impl : public ::cppu::WeakImplHelper < css::util::XCloseListener,
33 css::document::XEventListener >
35 ::osl::Mutex m_aMutex;
37 css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory;
38 css::uno::Reference< css::frame::XModel > m_xModel;
40 OUString m_aTempFileURL;
41 OUString m_aNativeTempURL;
43 OUString m_aFilterName;
45 bool m_bBusy;
47 bool m_bUseNative;
49 private:
50 bool CreateModelFromURL( const OUString& aFileURL );
52 bool CreateModel( bool bUseNative );
54 bool ReadContentsAndGenerateTempFile( const css::uno::Reference< css::io::XInputStream >& xStream, bool bParseHeader );
56 void CreateNative();
58 public:
59 static OUString GetFilterNameFromExtentionAndInStream(
60 const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory,
61 const OUString& aNameWithExtention,
62 const css::uno::Reference< css::io::XInputStream >& xInputStream );
64 OwnView_Impl( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory,
65 const css::uno::Reference< css::io::XInputStream >& xStream );
66 virtual ~OwnView_Impl() override;
68 bool Open();
70 void Close();
72 virtual void SAL_CALL notifyEvent( const css::document::EventObject& Event ) override;
74 virtual void SAL_CALL queryClosing( const css::lang::EventObject& Source, sal_Bool GetsOwnership ) override;
75 virtual void SAL_CALL notifyClosing( const css::lang::EventObject& Source ) override;
77 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
80 #endif
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */