Files
core/ASCOfficeOdfFileW/win32/OfficeOdfFileW.h
Elen.Subbotina 88c2be727d OdfReader (fix errors format convert complete)
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63106 954022d7-b5bf-4e40-9824-e11837661b57
2016-05-21 00:09:11 +03:00

96 lines
2.6 KiB
C++

// OfficeOdfFileW.h : Declaration of the COfficeOdfFileW
#pragma once
#include "resource.h" // main symbols
#include <string>
#include "../../Common/OfficeFileTemplate.h"
#include "../../Common/OfficeFileErrorDescription.h"
#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
#endif
// IOfficeOdfFileW
[
object,
uuid("E171F3C8-5715-41AB-9678-85AF4B7CE2FE"),
dual, helpstring("IOfficeOdfFileW Interface"),
pointer_default(unique)
]
__interface IOfficeOdfFileW : IAVSOfficeFileTemplate
{
};
// _IOfficeOdfFileWEvents
[
dispinterface,
uuid("BF816058-77B7-497A-9204-1AE5A37956FC"),
helpstring("_IOfficeOdfFileWEvents Interface")
]
__interface _IOfficeOdfFileWEvents
{
};
// COfficeOdfFileW
[
coclass,
default(IOfficeOdfFileW, _IAVSOfficeFileTemplateEvents),
threading(apartment),
event_source(com),
vi_progid("ASCOfficeOdfFileW.OfficeOdfFileW"),
progid("ASCOfficeOdfFileW.OfficeOdfFileW.1"),
version(1.0),
uuid("E1D4E9D1-69A7-494B-B2A0-0F7F37449044"),
helpstring("OfficeOdfFileW Class")
]
class ATL_NO_VTABLE COfficeOdfFileW :
public IOfficeOdfFileW
{
public:
COfficeOdfFileW()
{
}
__event __interface _IAVSOfficeFileTemplateEvents;
__event __interface _IAVSOfficeFileTemplateEvents2;
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
defaultWinFontPath = GetDefWinFontDirectory();
return S_OK;
}
void FinalRelease()
{
}
public:
STDMETHOD(LoadFromFile)(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions);
STDMETHOD(SaveToFile)(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions);
private:
HRESULT SaveToFileImpl(const std::wstring & srcPath, const std::wstring & srcTempPath,
const std::wstring & dstTempPath, const std::wstring & fontPath, const std::wstring & dstFileName);
std::wstring DetectTypeDocument(const std::wstring & Path);
std::wstring GetDefWinFontDirectory();
std::wstring defaultWinFontPath;
protected:
static void OnProgressFunc (LPVOID lpParam, long nID, long nPercent);
static void OnProgressExFunc (LPVOID lpParam, long nID, long nPercent, short* pStop);
};