LibreOffice Module canvas (master)  1
dx_canvasbitmap.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_CANVAS_SOURCE_DIRECTX_DX_CANVASBITMAP_HXX
21 #define INCLUDED_CANVAS_SOURCE_DIRECTX_DX_CANVASBITMAP_HXX
22 
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/rendering/XBitmapCanvas.hpp>
25 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
26 #include <com/sun/star/beans/XFastPropertySet.hpp>
28 #include <cppuhelper/compbase.hxx>
32 
33 #include "dx_bitmapprovider.hxx"
35 #include "dx_devicehelper.hxx"
36 #include "dx_impltools.hxx"
37 #include "dx_ibitmap.hxx"
38 
39 
40 /* Definition of CanvasBitmap class */
41 
42 namespace dxcanvas
43 {
44  typedef ::cppu::WeakComponentImplHelper< css::rendering::XBitmapCanvas,
45  css::rendering::XIntegerBitmap,
46  css::lang::XServiceInfo,
47  css::beans::XFastPropertySet > CanvasBitmapBase_Base;
48  typedef ::canvas::IntegerBitmapBase<
52  ::osl::MutexGuard,
54 
55  class CanvasBitmap : public CanvasBitmap_Base, public BitmapProvider
56  {
57  public:
66  CanvasBitmap( const IBitmapSharedPtr& rSurface,
67  const DeviceRef& rDevice );
68 
70  virtual void disposeThis() override;
71 
72  // XServiceInfo
73  virtual OUString SAL_CALL getImplementationName( ) override;
74  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
75  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
76 
77  // BitmapProvider
78  virtual IBitmapSharedPtr getBitmap() const override { return mpBitmap; }
79 
80  virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) override;
81  virtual void SAL_CALL setFastPropertyValue(sal_Int32, const css::uno::Any&) override {}
82 
83  private:
89  };
90 }
91 
92 #endif // INCLUDED_CANVAS_SOURCE_DIRECTX_DX_CANVASBITMAP_HXX
93 
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Helper class for basic canvas functionality.
::canvas::IntegerBitmapBase< canvas::BitmapCanvasBase2< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >, BitmapCanvasHelper,::osl::MutexGuard,::cppu::OWeakObject > > CanvasBitmap_Base
std::shared_ptr< IBitmap > IBitmapSharedPtr
Definition: dx_ibitmap.hxx:59
IBitmapSharedPtr mpBitmap
CanvasBitmap(const IBitmapSharedPtr &rSurface, const DeviceRef &rDevice)
Create a canvas bitmap for the given surface.
virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) override
virtual void disposeThis() override
Dispose all internal references.
virtual IBitmapSharedPtr getBitmap() const override
unsigned char sal_Bool
::cppu::WeakComponentImplHelper< css::rendering::XBitmapCanvas, css::rendering::XIntegerBitmap, css::lang::XServiceInfo, css::beans::XFastPropertySet > CanvasBitmapBase_Base
virtual void SAL_CALL setFastPropertyValue(sal_Int32, const css::uno::Any &) override
DeviceRef mpDevice
MUST hold here, too, since CanvasHelper only contains a raw pointer (without refcounting) ...
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override