20#include <config_features.h>
26#include <osl/file.hxx>
27#include <osl/thread.hxx>
30#include <tools/datetime.hxx>
56 , mnBroadcasterLockCount(0)
59 , bAbortActualize(false)
124 sal_uInt32 iFoundPos = 0;
153 rTitle = pGalleryObject->
maTitle;
154 rPath = pGalleryObject->
maPath;
163 pGalleryObject->
maTitle = rTitle;
164 pGalleryObject->
maPath = rPath;
170 std::unique_ptr<GalleryObject> pEntry = std::move(*it);
191 if (nNewPos < nOldPos)
248 std::unique_ptr<SgaObject> pNewObj;
279 if( (*it)->mbDelete )
304 rBmp = pObj->GetThumbBmp();
326 OUString aFilterDummy;
346 pVDev->SetMapMode(
MapMode( MapUnit::Map100thMM ) );
366 rGraphic = pObj->GetThumbBmp();
387 if( rGraphic.
GetType() != GraphicType::NONE )
396 case GfxLinkType::EpsBuffer: nExportFormat = ConvertDataFormat::SVM;
break;
397 case GfxLinkType::NativeGif: nExportFormat = ConvertDataFormat::GIF;
break;
401 case GfxLinkType::NativeBmp: nExportFormat = ConvertDataFormat::BMP;
break;
403 case GfxLinkType::NativeJpg: nExportFormat = ConvertDataFormat::JPG;
break;
404 case GfxLinkType::NativePng: nExportFormat = ConvertDataFormat::PNG;
break;
405 case GfxLinkType::NativeTif: nExportFormat = ConvertDataFormat::TIF;
break;
406 case GfxLinkType::NativeWmf: nExportFormat = ConvertDataFormat::WMF;
break;
407 case GfxLinkType::NativeMet: nExportFormat = ConvertDataFormat::MET;
break;
408 case GfxLinkType::NativePct: nExportFormat = ConvertDataFormat::PCT;
break;
409 case GfxLinkType::NativeSvg: nExportFormat = ConvertDataFormat::SVG;
break;
410 case GfxLinkType::NativeWebp: nExportFormat = ConvertDataFormat::WEBP;
break;
417 if( rGraphic.
GetType() == GraphicType::Bitmap )
420 nExportFormat = ConvertDataFormat::GIF;
422 nExportFormat = ConvertDataFormat::PNG;
425 nExportFormat = ConvertDataFormat::SVM;
430 if (aObjBmp.IsValid())
454 if(aObjSvDraw.IsValid())
477 if(aObjSvDraw.IsValid())
501 std::unique_ptr<SgaObject> pNewObj;
512#if HAVE_FEATURE_AVMEDIA
525 std::vector< INetURLObject > aURLVector;
528 for(
const auto& rURL : aURLVector )
529 bRet = bRet ||
InsertURL( rURL, nInsertPos );
538 if( rxTransferable.is() )
541 std::optional<Graphic> oGraphic;
543 if( aDataHelper.
HasFormat( SotClipboardFormatId::DRAWING ) )
550 else if( aDataHelper.
HasFormat( SotClipboardFormatId::FILE_LIST ) ||
551 aDataHelper.
HasFormat( SotClipboardFormatId::SIMPLE_FILE ) )
555 if( aDataHelper.
HasFormat( SotClipboardFormatId::FILE_LIST ) )
556 aDataHelper.
GetFileList( SotClipboardFormatId::FILE_LIST, aFileList );
560 if (aDataHelper.
GetString(SotClipboardFormatId::SIMPLE_FILE, aFile) && !aFile.isEmpty())
566 const OUString aFile( aFileList.
GetFile(
i ) );
569 if(
aURL.GetProtocol() == INetProtocol::NotValid )
573 if( osl::FileBase::getFileURLFromSystemPath( aFile, aLocalURL ) == osl::FileBase::E_None )
577 if(
aURL.GetProtocol() != INetProtocol::NotValid )
586 if( aDataHelper.
HasFormat( SotClipboardFormatId::SVXB ) )
587 nFormat = SotClipboardFormatId::SVXB;
588 else if( aDataHelper.
HasFormat( SotClipboardFormatId::GDIMETAFILE ) )
589 nFormat = SotClipboardFormatId::GDIMETAFILE;
590 else if( aDataHelper.
HasFormat( SotClipboardFormatId::BITMAP ) )
591 nFormat = SotClipboardFormatId::BITMAP;
593 if( nFormat != SotClipboardFormatId::NONE && aDataHelper.
GetGraphic( nFormat, aGraphic ) )
594 oGraphic.emplace( aGraphic );
601 if( aDataHelper.
HasFormat( SotClipboardFormatId::SVIM ) )
607 if( aDataHelper.
GetImageMap( SotClipboardFormatId::SVIM, aImageMap ) )
616 pGrafObj->AppendUserData( std::unique_ptr<SdrObjUserData>(
new SgaIMapInfo( aImageMap )) );
657 if(
nCount <= ( 1 << 14 ) )
661 sal_uInt32 nId1, nId2;
684 aFileName = OStringToOUString(aTempFileName, osl_getThreadTextEncoding());
686 pObj->m_oStorageUrl.emplace();
690 aFileName = aFileName.replaceAll(
"\\",
"/" );
693 if( aFileName[ 0 ] !=
'/' )
704 if( aFileName[0] !=
'/' )
717 OUString aDummyURL =
"gallery/svdraw/" + aFileName;
718 pObj->m_oStorageUrl =
INetURLObject(aDummyURL, INetProtocol::PrivSoffice);
726 if( ( pObj->m_oStorageUrl->GetProtocol() == INetProtocol::NotValid ) &&
727 osl::FileBase::getFileURLFromSystemPath( aFileName, aLocalURL ) == osl::FileBase::E_None )
747 bool bThemeNameFromResource =
false;
756 SetId( nTemp32, bThemeNameFromResource );
OUString GetFile(size_t nIndex) const
void AppendFile(const OUString &rStr)
static void insertFileOrDirURL(const INetURLObject &rFileOrDirURL, std::vector< INetURLObject > &rURLVector)
const GalleryObject * getForPosition(sal_uInt32 nPos) const
std::unique_ptr< GalleryObject > & get(sal_uInt32 nPos)
std::vector< std::unique_ptr< GalleryObject > > & getObjectList()
void Update(sal_Int32 nVal, sal_Int32 nMaxVal)
const OUString & GetThemeName() const
void SetModified(bool bSet)
void SetId(sal_uInt32 nNewId, bool bResetThemeName)
std::unique_ptr< GalleryFileStorage > createGalleryStorageEngine(GalleryObjectCollection &mrGalleryObjectCollection)
SAL_DLLPRIVATE void LockBroadcaster()
SAL_DLLPRIVATE void ImplSetModified(bool bModified)
GalleryObjectCollection maGalleryObjectCollection
const OUString & GetName() const
GalleryTheme(GalleryTheme const &)=delete
bool InsertURL(const INetURLObject &rURL, sal_uInt32 nInsertPos=SAL_MAX_UINT32)
sal_uInt32 mnThemeLockCount
SAL_DLLPRIVATE void SetId(sal_uInt32 nNewId, bool bResetThemeName)
void Actualize(const Link< const INetURLObject &, void > &rActualizeLink, GalleryProgress *pProgress=nullptr)
SAL_DLLPRIVATE void CopyToClipboard(const weld::Widget &rWidget, sal_uInt32 nPos)
sal_uInt32 mnBroadcasterLockCount
bool GetGraphic(sal_uInt32 nPos, Graphic &rGraphic)
bool InsertObject(const SgaObject &rObj, sal_uInt32 nPos=SAL_MAX_UINT32)
void SetDestDir(const OUString &rDestDir, bool bRelative)
virtual SAL_DLLPRIVATE ~GalleryTheme() override
bool ChangeObjectPos(sal_uInt32 nOldPos, sal_uInt32 nNewPos)
SAL_DLLPRIVATE bool InsertTransferable(const css::uno::Reference< css::datatransfer::XTransferable > &rxTransferable, sal_uInt32 nInsertPos)
SAL_DLLPRIVATE sal_uInt32 GetObjectCount() const
SAL_DLLPRIVATE bool UnlockTheme()
SAL_DLLPRIVATE bool GetThumb(sal_uInt32 nPos, BitmapEx &rBmp)
SAL_DLLPRIVATE Gallery * GetParent() const
SAL_DLLPRIVATE bool GetModelStream(sal_uInt32 nPos, tools::SvRef< SotTempStream > const &rModelStreamRef)
std::unique_ptr< SgaObject > AcquireObject(sal_uInt32 nPos)
std::unique_ptr< GalleryFileStorage > mpGalleryStorageEngine
DateTime getModificationDate() const
bool InsertGraphic(const Graphic &rGraphic, sal_uInt32 nInsertPos)
bool GetModel(sal_uInt32 nPos, SdrModel &rModel)
SAL_DLLPRIVATE bool IsBroadcasterLocked() const
SAL_DLLPRIVATE bool InsertFileOrDirURL(const INetURLObject &rFileOrDirURL, sal_uInt32 nInsertPos)
bool InsertModel(const FmFormModel &rModel, sal_uInt32 nInsertPos)
void RemoveObject(sal_uInt32 nPos)
SAL_DLLPRIVATE SvStream & ReadData(SvStream &rIn)
SAL_DLLPRIVATE bool InsertModelStream(const tools::SvRef< SotTempStream > &rModelStream, sal_uInt32 nInsertPos)
SAL_DLLPRIVATE void ImplBroadcast(sal_uInt32 nUpdatePos)
SAL_DLLPRIVATE void SetPreviewBitmapExAndStrings(sal_uInt32 nPos, const BitmapEx &rBitmapEx, const Size &rSize, const OUString &rTitle, const OUString &rPath)
const INetURLObject & getThemeURL() const
SAL_DLLPRIVATE bool GetURL(sal_uInt32 nPos, INetURLObject &rURL)
SAL_DLLPRIVATE void GetPreviewBitmapExAndStrings(sal_uInt32 nPos, BitmapEx &rBitmapEx, Size &rSize, OUString &rTitle, OUString &rPath)
sal_uInt32 GetDataSize() const
GfxLinkType GetType() const
GraphicType GetType() const
GfxLink GetGfxLink() const
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
Graphic GetAllMarkedGraphic() const
This class represents an embedded or linked bitmap graphic object.
const SdrPage * GetPage(sal_uInt16 nPgNum) const
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
SdrModel & GetModel() const
void Broadcast(const SfxHint &rHint)
SvStream & ReadCharAsBool(bool &rBool)
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
void SetError(ErrCode nErrorCode)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
FmFormModel * GetModel() const
bool GetString(SotClipboardFormatId nFormat, OUString &rStr) const
bool GetImageMap(SotClipboardFormatId nFormat, ImageMap &rIMap) const
bool GetFileList(SotClipboardFormatId nFormat, FileList &rFileList) const
bool GetSotStorageStream(SotClipboardFormatId nFormat, tools::SvRef< SotTempStream > &rStreamRef) const
bool HasFormat(SotClipboardFormatId nFormat) const
bool GetGraphic(SotClipboardFormatId nFormat, Graphic &rGraphic) const
sal_uInt16 GetVersion() const
#define DBG_ASSERT(sCon, aError)
EmbeddedObjectRef * pObject
#define SVSTREAM_READ_ERROR
static bool FileExists(const INetURLObject &rURL, std::u16string_view rExt)
bool CreateIMapGraphic(const FmFormModel &rModel, Graphic &rGraphic, ImageMap &rImageMap)
INetURLObject ImplGetURL(const GalleryObject *pObject)
GalleryGraphicImportRet GalleryGraphicImport(const INetURLObject &rURL, Graphic &rGraphic, OUString &rFilterName)
OString read_uInt16_lenPrefixed_uInt8s_ToOString(SvStream &rStrm)
BitmapEx maPreviewBitmapEx
std::optional< INetURLObject > m_oStorageUrl
sal_uInt32 COMPAT_FORMAT(char char1, char char2, char char3, char char4)