20#ifndef INCLUDED_OOX_HELPER_GRAPHICHELPER_HXX
21#define INCLUDED_OOX_HELPER_GRAPHICHELPER_HXX
25#include <com/sun/star/awt/DeviceInfo.hpp>
26#include <com/sun/star/uno/Reference.hxx>
31#include <rtl/ustring.hxx>
33#include <com/sun/star/graphic/XGraphicProvider2.hpp>
34#include <com/sun/star/graphic/XGraphicMapper.hpp>
41 namespace awt {
struct Point; }
42 namespace awt {
struct Size; }
43 namespace awt {
class XUnitConversion; }
44 namespace io {
class XInputStream; }
45 namespace frame {
class XFrame; }
46 namespace graphic {
class XGraphic; }
47 namespace graphic {
class XGraphicObject; }
48 namespace graphic {
class XGraphicProvider; }
49 namespace uno {
class XComponentContext; }
62 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
63 const css::uno::Reference< css::frame::XFrame >& rxTargetFrame,
79 virtual ::Color getSchemeColor( sal_Int32 nToken )
const;
81 virtual ::Color getPaletteColor( sal_Int32 nPaletteIdx )
const;
83 virtual sal_Int32 getDefaultChartAreaFillStyle()
const;
86 static sal_Int32 getDefaultChartAreaLineStyle();
89 static sal_Int16 getDefaultChartAreaLineWidth();
94 const css::awt::DeviceInfo&
getDeviceInfo()
const {
return maDeviceInfo;}
97 sal_Int32 convertScreenPixelXToHmm(
double fPixelX )
const;
99 sal_Int32 convertScreenPixelYToHmm(
double fPixelY )
const;
101 css::awt::Size convertScreenPixelToHmm(
const css::awt::Size& rPixel )
const;
104 double convertHmmToScreenPixelX( sal_Int32 nHmmX )
const;
106 double convertHmmToScreenPixelY( sal_Int32 nHmmY )
const;
121 css::uno::Reference< css::graphic::XGraphic >
123 const css::uno::Reference< css::io::XInputStream >& rxInStrm,
127 css::uno::Reference< css::graphic::XGraphic >
131 css::uno::Reference< css::graphic::XGraphic >
132 importEmbeddedGraphic(
133 const OUString& rStreamName,
138 css::awt::Size getOriginalSize(
const css::uno::Reference< css::graphic::XGraphic >& rxGraphic )
const;
140 void setGraphicMapper(css::uno::Reference<css::graphic::XGraphicMapper>
const & rxGraphicMapper);
142 void initializeGraphicMapperIfNeeded()
const;
145 css::uno::Reference< css::uno::XComponentContext >
mxContext;
Provides helper functions for colors, device measurement conversion, graphics, and graphic objects ha...
const css::awt::DeviceInfo & getDeviceInfo() const
Returns information about the output device.
double mfPixelPerHmmY
Number of screen pixels per 1/100 mm in Y direction.
css::uno::Reference< css::graphic::XGraphic > importGraphic(const css::uno::Reference< css::io::XInputStream > &rxInStrm, const WmfExternal *pExtHeader=nullptr) const
Imports a graphic from the passed input stream.
css::awt::DeviceInfo maDeviceInfo
Current output device info.
GraphicHelper(const GraphicHelper &)=delete
::std::map< sal_Int32, ::Color > maSystemPalette
Maps system colors (XML tokens) to RGB color values.
css::uno::Reference< css::graphic::XGraphicProvider2 > mxGraphicProvider
StorageRef mxStorage
Storage containing embedded graphics.
css::awt::Size convertHmmToAppFont(const css::awt::Size &rHmm) const
Converts the passed size from 1/100 mm to AppFont units.
css::uno::Reference< css::uno::XComponentContext > mxContext
css::uno::Reference< css::graphic::XGraphicMapper > mxGraphicMapper
GraphicHelper & operator=(const GraphicHelper &)=delete
double mfPixelPerHmmX
Number of screen pixels per 1/100 mm in X direction.
GraphicHelper & operator=(GraphicHelper &&)=delete
VclPtr< OutputDevice > mxDefaultOutputDevice
GraphicHelper(GraphicHelper &&)=delete
css::awt::Size convertHmmToScreenPixel(const css::awt::Size &rHmm) const
Converts the passed size from 1/100 mm to screen pixels.
GraphicHelper(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XFrame > &rxTargetFrame, StorageRef xStorage)
css::awt::Point convertHmmToScreenPixel(const css::awt::Point &rHmm) const
Converts the passed point from 1/100 mm to screen pixels.
css::awt::Point convertHmmToAppFont(const css::awt::Point &rHmm) const
Converts the passed point from 1/100 mm to AppFont units.
std::shared_ptr< StorageBase > StorageRef
css::uno::Sequence< sal_Int8 > StreamDataSequence
const ::Color API_RGB_TRANSPARENT(ColorTransparency, 0xffffffff)
Transparent color for API calls.