33#include <registry.hxx>
48#if !defined WIN32_LEAN_AND_MEAN
49# define WIN32_LEAN_AND_MEAN
79 m_pContentReader(nullptr),
80 m_pMetaInfoReader(nullptr),
82 m_ulUnicodeBufferLen(0),
83 m_ulUnicodeCharsRead(0),
85 m_ulCurrentPropertyNum(0),
91 m_pAttributes(nullptr),
128 IUnknown *pUnkTemp =
nullptr;
129 if ( IID_IFilter == riid )
130 pUnkTemp =
static_cast<IFilter *
>(
this);
131 else if ( IID_IPersistFile == riid )
132 pUnkTemp =
static_cast<IPersistFile *
>(
this);
133 else if ( IID_IPersist == riid )
134 pUnkTemp =
static_cast<IPersistFile *
>(
this);
135 else if (IID_IPersistStream == riid)
136 pUnkTemp =
static_cast<IPersistStream *
>(
this);
137 else if ( IID_IUnknown == riid )
138 pUnkTemp =
static_cast<IPersistFile *
>(
this);
141 *ppvObject =
nullptr;
142 return E_NOINTERFACE;
144 *ppvObject = pUnkTemp;
156 return InterlockedIncrement( &
m_lRefs );
166 ULONG ulTmp = InterlockedDecrement( &
m_lRefs );
199 FULLPROPSPEC
const * aAttributes,
203 *pFlags = IFILTER_FLAGS_OLE_PROPERTIES;
215 if( 0 < cAttributes )
218 if (
nullptr == aAttributes )
225 for ( ulNumAttr = 0 ; ulNumAttr < cAttributes; ulNumAttr++ )
227 if ( pAttrib[ulNumAttr].IsPropertyPropid() &&
237 else if ( grfFlags & IFILTER_INIT_APPLY_INDEX_ATTRIBUTES )
255 else if ( 0 == grfFlags )
277 catch (
const std::exception&)
328 pStat->breakType = CHUNK_NO_BREAK;
329 pStat->flags = CHUNK_TEXT;
330 pStat->locale = ChunkLCID;
332 pStat->attribute.psProperty.ulKind = PRSPEC_PROPID;
333 pStat->attribute.psProperty.propid = PID_STG_CONTENTS;
335 pStat->cwcStartSource = 0;
336 pStat->cwcLenSource = 0;
345 return FILTER_E_END_OF_CHUNKS;
360 return FILTER_E_END_OF_CHUNKS;
365 pStat->breakType = CHUNK_EOS;
366 pStat->flags = CHUNK_VALUE;
367 pStat->locale = GetSystemDefaultLCID();
368 pStat->attribute.guidPropSet = FMTID_SummaryInformation;
369 pStat->attribute.psProperty.ulKind = PRSPEC_PROPID;
372 pStat->cwcStartSource = 0;
373 pStat->cwcLenSource = 0;
403 return FILTER_E_NO_TEXT;
409 return FILTER_E_NO_MORE_TEXT;
415 awcBuffer + ulToCopy, (*pcwcBuffer - ulToCopy) *
sizeof (WCHAR));
417 *pcwcBuffer = ulToCopy;
422 return FILTER_S_LAST_TEXT;
464 return FILTER_E_NO_VALUES;
468 return FILTER_E_NO_MORE_VALUES;
469 PROPVARIANT *pPropVar =
static_cast<PROPVARIANT *
>(CoTaskMemAlloc(
sizeof (PROPVARIANT) ));
470 if ( pPropVar ==
nullptr )
471 return E_OUTOFMEMORY;
474 return FILTER_E_NO_VALUES;
477 size_t cw = wsTagData.length() + 1;
478 pPropVar->pwszVal =
static_cast<WCHAR*
>( CoTaskMemAlloc(cw*
sizeof(WCHAR)) );
479 if (pPropVar->pwszVal ==
nullptr)
481 CoTaskMemFree(pPropVar);
482 return E_OUTOFMEMORY;
484 wmemcpy(pPropVar->pwszVal, wsTagData.c_str(), cw);
485 *ppPropValue = pPropVar;
571 catch (
const std::exception&)
630 catch (
const std::exception&)
725 if ( IID_IClassFactory == riid )
727 else if ( IID_IUnknown == riid )
731 *ppvObject =
nullptr;
732 return E_NOINTERFACE;
734 *ppvObject = pUnkTemp;
746 return InterlockedIncrement( &
m_lRefs );
756 ULONG ulTmp = InterlockedDecrement( &
m_lRefs );
784 IUnknown * pUnkOuter,
789 if (
nullptr != pUnkOuter )
790 return CLASS_E_NOAGGREGATION;
849 if ( DLL_PROCESS_ATTACH == fdwReason )
850 DisableThreadLibraryCalls( hInstance );
880 IUnknown *pResult =
nullptr;
888 return CLASS_E_CLASSNOTAVAILABLE;
889 if( SUCCEEDED( pResult->QueryInterface( iid, ppvObj ) ) )
PROPID GetPropertyPropid() const
void SetProperty(PROPID pidProperty)
void SetPropSet(GUID const &guidPropSet)
GUID const & GetPropSet() const
virtual ULONG STDMETHODCALLTYPE AddRef() override
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject) override
virtual HRESULT STDMETHODCALLTYPE CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject) override
virtual ULONG STDMETHODCALLTYPE Release() override
virtual HRESULT STDMETHODCALLTYPE LockServer(BOOL fLock) override
ULONG m_ulUnicodeCharsRead
virtual HRESULT STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER *pcbSize) override
virtual ULONG STDMETHODCALLTYPE Release() override
CContentReader * m_pContentReader
CFullPropSpec * m_pAttributes
CMetaInfoReader * m_pMetaInfoReader
virtual SCODE STDMETHODCALLTYPE Init(ULONG grfFlags, ULONG cAttributes, FULLPROPSPEC const *aAttributes, ULONG *pFlags) override
virtual SCODE STDMETHODCALLTYPE GetValue(PROPVARIANT **ppPropValue) override
virtual SCODE STDMETHODCALLTYPE GetText(ULONG *pcwcBuffer, WCHAR *awcBuffer) override
::std::wstring m_pwszFileName
virtual HRESULT STDMETHODCALLTYPE IsDirty() override
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject) override
virtual SCODE STDMETHODCALLTYPE GetChunk(STAT_CHUNK *pStat) override
StreamInterface * m_pStream
::std::wstring m_pwsBuffer
virtual HRESULT STDMETHODCALLTYPE Save(LPCOLESTR pszFileName, BOOL fRemember) override
virtual HRESULT STDMETHODCALLTYPE SaveCompleted(LPCOLESTR pszFileName) override
ULONG m_ulCurrentPropertyNum
virtual SCODE STDMETHODCALLTYPE BindRegion(FILTERREGION origPos, REFIID riid, void **ppunk) override
ULONG m_ulUnicodeBufferLen
virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID) override
virtual HRESULT STDMETHODCALLTYPE GetCurFile(LPOLESTR *ppszFileName) override
virtual ULONG STDMETHODCALLTYPE AddRef() override
virtual HRESULT STDMETHODCALLTYPE Load(LPCOLESTR pszFileName, DWORD dwMode) override
#define META_INFO_SUBJECT
#define META_INFO_KEYWORDS
#define META_INFO_DESCRIPTION
GtkMediaStream * m_pStream
constexpr OUStringLiteral first
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
const int COUNT_ATTRIBUTES
HRESULT STDMETHODCALLTYPE DllGetClassObject(REFCLSID cid, REFIID iid, LPVOID *ppvObj)
STDAPI DllRegisterServer()
STDAPI DllUnregisterServer()
::std::wstring GetMetaInfoNameFromPropertyId(ULONG ulPropID)
HRESULT STDMETHODCALLTYPE DllCanUnloadNow()
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID)
GUID const CLSID_COooFilter
const wchar_t *typedef BOOL
LCID LocaleSetToLCID(const LocaleSet_t &Locale)
convert LocaleSet pair into Microsoft List of Locale ID (LCID) according to ISO-639 and ISO-3166.
std::wstring getShortPathName(const std::wstring &aLongName)
helper function to convert windows paths to short form.