1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #pragma once
- #ifdef LIBWEBBROWSER_EXPORTS
- #define LIBWEBBROWSER_API __declspec(dllexport)
- #else
- #define LIBWEBBROWSER_API __declspec(dllimport)
- #endif
- // 打印配置接口
- struct __declspec(novtable) CPrintHostApi
- {
- virtual void Debug(const char *fmt, ...) = 0;
- };
- // Web打印回调
- struct __declspec(novtable) IWebPrintCallBack
- {
- // 加载结果回调
- virtual void CALLBACK LoadCallBack(BOOL bLoadSucc) = 0;
- // 打印结果回调
- virtual void CALLBACK PrintCallBack(BOOL bPrintSucc) = 0;
- };
- class libwebbrowser_impl; // 桥接
- class LIBWEBBROWSER_API Clibwebbrowser
- {
- public:
- Clibwebbrowser(CPrintHostApi *pHostApi, IWebPrintCallBack *pICallBack);
- ~Clibwebbrowser();
- // 加载Web页面
- BOOL LoadPage(const char* szURL);
- // 打印Web页面
- BOOL PrintPage();
- // 退出
- BOOL Exit();
- private:
- libwebbrowser_impl *m_pImpl;
- };
|