bump product version to 7.6.3.2-android
[LibreOffice.git] / forms / source / component / imgprod.hxx
blobbfcb2c66b0ee6294ea3f1ca4b9feabd4fb2061e9
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 #pragma once
22 #include <tools/link.hxx>
23 #include <com/sun/star/awt/XImageConsumer.hpp>
24 #include <com/sun/star/awt/XImageProducer.hpp>
25 #include <com/sun/star/lang/XInitialization.hpp>
26 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <cppuhelper/weak.hxx>
28 #include <vcl/graph.hxx>
29 #include <memory>
30 #include <optional>
31 #include <vector>
34 class SvStream;
35 namespace com::sun::star::io { class XInputStream; }
38 class ImageProducer : public css::awt::XImageProducer,
39 public css::lang::XInitialization,
40 public css::lang::XServiceInfo,
41 public ::cppu::OWeakObject
43 private:
45 typedef std::vector< css::uno::Reference< css::awt::XImageConsumer > > ConsumerList_t;
47 OUString maURL;
48 ConsumerList_t maConsList;
49 std::optional<Graphic>
50 moGraphic;
51 std::unique_ptr<SvStream>
52 mpStm;
53 sal_uInt32 mnTransIndex;
54 bool mbConsInit;
55 Link<Graphic*,void> maDoneHdl;
57 bool ImplImportGraphic( Graphic& rGraphic );
58 void ImplUpdateData( const Graphic& rGraphic );
59 void ImplInitConsumer( const Graphic& rGraphic );
60 void ImplUpdateConsumer( const Graphic& rGraphic );
62 public:
64 ImageProducer();
65 virtual ~ImageProducer() override;
67 void SetImage( const OUString& rPath );
68 void SetImage( SvStream& rStm );
70 void NewDataAvailable();
72 void SetDoneHdl( const Link<Graphic*,void>& i_rHdl ) { maDoneHdl = i_rHdl; }
74 // css::uno::XInterface
75 css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
76 void SAL_CALL acquire() noexcept override { OWeakObject::acquire(); }
77 void SAL_CALL release() noexcept override { OWeakObject::release(); }
79 // MT: ???
80 void setImage( css::uno::Reference< css::io::XInputStream > const & rStmRef );
82 // css::awt::XImageProducer
83 void SAL_CALL addConsumer( const css::uno::Reference< css::awt::XImageConsumer >& rxConsumer ) override;
84 void SAL_CALL removeConsumer( const css::uno::Reference< css::awt::XImageConsumer >& rxConsumer ) override;
85 void SAL_CALL startProduction( ) override;
87 // css::lang::XInitialization
88 void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
90 OUString SAL_CALL getImplementationName() override;
91 sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
92 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */