LibreOffice Module oox (master) 1
|
Provides helper functions for colors, device measurement conversion, graphics, and graphic objects handling. More...
#include <graphichelper.hxx>
Public Member Functions | |
GraphicHelper (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XFrame > &rxTargetFrame, StorageRef xStorage) | |
virtual | ~GraphicHelper () |
GraphicHelper (const GraphicHelper &)=delete | |
GraphicHelper (GraphicHelper &&)=delete | |
GraphicHelper & | operator= (const GraphicHelper &)=delete |
GraphicHelper & | operator= (GraphicHelper &&)=delete |
::Color | getSystemColor (sal_Int32 nToken, ::Color nDefaultRgb=API_RGB_TRANSPARENT) const |
Returns a system color specified by the passed XML token identifier. More... | |
virtual ::Color | getSchemeColor (sal_Int32 nToken) const |
Derived classes may implement to resolve a scheme color from the passed XML token identifier. More... | |
virtual ::Color | getPaletteColor (sal_Int32 nPaletteIdx) const |
Derived classes may implement to resolve a palette index to an RGB color. More... | |
virtual sal_Int32 | getDefaultChartAreaFillStyle () const |
const css::awt::DeviceInfo & | getDeviceInfo () const |
Returns information about the output device. More... | |
sal_Int32 | convertScreenPixelXToHmm (double fPixelX) const |
Converts the passed value from horizontal screen pixels to 1/100 mm. More... | |
sal_Int32 | convertScreenPixelYToHmm (double fPixelY) const |
Converts the passed value from vertical screen pixels to 1/100 mm. More... | |
css::awt::Size | convertScreenPixelToHmm (const css::awt::Size &rPixel) const |
Converts the passed size from screen pixels to 1/100 mm. More... | |
double | convertHmmToScreenPixelX (sal_Int32 nHmmX) const |
Converts the passed value from 1/100 mm to horizontal screen pixels. More... | |
double | convertHmmToScreenPixelY (sal_Int32 nHmmY) const |
Converts the passed value from 1/100 mm to vertical screen pixels. More... | |
css::awt::Point | convertHmmToScreenPixel (const css::awt::Point &rHmm) const |
Converts the passed point from 1/100 mm to screen pixels. More... | |
css::awt::Size | convertHmmToScreenPixel (const css::awt::Size &rHmm) const |
Converts the passed size from 1/100 mm to screen pixels. More... | |
css::awt::Point | convertHmmToAppFont (const css::awt::Point &rHmm) const |
Converts the passed point from 1/100 mm to AppFont units. More... | |
css::awt::Size | convertHmmToAppFont (const css::awt::Size &rHmm) const |
Converts the passed size from 1/100 mm to AppFont units. More... | |
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. More... | |
css::uno::Reference< css::graphic::XGraphic > | importGraphic (const StreamDataSequence &rGraphicData) const |
Imports a graphic from the passed binary memory block. More... | |
css::uno::Reference< css::graphic::XGraphic > | importEmbeddedGraphic (const OUString &rStreamName, const WmfExternal *pExtHeader=nullptr) const |
Imports a graphic from the storage stream with the passed path and name. More... | |
css::awt::Size | getOriginalSize (const css::uno::Reference< css::graphic::XGraphic > &rxGraphic) const |
calculates the original size of a graphic which is necessary to be able to calculate cropping values More... | |
void | setGraphicMapper (css::uno::Reference< css::graphic::XGraphicMapper > const &rxGraphicMapper) |
void | initializeGraphicMapperIfNeeded () const |
Static Public Member Functions | |
static sal_Int32 | getDefaultChartAreaLineStyle () |
Returns chartspace automatic default border style. More... | |
static sal_Int16 | getDefaultChartAreaLineWidth () |
Returns chartspace automatic default border width in Emu. More... | |
Private Attributes | |
css::uno::Reference< css::uno::XComponentContext > | mxContext |
css::uno::Reference< css::graphic::XGraphicProvider2 > | mxGraphicProvider |
VclPtr< OutputDevice > | mxDefaultOutputDevice |
css::awt::DeviceInfo | maDeviceInfo |
Current output device info. More... | |
::std::map< sal_Int32, ::Color > | maSystemPalette |
Maps system colors (XML tokens) to RGB color values. More... | |
StorageRef | mxStorage |
Storage containing embedded graphics. More... | |
double | mfPixelPerHmmX |
Number of screen pixels per 1/100 mm in X direction. More... | |
double | mfPixelPerHmmY |
Number of screen pixels per 1/100 mm in Y direction. More... | |
css::uno::Reference< css::graphic::XGraphicMapper > | mxGraphicMapper |
Provides helper functions for colors, device measurement conversion, graphics, and graphic objects handling.
Definition at line 58 of file graphichelper.hxx.
|
explicit |
|
virtual |
Definition at line 114 of file graphichelper.cxx.
|
delete |
|
delete |
css::awt::Point oox::GraphicHelper::convertHmmToAppFont | ( | const css::awt::Point & | rHmm | ) | const |
Converts the passed point from 1/100 mm to AppFont units.
Referenced by oox::ole::ControlConverter::convertPosition(), oox::ole::ControlConverter::convertScrollabilitySettings(), and oox::ole::ControlConverter::convertSize().
css::awt::Size oox::GraphicHelper::convertHmmToAppFont | ( | const css::awt::Size & | rHmm | ) | const |
Converts the passed size from 1/100 mm to AppFont units.
css::awt::Point oox::GraphicHelper::convertHmmToScreenPixel | ( | const css::awt::Point & | rHmm | ) | const |
Converts the passed point from 1/100 mm to screen pixels.
css::awt::Size oox::GraphicHelper::convertHmmToScreenPixel | ( | const css::awt::Size & | rHmm | ) | const |
Converts the passed size from 1/100 mm to screen pixels.
double GraphicHelper::convertHmmToScreenPixelX | ( | sal_Int32 | nHmmX | ) | const |
Converts the passed value from 1/100 mm to horizontal screen pixels.
Definition at line 170 of file graphichelper.cxx.
double GraphicHelper::convertHmmToScreenPixelY | ( | sal_Int32 | nHmmY | ) | const |
Converts the passed value from 1/100 mm to vertical screen pixels.
Definition at line 175 of file graphichelper.cxx.
awt::Size GraphicHelper::convertScreenPixelToHmm | ( | const css::awt::Size & | rPixel | ) | const |
Converts the passed size from screen pixels to 1/100 mm.
Definition at line 165 of file graphichelper.cxx.
sal_Int32 GraphicHelper::convertScreenPixelXToHmm | ( | double | fPixelX | ) | const |
Converts the passed value from horizontal screen pixels to 1/100 mm.
Definition at line 155 of file graphichelper.cxx.
Referenced by oox::vml::ConversionHelper::decodeMeasureToEmu().
sal_Int32 GraphicHelper::convertScreenPixelYToHmm | ( | double | fPixelY | ) | const |
Converts the passed value from vertical screen pixels to 1/100 mm.
Definition at line 160 of file graphichelper.cxx.
Referenced by oox::vml::ConversionHelper::decodeMeasureToEmu().
|
virtual |
Definition at line 137 of file graphichelper.cxx.
|
static |
Returns chartspace automatic default border style.
Definition at line 142 of file graphichelper.cxx.
|
static |
Returns chartspace automatic default border width in Emu.
Definition at line 147 of file graphichelper.cxx.
|
inline |
Returns information about the output device.
Definition at line 94 of file graphichelper.hxx.
awt::Size GraphicHelper::getOriginalSize | ( | const css::uno::Reference< css::graphic::XGraphic > & | rxGraphic | ) | const |
calculates the original size of a graphic which is necessary to be able to calculate cropping values
Definition at line 295 of file graphichelper.cxx.
References oox::PropertySet::getProperty().
Referenced by oox::vml::SimpleShape::createPictureObject(), oox::drawingml::GraphicProperties::pushToPropMap(), and oox::drawingml::FillProperties::pushToPropMap().
Color GraphicHelper::getPaletteColor | ( | sal_Int32 | nPaletteIdx | ) | const |
Derived classes may implement to resolve a palette index to an RGB color.
Definition at line 131 of file graphichelper.cxx.
References oox::API_RGB_TRANSPARENT.
Referenced by oox::ole::OleHelper::decodeOleColor(), and oox::drawingml::Color::getColor().
Color GraphicHelper::getSchemeColor | ( | sal_Int32 | nToken | ) | const |
Derived classes may implement to resolve a scheme color from the passed XML token identifier.
Definition at line 125 of file graphichelper.cxx.
References oox::API_RGB_TRANSPARENT.
Referenced by oox::drawingml::Color::getColor().
Color GraphicHelper::getSystemColor | ( | sal_Int32 | nToken, |
::Color | nDefaultRgb = API_RGB_TRANSPARENT |
||
) | const |
Returns a system color specified by the passed XML token identifier.
Definition at line 120 of file graphichelper.cxx.
References nToken.
Referenced by oox::vml::ConversionHelper::decodeColor(), oox::ole::OleHelper::decodeOleColor(), and oox::drawingml::Color::getColor().
Reference< XGraphic > GraphicHelper::importEmbeddedGraphic | ( | const OUString & | rStreamName, |
const WmfExternal * | pExtHeader = nullptr |
||
) | const |
Imports a graphic from the storage stream with the passed path and name.
Definition at line 272 of file graphichelper.cxx.
References mxStorage, SAL_WARN_IF, and xStream.
Referenced by oox::drawingml::BlipContext::BlipContext(), oox::vml::SimpleShape::createEmbeddedPictureObject(), oox::drawingml::Shape::finalizeServiceName(), and oox::vml::FillModel::pushToPropMap().
css::uno::Reference< css::graphic::XGraphic > oox::GraphicHelper::importGraphic | ( | const css::uno::Reference< css::io::XInputStream > & | rxInStrm, |
const WmfExternal * | pExtHeader = nullptr |
||
) | const |
Imports a graphic from the passed input stream.
Referenced by oox::ole::ControlConverter::convertPicture().
Reference< XGraphic > GraphicHelper::importGraphic | ( | const StreamDataSequence & | rGraphicData | ) | const |
Imports a graphic from the passed binary memory block.
Definition at line 261 of file graphichelper.cxx.
void GraphicHelper::initializeGraphicMapperIfNeeded | ( | ) | const |
Definition at line 313 of file graphichelper.cxx.
References mxContext, and mxGraphicMapper.
|
delete |
|
delete |
void GraphicHelper::setGraphicMapper | ( | css::uno::Reference< css::graphic::XGraphicMapper > const & | rxGraphicMapper | ) |
Definition at line 308 of file graphichelper.cxx.
Referenced by oox::shape::ShapeFilterBase::implCreateGraphicHelper().
|
private |
Current output device info.
Definition at line 148 of file graphichelper.hxx.
|
private |
Maps system colors (XML tokens) to RGB color values.
Definition at line 149 of file graphichelper.hxx.
|
private |
Number of screen pixels per 1/100 mm in X direction.
Definition at line 151 of file graphichelper.hxx.
|
private |
Number of screen pixels per 1/100 mm in Y direction.
Definition at line 152 of file graphichelper.hxx.
|
private |
Definition at line 145 of file graphichelper.hxx.
|
private |
Definition at line 147 of file graphichelper.hxx.
|
private |
Definition at line 153 of file graphichelper.hxx.
Referenced by initializeGraphicMapperIfNeeded().
|
private |
Definition at line 146 of file graphichelper.hxx.
|
private |
Storage containing embedded graphics.
Definition at line 150 of file graphichelper.hxx.