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>
28
30
31namespace com::sun::star::rendering { class XCanvas; }
32
33/* Definition of CachedPrimitiveBase class */
34
35namespace canvas
36{
37 typedef cppu::WeakComponentImplHelper< css::rendering::XCachedPrimitive,
38 css::lang::XServiceInfo > CachedPrimitiveBase_Base;
39
45 {
46 public:
47
56 CachedPrimitiveBase( css::rendering::ViewState rUsedViewState,
57 css::uno::Reference< css::rendering::XCanvas > xTarget );
58
60 virtual void SAL_CALL disposing() override;
61
62 // XCachedPrimitive
63 virtual ::sal_Int8 SAL_CALL redraw( const css::rendering::ViewState& aState ) override;
64
65 // XServiceInfo
66 virtual OUString SAL_CALL getImplementationName( ) override;
67 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
68 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
69
70 protected:
71 virtual ~CachedPrimitiveBase() override; // we're a ref-counted UNO class. _We_ destroy ourselves.
72
73 private:
76
94 virtual ::sal_Int8 doRedraw( const css::rendering::ViewState& rNewState,
95 const css::rendering::ViewState& rOldState,
96 const css::uno::Reference< css::rendering::XCanvas >& rTargetCanvas,
97 bool bSameViewTransform ) = 0;
98
99 css::rendering::ViewState maUsedViewState;
100 css::uno::Reference< css::rendering::XCanvas > mxTarget;
101 };
102}
103
104/* 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.
cppu::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