26#include <com/sun/star/beans/PropertyAttribute.hpp>
27#include <com/sun/star/awt/Size.hpp>
28#include <com/sun/star/graphic/GraphicType.hpp>
29#include <com/sun/star/io/XInputStream.hpp>
38enum class UnoGraphicProperty
60 ::
comphelper::PropertySetHelper( createPropertySetInfo() ),
64 mbTransparent ( false )
111 sal_uInt8 cType = graphic::GraphicType::EMPTY;
148 if( graphic::GraphicType::EMPTY != cType )
165 aAny <<= uno::Reference< lang::XServiceInfo >(
this);
167 aAny <<= uno::Reference< lang::XTypeProvider >(
this);
169 aAny <<= uno::Reference< beans::XPropertySet >(
this);
171 aAny <<= uno::Reference< beans::XPropertyState >(
this);
173 aAny <<= uno::Reference< beans::XMultiPropertySet >(
this);
175 aAny = OWeakObject::queryInterface( rType );
184 OWeakObject::acquire();
191 OWeakObject::release();
197 return "com.sun.star.comp.graphic.GraphicDescriptor";
208 return {
"com.sun.star.graphic.GraphicDescriptor" };
214 static const uno::Sequence< uno::Type >
aTypes {
226 return css::uno::Sequence<sal_Int8>();
232 static ::comphelper::PropertyMapEntry
const aEntries[] =
235 { OUString(
"MimeType" ),
static_cast< sal_Int32
>( UnoGraphicProperty::MimeType ),
cppu::UnoType< OUString >::get(), beans::PropertyAttribute::READONLY, 0 },
236 { OUString(
"SizePixel" ),
static_cast< sal_Int32
>( UnoGraphicProperty::SizePixel ),
cppu::UnoType< awt::Size >::get(), beans::PropertyAttribute::READONLY, 0 },
237 { OUString(
"Size100thMM" ),
static_cast< sal_Int32
>( UnoGraphicProperty::Size100thMM ),
cppu::UnoType< awt::Size >::get(), beans::PropertyAttribute::READONLY, 0 },
238 { OUString(
"BitsPerPixel" ),
static_cast< sal_Int32
>( UnoGraphicProperty::BitsPerPixel ),
cppu::UnoType< sal_uInt8 >::get(), beans::PropertyAttribute::READONLY, 0 },
239 { OUString(
"Transparent" ),
static_cast< sal_Int32
>( UnoGraphicProperty::Transparent ),
cppu::UnoType< sal_Bool >::get(), beans::PropertyAttribute::READONLY, 0 },
240 { OUString(
"Alpha" ),
static_cast< sal_Int32
>( UnoGraphicProperty::Alpha ),
cppu::UnoType< sal_Bool >::get(), beans::PropertyAttribute::READONLY, 0 },
241 { OUString(
"Animated" ),
static_cast< sal_Int32
>( UnoGraphicProperty::Animated ),
cppu::UnoType< sal_Bool >::get(), beans::PropertyAttribute::READONLY, 0 },
243 { OUString(
"OriginURL"), sal_Int32(UnoGraphicProperty::OriginURL),
cppu::UnoType<OUString>::get(), beans::PropertyAttribute::READONLY, 0 },
262 UnoGraphicProperty theProperty =
static_cast< UnoGraphicProperty
>( (*ppEntries)->mnHandle );
263 switch( theProperty )
271 graphic::GraphicType::EMPTY ) );
275 case UnoGraphicProperty::MimeType:
318 case UnoGraphicProperty::SizePixel:
320 awt::Size aAWTSize( 0, 0 );
327 aAWTSize = awt::Size( aSizePix.
Width(), aSizePix.
Height() );
337 case UnoGraphicProperty::Size100thMM:
339 awt::Size aAWTSize( 0, 0 );
343 if(
mpGraphic->GetPrefMapMode().GetMapUnit() != MapUnit::MapPixel )
348 MapMode(MapUnit::Map100thMM)) );
349 aAWTSize = awt::Size( aSizeLog.
Width(), aSizeLog.
Height() );
359 case UnoGraphicProperty::BitsPerPixel:
361 sal_uInt16 nBitsPerPixel = 0;
367 auto ePixelFormat =
mpGraphic->GetBitmapEx().GetBitmap().getPixelFormat();
374 *pValues <<= sal::static_int_cast< sal_Int8 >(nBitsPerPixel);
378 case UnoGraphicProperty::Transparent:
384 case UnoGraphicProperty::Alpha:
390 case UnoGraphicProperty::Animated:
396 case UnoGraphicProperty::Linked:
402 case UnoGraphicProperty::OriginURL:
const PropertyValue * pValues
constexpr OUStringLiteral MIMETYPE_MET
constexpr OUStringLiteral MIMETYPE_TIF
constexpr OUStringLiteral MIMETYPE_EPS
constexpr OUStringLiteral MIMETYPE_JPG
constexpr OUStringLiteral MIMETYPE_XPM
constexpr OUStringLiteral MIMETYPE_PDF
constexpr OUStringLiteral MIMETYPE_DXF
constexpr OUStringLiteral MIMETYPE_SVG
constexpr OUStringLiteral MIMETYPE_WMF
constexpr OUStringLiteral MIMETYPE_WEBP
constexpr OUStringLiteral MIMETYPE_TGA
constexpr OUStringLiteral MIMETYPE_RAS
constexpr OUStringLiteral MIMETYPE_PNG
constexpr OUStringLiteral MIMETYPE_XBM
constexpr OUStringLiteral MIMETYPE_VCLGRAPHIC
constexpr OUStringLiteral MIMETYPE_PCX
constexpr OUStringLiteral MIMETYPE_PBM
constexpr OUStringLiteral MIMETYPE_PSD
constexpr OUStringLiteral MIMETYPE_PGM
constexpr OUStringLiteral MIMETYPE_EMF
constexpr OUStringLiteral MIMETYPE_PCD
constexpr OUStringLiteral MIMETYPE_PPM
constexpr OUStringLiteral MIMETYPE_BMP
constexpr OUStringLiteral MIMETYPE_GIF
constexpr OUStringLiteral MIMETYPE_PCT
constexpr OUStringLiteral MIMETYPE_SVM
GfxLinkType GetType() const
sal_uInt16 GetBitsPerPixel() const
bool Detect(bool bExtendedInfo=false)
starts the detection
const Size & GetSize_100TH_MM() const
GraphicFileFormat GetFileFormat() const
const Size & GetSizePixel() const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
css::uno::Type const & get()
virtual void _setPropertyValues(const comphelper::PropertyMapEntry **ppEntries, const css::uno::Any *pValues) override
static rtl::Reference<::comphelper::PropertySetInfo > createPropertySetInfo()
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual void SAL_CALL release() noexcept override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
const ::Graphic * mpGraphic
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
sal_uInt16 mnBitsPerPixel
virtual ~GraphicDescriptor() noexcept override
void init(const ::Graphic &rGraphic)
virtual void _getPropertyValues(const comphelper::PropertyMapEntry **ppEntries, css::uno::Any *pValue) override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual void SAL_CALL acquire() noexcept override
void implCreate(SvStream &rIStm, const OUString *pPath)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
static std::unique_ptr< SvStream > CreateStream(const OUString &rFileName, StreamMode eOpenMode, css::uno::Reference< css::awt::XWindow > xParentWin=nullptr)
ScXMLEditAttributeMap::Entry const aEntries[]
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
constexpr sal_uInt16 pixelFormatBitCount(PixelFormat ePixelFormat)
const sal_Unicode *const aMimeType[]