LibreOffice Module canvas (master) 1
cachedprimitivebase.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#pragma once
21
22#include <com/sun/star/uno/Reference.hxx>
23#include <com/sun/star/lang/XServiceInfo.hpp>
24#include <com/sun/star/rendering/XCachedPrimitive.hpp>
25#include <com/sun/star/rendering/ViewState.hpp>
27
29
30namespace com::sun::star::rendering { class XCanvas; }
31
32/* Definition of CachedPrimitiveBase class */
33
34namespace canvas
35{
36 typedef comphelper::WeakComponentImplHelper< css::rendering::XCachedPrimitive,
37 css::lang::XServiceInfo > CachedPrimitiveBase_Base;
38
44 {
45 public:
46
55 CachedPrimitiveBase( css::rendering::ViewState rUsedViewState,
56 css::uno::Reference< css::rendering::XCanvas > xTarget );
57
59 virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
60
61 // XCachedPrimitive
62 virtual ::sal_Int8 SAL_CALL redraw( const css::rendering::ViewState& aState ) override;
63
64 // XServiceInfo
65 virtual OUString SAL_CALL getImplementationName( ) override;
66 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
67 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
68
69 protected:
70 virtual ~CachedPrimitiveBase() override; // we're a ref-counted UNO class. _We_ destroy ourselves.
71
72 private:
75
93 virtual ::sal_Int8 doRedraw( const css::rendering::ViewState& rNewState,
94 const css::rendering::ViewState& rOldState,
95 const css::uno::Reference< css::rendering::XCanvas >& rTargetCanvas,
96 bool bSameViewTransform ) = 0;
97
98 css::rendering::ViewState maUsedViewState;
99 css::uno::Reference< css::rendering::XCanvas > mxTarget;
100 };
101}
102
103/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define CANVASTOOLS_DLLPUBLIC
Base class, providing common functionality for implementers of the XCachedPrimitive interface.
CachedPrimitiveBase & operator=(const CachedPrimitiveBase &)=delete
css::rendering::ViewState maUsedViewState
css::uno::Reference< css::rendering::XCanvas > mxTarget
CachedPrimitiveBase(css::rendering::ViewState rUsedViewState, css::uno::Reference< css::rendering::XCanvas > xTarget)
Create an XCachedPrimitive for given target canvas.
CachedPrimitiveBase(const CachedPrimitiveBase &)=delete
virtual ::sal_Int8 doRedraw(const css::rendering::ViewState &rNewState, const css::rendering::ViewState &rOldState, const css::uno::Reference< css::rendering::XCanvas > &rTargetCanvas, bool bSameViewTransform)=0
Actually perform the requested redraw.
comphelper::WeakComponentImplHelper< css::rendering::XCachedPrimitive, css::lang::XServiceInfo > CachedPrimitiveBase_Base
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
unsigned char sal_Bool