| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef FPDFSDK_INCLUDE_FSDK_MGR_H_ | 7 #ifndef FPDFSDK_INCLUDE_FSDK_MGR_H_ |
| 8 #define FPDFSDK_INCLUDE_FSDK_MGR_H_ | 8 #define FPDFSDK_INCLUDE_FSDK_MGR_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 FPDF_WIDESTRING pTo = (FPDF_WIDESTRING)bsTo.GetBuffer(wsURL.GetLength()); | 225 FPDF_WIDESTRING pTo = (FPDF_WIDESTRING)bsTo.GetBuffer(wsURL.GetLength()); |
| 226 m_pInfo->FFI_GotoURL(m_pInfo, document, pTo); | 226 m_pInfo->FFI_GotoURL(m_pInfo, document, pTo); |
| 227 bsTo.ReleaseBuffer(); | 227 bsTo.ReleaseBuffer(); |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 | 230 |
| 231 void FFI_GetURL(FPDF_DOCUMENT document, CFX_WideString& wsURL) { | 231 void FFI_GetURL(FPDF_DOCUMENT document, CFX_WideString& wsURL) { |
| 232 wsURL = CFX_WideString(); | 232 wsURL = CFX_WideString(); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void FFI_PageEvent(FPDF_PAGE page, FPDF_DWORD flag) {} | |
| 236 | |
| 237 void FFI_GetPageViewRect(FPDF_PAGE page, FS_RECTF& dstRect) { | 235 void FFI_GetPageViewRect(FPDF_PAGE page, FS_RECTF& dstRect) { |
| 238 if (m_pInfo && m_pInfo->FFI_GetPageViewRect) { | 236 if (m_pInfo && m_pInfo->FFI_GetPageViewRect) { |
| 239 double left; | 237 double left; |
| 240 double top; | 238 double top; |
| 241 double right; | 239 double right; |
| 242 double bottom; | 240 double bottom; |
| 243 m_pInfo->FFI_GetPageViewRect(m_pInfo, page, &left, &top, &right, &bottom); | 241 m_pInfo->FFI_GetPageViewRect(m_pInfo, page, &left, &top, &right, &bottom); |
| 244 | 242 |
| 245 dstRect.left = static_cast<float>(left); | 243 dstRect.left = static_cast<float>(left); |
| 246 dstRect.top = static_cast<float>(top < bottom ? bottom : top); | 244 dstRect.top = static_cast<float>(top < bottom ? bottom : top); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 } | 396 } |
| 399 CFX_ByteString bsRet = CFX_ByteString(pbuff, nActualLen); | 397 CFX_ByteString bsRet = CFX_ByteString(pbuff, nActualLen); |
| 400 CFX_WideString wsRet = CFX_WideString::FromUTF16LE( | 398 CFX_WideString wsRet = CFX_WideString::FromUTF16LE( |
| 401 (unsigned short*)bsRet.GetBuffer(bsRet.GetLength()), | 399 (unsigned short*)bsRet.GetBuffer(bsRet.GetLength()), |
| 402 bsRet.GetLength() / sizeof(unsigned short)); | 400 bsRet.GetLength() / sizeof(unsigned short)); |
| 403 delete[] pbuff; | 401 delete[] pbuff; |
| 404 return wsRet; | 402 return wsRet; |
| 405 } | 403 } |
| 406 return L""; | 404 return L""; |
| 407 } | 405 } |
| 408 void FFI_PageEvent(int iPageIndex, int iEventType) const { | 406 |
| 409 // Todo: call a call-back function when it's implemented | 407 void FFI_PageEvent(int iPageIndex, FX_DWORD dwEventType) const { |
| 410 // in applicaiton's side. | 408 if (m_pInfo && m_pInfo->FFI_PageEvent) |
| 409 m_pInfo->FFI_PageEvent(m_pInfo, iPageIndex, dwEventType); |
| 411 } | 410 } |
| 412 #endif // PDF_ENABLE_XFA | 411 #endif // PDF_ENABLE_XFA |
| 413 | 412 |
| 414 int JS_appAlert(const FX_WCHAR* Msg, | 413 int JS_appAlert(const FX_WCHAR* Msg, |
| 415 const FX_WCHAR* Title, | 414 const FX_WCHAR* Title, |
| 416 FX_UINT Type, | 415 FX_UINT Type, |
| 417 FX_UINT Icon); | 416 FX_UINT Icon); |
| 418 int JS_appResponse(const FX_WCHAR* Question, | 417 int JS_appResponse(const FX_WCHAR* Question, |
| 419 const FX_WCHAR* Title, | 418 const FX_WCHAR* Title, |
| 420 const FX_WCHAR* Default, | 419 const FX_WCHAR* Default, |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 FX_BOOL m_bTakeOverPage; | 653 FX_BOOL m_bTakeOverPage; |
| 655 #endif // PDF_ENABLE_XFA | 654 #endif // PDF_ENABLE_XFA |
| 656 FX_BOOL m_bEnterWidget; | 655 FX_BOOL m_bEnterWidget; |
| 657 FX_BOOL m_bExitWidget; | 656 FX_BOOL m_bExitWidget; |
| 658 FX_BOOL m_bOnWidget; | 657 FX_BOOL m_bOnWidget; |
| 659 FX_BOOL m_bValid; | 658 FX_BOOL m_bValid; |
| 660 FX_BOOL m_bLocked; | 659 FX_BOOL m_bLocked; |
| 661 }; | 660 }; |
| 662 | 661 |
| 663 #endif // FPDFSDK_INCLUDE_FSDK_MGR_H_ | 662 #endif // FPDFSDK_INCLUDE_FSDK_MGR_H_ |
| OLD | NEW |