20#ifndef INCLUDED_SFX2_SOURCE_DOC_OLEPROPS_HXX
21#define INCLUDED_SFX2_SOURCE_DOC_OLEPROPS_HXX
27#include <osl/thread.h>
28#include <rtl/ustring.hxx>
31#include <com/sun/star/util/DateTime.hpp>
32#include <com/sun/star/util/Date.hpp>
273 bool GetInt32Value( sal_Int32& rnValue, sal_Int32 nPropId )
const;
279 bool GetBoolValue(
bool& rbValue, sal_Int32 nPropId )
const;
285 bool GetFileTimeValue( css::util::DateTime& rValue, sal_Int32 nPropId )
const;
288 bool GetDateValue( css::util::Date& rValue, sal_Int32 nPropId )
const;
302 void SetFileTimeValue( sal_Int32 nPropId,
const css::util::DateTime& rValue );
304 void SetDateValue( sal_Int32 nPropId,
const css::util::Date& rValue );
307 const css::uno::Sequence<sal_Int8> & i_rData);
310 const css::uno::Sequence<sal_Int8> & i_rData);
313 css::uno::Any
GetAnyValue( sal_Int32 nPropId )
const;
316 bool SetAnyValue( sal_Int32 nPropId,
const css::uno::Any& rValue );
324 void GetPropertyIds( ::std::vector< sal_Int32 >& rPropIds )
const;
Property representing the codepage used to encode bytestrings in the entire property set.
virtual void ImplLoad(SvStream &rStrm) override
Derived classes implement loading the object from the passed steam.
virtual void ImplSave(SvStream &rStrm) override
Derived classes implement saving the object to the passed steam.
Property containing custom names for other properties in the property set.
SfxOleDictionaryProperty(const SfxOleTextEncoding &rTextEnc)
virtual void ImplLoad(SvStream &rStrm) override
Derived classes implement loading the object from the passed steam.
virtual void ImplSave(SvStream &rStrm) override
Derived classes implement saving the object to the passed steam.
OUString GetPropertyName(sal_Int32 nPropId) const
Returns the custom name for the passed property ID, or an empty string, if name not found.
::std::map< sal_Int32, OUString > SfxOlePropNameMap
void SetPropertyName(sal_Int32 nPropId, const OUString &rPropName)
Sets a custom name for the passed property ID.
bool HasPropertyNames() const
Returns true, if the property contains at least one custom property name.
void SetNameCount(sal_Int32 nNameCount)
Prepares the property for loading.
SfxOlePropNameMap maPropNameMap
Base class for all classes related to OLE property sets.
virtual ~SfxOleObjectBase()
void SetError(ErrCode nErrCode)
Sets the passed error code.
virtual void ImplSave(SvStream &rStrm)=0
Derived classes implement saving the object to the passed steam.
void SaveObject(SvStream &rStrm, SfxOleObjectBase &rObj)
Saves the passed object to the stream.
ErrCode const & GetError() const
Returns the current error code.
ErrCode const & Load(SvStream &rStrm)
Loads this object from the passed stream.
void LoadObject(SvStream &rStrm, SfxOleObjectBase &rObj)
Loads the passed object from the stream.
ErrCode const & Save(SvStream &rStrm)
Saves this object to the passed stream.
virtual void ImplLoad(SvStream &rStrm)=0
Derived classes implement loading the object from the passed steam.
Base class for all OLE property objects.
SfxOlePropertyBase(sal_Int32 nPropId, sal_Int32 nPropType)
sal_Int32 GetPropType() const
void SetPropType(sal_Int32 nPropType)
sal_Int32 GetPropId() const
Represents a complete property set, may consist of several property sections.
virtual void ImplLoad(SvStream &rStrm) override
Derived classes implement loading the object from the passed steam.
SfxOleSection & AddSection(SfxOleSectionType eSection)
Creates and returns the specified section, or just returns it if it already exists.
ErrCode const & LoadPropertySet(SotStorage *pStrg, const OUString &rStrmName)
Loads this object from the passed storage.
SfxOleSectionMap maSectionMap
::std::map< SvGlobalName, SfxOleSectionRef > SfxOleSectionMap
ErrCode const & SavePropertySet(SotStorage *pStrg, const OUString &rStrmName)
Saves this object to the passed storage.
virtual void ImplSave(SvStream &rStrm) override
Derived classes implement saving the object to the passed steam.
SfxOleSectionRef GetSection(SfxOleSectionType eSection) const
Returns the specified section, or an empty reference, if nothing found.
static const SvGlobalName & GetSectionGuid(SfxOleSectionType eSection)
Returns the GUID for the specified section.
A section in a property set.
bool GetFileTimeValue(css::util::DateTime &rValue, sal_Int32 nPropId) const
Returns the value of a time stamp property with the passed ID in rValue.
virtual void ImplLoad(SvStream &rStrm) override
Derived classes implement loading the object from the passed steam.
SfxOlePropertyRef GetProperty(sal_Int32 nPropId) const
Returns the property with the passed ID, or an empty reference, if nothing found.
SfxOleDictionaryProperty maDictProp
The codepage property.
void SetDateValue(sal_Int32 nPropId, const css::util::Date &rValue)
Inserts a date property with the passed value.
bool GetInt32Value(sal_Int32 &rnValue, sal_Int32 nPropId) const
Returns the value of a signed int32 property with the passed ID in rnValue.
bool SeekToPropertyPos(SvStream &rStrm, sal_uInt32 nPropPos) const
void SetPropertyName(sal_Int32 nPropId, const OUString &rPropName)
Sets a custom name for the passed property ID.
css::uno::Any GetAnyValue(sal_Int32 nPropId) const
Returns the value of the property with the passed ID in a UNO any.
void SetFileTimeValue(sal_Int32 nPropId, const css::util::DateTime &rValue)
Inserts a time stamp property with the passed value.
bool GetBoolValue(bool &rbValue, sal_Int32 nPropId) const
Returns the value of a boolean property with the passed ID in rbValue.
virtual void ImplSave(SvStream &rStrm) override
Derived classes implement saving the object to the passed steam.
void LoadProperty(SvStream &rStrm, sal_Int32 nPropId)
bool GetStringValue(OUString &rValue, sal_Int32 nPropId) const
Returns the value of a string property with the passed ID in rValue.
void GetPropertyIds(::std::vector< sal_Int32 > &rPropIds) const
Returns the identifiers of all existing properties in the passed vector.
::std::map< sal_Int32, SfxOlePropertyRef > SfxOlePropMap
SfxOleCodePageProperty maCodePageProp
All properties in this section, by identifier.
sal_Int32 GetFreePropertyId() const
Returns a property identifier not used in this section.
void SetBoolValue(sal_Int32 nPropId, bool bValue)
Inserts a boolean property with the passed value.
bool GetDateValue(css::util::Date &rValue, sal_Int32 nPropId) const
Returns the value of a date property with the passed ID in rValue.
void SetDoubleValue(sal_Int32 nPropId, double fValue)
Inserts a floating-point property with the passed value.
void SetThumbnailValue(sal_Int32 nPropId, const css::uno::Sequence< sal_Int8 > &i_rData)
Inserts a thumbnail property from the passed meta file.
void SetInt32Value(sal_Int32 nPropId, sal_Int32 nValue)
Inserts a signed int32 property with the passed value.
void SetProperty(const SfxOlePropertyRef &xProp)
Adds the passed property to the property set.
void SaveProperty(SvStream &rStrm, SfxOlePropertyBase &rProp, sal_uInt64 &rnPropPosPos)
bool GetDoubleValue(double &rfValue, sal_Int32 nPropId) const
Returns the value of a floating-point property with the passed ID in rfValue.
OUString GetPropertyName(sal_Int32 nPropId) const
Returns the custom name for the passed property ID, or an empty string, if name not found.
bool SetStringValue(sal_Int32 nPropId, const OUString &rValue)
Inserts a string property with the passed value.
SfxOleSection(bool bSupportsDict)
void SetBlobValue(sal_Int32 nPropId, const css::uno::Sequence< sal_Int8 > &i_rData)
Inserts a BLOB property with the passed data.
bool SetAnyValue(sal_Int32 nPropId, const css::uno::Any &rValue)
Inserts a property created from the passed any.
sal_uInt64 mnStartPos
The dictionary property.
bool mbSupportsDict
Start stream position of the section.
Helper for classes that need to load or save string values.
static void SaveString16(SvStream &rStrm, std::u16string_view rValue)
Saves a Unicode string to the passed stream, ignores own encoding.
void ImplSaveString8(SvStream &rStrm, std::u16string_view rValue) const
SfxOleStringHelper(rtl_TextEncoding eTextEnc)
Creates a string helper object with own text encoding.
static OUString LoadString16(SvStream &rStrm)
Loads a Unicode string from the passed stream, ignores own encoding.
OUString LoadString8(SvStream &rStrm) const
Loads a string from the passed stream with current encoding (maybe Unicode).
SfxOleStringHelper(const SfxOleTextEncoding &rTextEnc)
Creates a string helper object depending on an external text encoding.
void SaveString8(SvStream &rStrm, std::u16string_view rValue) const
Saves a string to the passed stream with current encoding (maybe Unicode).
static void ImplSaveString16(SvStream &rStrm, std::u16string_view rValue)
OUString ImplLoadString8(SvStream &rStrm) const
static OUString ImplLoadString16(SvStream &rStrm)
Helper for classes that need text encoding settings.
SfxOleTextEncoding(rtl_TextEncoding eTextEnc)
std::shared_ptr< rtl_TextEncoding > mxTextEnc
void SetTextEncoding(rtl_TextEncoding eTextEnc)
Sets the passed text encoding.
bool IsUnicode() const
Returns true, if this object contains Unicode text encoding.
void SetUnicode()
Sets Unicode text encoding to this object.
rtl_TextEncoding GetTextEncoding() const
Returns the current text encoding identifier.
void SetCodePage(sal_uInt16 nCodePage)
Sets the current text encoding from a Windows codepage identifier.
sal_uInt16 GetCodePage() const
Converts the current settings to a Windows codepage identifier.
std::shared_ptr< T > make_shared(Args &&... args)
const sal_uInt16 CODEPAGE_UNKNOWN
SfxOleSectionType
Enumerates different section types in OLE property sets.
@ SECTION_BUILTIN
Globally defined properties.
@ SECTION_CUSTOM
Properties built into MS Office.
const sal_uInt16 CODEPAGE_UNICODE
const sal_Int32 PROPTYPE_UINT64
const sal_Int32 PROPID_THUMBNAIL
const sal_Int32 PROPID_AUTHOR
const sal_Int32 PROPID_MANAGER
const sal_Int32 PROPTYPE_DOUBLE
const sal_Int32 PROPTYPE_UINT8
const sal_Int32 PROPTYPE_INT16
const sal_uInt16 CODEPAGE_UTF8
const sal_Int32 PROPID_EDITTIME
const sal_Int32 PROPTYPE_INT32
const sal_Int32 PROPID_CATEGORY
const sal_Int32 PROPTYPE_STRING
const sal_Int32 PROPTYPE_FLOAT
const sal_Int32 PROPID_REVNUMBER
const sal_Int32 PROPTYPE_UINT16
const sal_Int32 PROPTYPE_INT8
const sal_Int32 PROPTYPE_INT64
const sal_Int32 PROPTYPE_BOOL
const sal_Int32 PROPID_COMPANY
std::shared_ptr< SfxOlePropertyBase > SfxOlePropertyRef
const sal_Int32 PROPTYPE_STATUS
const sal_Int32 PROPTYPE_BLOB
const sal_Int32 PROPID_COMMENTS
const sal_Int32 CLIPDATAFMT_DIB
const sal_Int32 PROPID_TEMPLATE
const sal_Int32 PROPTYPE_DATE
const sal_Int32 PROPID_DICTIONARY
const sal_Int32 PROPTYPE_FILETIME
const sal_Int32 PROPID_SUBJECT
std::shared_ptr< SfxOleSection > SfxOleSectionRef
const sal_Int32 PROPTYPE_UINT32
const sal_Int32 PROPID_KEYWORDS
const sal_Int32 PROPID_CREATED
const sal_Int32 PROPTYPE_STRING16
const sal_Int32 PROPID_CODEPAGE
const sal_Int32 CLIPFMT_WIN
const sal_Int32 PROPTYPE_STRING8
const sal_Int32 PROPID_LASTSAVED
const sal_Int32 PROPTYPE_CLIPFMT
const sal_Int32 PROPID_TITLE
const sal_Int32 PROPID_FIRSTCUSTOM
const sal_Int32 PROPID_LASTPRINTED
const sal_Int32 PROPID_LASTAUTHOR
const sal_Int32 PROPTYPE_VARIANT