tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / canvas / inc / base / integerbitmapbase.hxx
blob43c4401c5ac5949ff10182753c40e67bfb64f8b5
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 <com/sun/star/rendering/IntegerBitmapLayout.hpp>
23 #include <verifyinput.hxx>
26 namespace canvas
28 /** Helper template to handle XIntegerBitmap method forwarding to
29 BitmapCanvasHelper
31 Use this helper to handle the XIntegerBitmap part of your
32 implementation.
34 @tpl Base
35 Either BitmapCanvasBase (just XBitmap) or BitmapCanvasBase2 (XBitmap and
36 XBitmapCanvas).
38 template< class Base > class IntegerBitmapBase :
39 public Base
41 public:
42 // XIntegerBitmap
43 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getData( css::rendering::IntegerBitmapLayout& bitmapLayout,
44 const css::geometry::IntegerRectangle2D& rect ) override
46 tools::verifyArgs(rect,
47 __func__,
48 static_cast< typename Base::UnambiguousBaseType* >(this));
49 tools::verifyIndexRange(rect, Base::getSize() );
51 typename Base::MutexType aGuard( Base::m_aMutex );
53 return Base::maCanvasHelper.getData( bitmapLayout,
54 rect );
57 virtual void SAL_CALL setData( const css::uno::Sequence< sal_Int8 >&,
58 const css::rendering::IntegerBitmapLayout& bitmapLayout,
59 const css::geometry::IntegerRectangle2D& rect ) override
61 tools::verifyArgs(bitmapLayout, rect,
62 __func__,
63 static_cast< typename Base::UnambiguousBaseType* >(this));
64 tools::verifyIndexRange(rect, Base::getSize() );
66 typename Base::MutexType aGuard( Base::m_aMutex );
68 Base::mbSurfaceDirty = true;
71 virtual void SAL_CALL setPixel( const css::uno::Sequence< sal_Int8 >&,
72 const css::rendering::IntegerBitmapLayout& bitmapLayout,
73 const css::geometry::IntegerPoint2D& pos ) override
75 tools::verifyArgs(bitmapLayout, pos,
76 __func__,
77 static_cast< typename Base::UnambiguousBaseType* >(this));
78 tools::verifyIndexRange(pos, Base::getSize() );
80 typename Base::MutexType aGuard( Base::m_aMutex );
82 Base::mbSurfaceDirty = true;
85 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getPixel( css::rendering::IntegerBitmapLayout& bitmapLayout,
86 const css::geometry::IntegerPoint2D& pos ) override
88 tools::verifyArgs(pos,
89 __func__,
90 static_cast< typename Base::UnambiguousBaseType* >(this));
91 tools::verifyIndexRange(pos, Base::getSize() );
93 typename Base::MutexType aGuard( Base::m_aMutex );
95 return Base::maCanvasHelper.getPixel( bitmapLayout,
96 pos );
99 virtual css::rendering::IntegerBitmapLayout SAL_CALL getMemoryLayout( ) override
101 typename Base::MutexType aGuard( Base::m_aMutex );
103 return Base::maCanvasHelper.getMemoryLayout();
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */