fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / canvas / source / vcl / canvas.hxx
blob10bee3b487833a11fc6a8d83cf52b8dfedf08b84
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 #ifndef _VCLCANVAS_CANVAS_HXX_
21 #define _VCLCANVAS_CANVAS_HXX_
23 #include <rtl/ref.hxx>
25 #include <com/sun/star/uno/XComponentContext.hpp>
26 #include <com/sun/star/beans/XPropertySet.hpp>
27 #include <com/sun/star/lang/XServiceName.hpp>
28 #include <com/sun/star/util/XUpdatable.hpp>
29 #include <com/sun/star/rendering/XBitmapCanvas.hpp>
30 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
31 #include <com/sun/star/rendering/XGraphicDevice.hpp>
32 #include <com/sun/star/rendering/XBufferController.hpp>
34 #include <cppuhelper/compbase7.hxx>
35 #include <comphelper/uno3.hxx>
37 #include <canvas/base/disambiguationhelper.hxx>
38 #include <canvas/base/integerbitmapbase.hxx>
39 #include <canvas/base/graphicdevicebase.hxx>
41 #include "canvashelper.hxx"
42 #include "impltools.hxx"
43 #include "devicehelper.hxx"
44 #include "repainttarget.hxx"
46 #define CANVAS_SERVICE_NAME "com.sun.star.rendering.Canvas.VCL"
47 #define CANVAS_IMPLEMENTATION_NAME "com.sun.star.comp.rendering.Canvas.VCL"
49 namespace vclcanvas
51 typedef ::cppu::WeakComponentImplHelper7< ::com::sun::star::rendering::XBitmapCanvas,
52 ::com::sun::star::rendering::XIntegerBitmap,
53 ::com::sun::star::rendering::XGraphicDevice,
54 ::com::sun::star::lang::XMultiServiceFactory,
55 ::com::sun::star::util::XUpdatable,
56 ::com::sun::star::beans::XPropertySet,
57 ::com::sun::star::lang::XServiceName > GraphicDeviceBase_Base;
58 typedef ::canvas::GraphicDeviceBase< ::canvas::DisambiguationHelper< GraphicDeviceBase_Base >,
59 DeviceHelper,
60 tools::LocalGuard,
61 ::cppu::OWeakObject > CanvasBase_Base;
62 typedef ::canvas::IntegerBitmapBase< CanvasBase_Base,
63 CanvasHelper,
64 tools::LocalGuard,
65 ::cppu::OWeakObject > CanvasBaseT;
67 /** Product of this component's factory.
69 The Canvas object combines the actual Window canvas with
70 the XGraphicDevice interface. This is because there's a
71 one-to-one relation between them, anyway, since each window
72 can have exactly one canvas and one associated
73 XGraphicDevice. And to avoid messing around with circular
74 references, this is implemented as one single object.
76 class Canvas : public CanvasBaseT,
77 public RepaintTarget
79 public:
80 Canvas( const ::com::sun::star::uno::Sequence<
81 ::com::sun::star::uno::Any >& aArguments,
82 const ::com::sun::star::uno::Reference<
83 ::com::sun::star::uno::XComponentContext >& rxContext );
85 void initialize();
87 /// For resource tracking
88 ~Canvas();
90 /// Dispose all internal references
91 virtual void disposeThis();
93 // Forwarding the XComponent implementation to the
94 // cppu::ImplHelper templated base
95 // Classname Base doing refcounting Base implementing the XComponent interface
96 // | | |
97 // V V V
98 DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( Canvas, GraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase );
100 // XServiceName
101 virtual OUString SAL_CALL getServiceName( ) throw (::com::sun::star::uno::RuntimeException);
103 // RepaintTarget
104 virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
105 const com::sun::star::rendering::ViewState& viewState,
106 const com::sun::star::rendering::RenderState& renderState,
107 const ::Point& rPt,
108 const ::Size& rSz,
109 const GraphicAttr& rAttr ) const;
111 private:
112 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > maArguments;
113 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxComponentContext;
116 typedef ::rtl::Reference< Canvas > CanvasRef;
119 #endif
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */