33 #include <com/sun/star/beans/PropertyAttribute.hpp>
34 #include <com/sun/star/gallery/GalleryItemType.hpp>
37 #define UNOGALLERY_GALLERYITEMTYPE 1
38 #define UNOGALLERY_URL 2
39 #define UNOGALLERY_TITLE 3
40 #define UNOGALLERY_THUMBNAIL 4
41 #define UNOGALLERY_GRAPHIC 5
42 #define UNOGALLERY_DRAWING 6
50 ::
comphelper::PropertySetHelper( createPropertySetInfo() ),
52 mpGalleryObject( &rObject )
77 aAny <<= uno::Reference< lang::XServiceInfo >(
this);
79 aAny <<= uno::Reference< lang::XTypeProvider >(
this);
81 aAny <<= uno::Reference< gallery::XGalleryItem >(
this);
83 aAny <<= uno::Reference< beans::XPropertySet >(
this);
85 aAny <<= uno::Reference< beans::XPropertyState >(
this);
87 aAny <<= uno::Reference< beans::XMultiPropertySet >(
this);
89 aAny = OWeakAggObject::queryAggregation( rType );
97 return OWeakAggObject::queryInterface( rType );
104 OWeakAggObject::acquire();
111 OWeakAggObject::release();
117 return "com.sun.star.comp.gallery.GalleryItem";
127 return {
"com.sun.star.gallery.GalleryItem" };
132 static const uno::Sequence
aTypes {
144 return css::uno::Sequence<sal_Int8>();
158 nRet = gallery::GalleryItemType::MEDIA;
162 nRet = gallery::GalleryItemType::DRAWING;
166 nRet = gallery::GalleryItemType::GRAPHIC;
180 beans::PropertyAttribute::READONLY, 0 },
183 beans::PropertyAttribute::READONLY, 0 },
189 beans::PropertyAttribute::READONLY, 0 },
192 beans::PropertyAttribute::READONLY, 0 },
195 beans::PropertyAttribute::READONLY, 0 },
211 if( !(*pValues >>= aNewTitle) )
213 throw lang::IllegalArgumentException();
220 std::unique_ptr<SgaObject> pObj(pGalTheme->getGalleryStorageEngine()->implReadSgaObject(
implGetObject() ));
224 if( pObj->GetTitle() != aNewTitle )
226 pObj->SetTitle( aNewTitle );
227 pGalTheme->InsertObject( *pObj );
245 switch( (*ppEntries)->mnHandle )
268 std::unique_ptr<SgaObject> pObj = pGalTheme->AcquireObject( pGalTheme->maGalleryObjectCollection.searchPosWithObject(
implGetObject() ) );
272 *pValue <<= pObj->GetTitle();
284 std::unique_ptr<SgaObject> pObj = pGalTheme->AcquireObject( pGalTheme->maGalleryObjectCollection.searchPosWithObject(
implGetObject() ) );
290 if( pObj->IsThumbBitmap() )
291 aThumbnail = pObj->GetThumbBmp();
293 aThumbnail = pObj->GetThumbMtf();
306 if( pGalTheme && pGalTheme->GetGraphic( pGalTheme->maGalleryObjectCollection.searchPosWithObject(
implGetObject() ), aGraphic ) )
313 if( gallery::GalleryItemType::DRAWING ==
getType() )
320 if( pGalTheme && pGalTheme->GetModel( pGalTheme->maGalleryObjectCollection.searchPosWithObject(
implGetObject() ), *pModel ) )
324 pModel->
setUnoModel( uno::Reference< uno::XInterface >::query( xDrawing ) );
325 *pValue <<= xDrawing;
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
#define UNOGALLERY_GRAPHIC
virtual ~GalleryItem() noexcept override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual ::sal_Int8 SAL_CALL getType() override
#define UNOGALLERY_THUMBNAIL
::unogallery::GalleryTheme * mpTheme
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
const INetURLObject & getURL() const
GalleryDrawingModel(SdrModel *pDoc) noexcept
virtual void SAL_CALL acquire() noexcept override
virtual void SAL_CALL release() noexcept override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
const ::GalleryObject * mpGalleryObject
void setUnoModel(const css::uno::Reference< css::uno::XInterface > &xModel)
static rtl::Reference<::comphelper::PropertySetInfo > createPropertySetInfo()
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
constexpr OUStringLiteral EMPTY
#define UNOGALLERY_DRAWING
virtual ~GalleryDrawingModel() noexcept override
std::pair< OUString const, DataAccessDescriptorProperty > PropertyMapEntry
::GalleryTheme * implGetTheme() const
css::uno::Type const & get()
void implDeregisterGalleryItem(::unogallery::GalleryItem &rItem)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
SdrModel * GetDoc() const
UNO3_GETIMPLEMENTATION_IMPL(GalleryDrawingModel)
#define UNOGALLERY_GALLERYITEMTYPE
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
virtual OUString SAL_CALL getImplementationName() override
virtual void _setPropertyValues(const comphelper::PropertyMapEntry **ppEntries, const css::uno::Any *pValues) override
GalleryItem(::unogallery::GalleryTheme &rTheme, const GalleryObject &rObject)
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
void implRegisterGalleryItem(::unogallery::GalleryItem &rItem)
ScXMLEditAttributeMap::Entry const aEntries[]
const SfxItemPool & GetItemPool() const
const ::GalleryObject * implGetObject() const
virtual void _getPropertyValues(const comphelper::PropertyMapEntry **ppEntries, css::uno::Any *pValue) override