summaryrefslogtreecommitdiff
path: root/fpdfsdk/include/cpdfsdk_environment.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-09-14 10:38:17 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-14 10:38:17 -0700
commit1f2489023f2b808c41071d992abceb646ade8e1b (patch)
tree34fedda2eeb4f5f98397d5ec81a3f9b46d5c8d51 /fpdfsdk/include/cpdfsdk_environment.h
parent8b1ed16144925205a34e3796b57db72dd6ee6a89 (diff)
downloadpdfium-1f2489023f2b808c41071d992abceb646ade8e1b.tar.xz
Remove FFI_ from CPDFSDK_Environment method names
The prefix doesn't add anything when used in CPDFSDK_Environment, remove. Review-Url: https://codereview.chromium.org/2338303002
Diffstat (limited to 'fpdfsdk/include/cpdfsdk_environment.h')
-rw-r--r--fpdfsdk/include/cpdfsdk_environment.h328
1 files changed, 156 insertions, 172 deletions
diff --git a/fpdfsdk/include/cpdfsdk_environment.h b/fpdfsdk/include/cpdfsdk_environment.h
index 7fd146a043..fe63ecad13 100644
--- a/fpdfsdk/include/cpdfsdk_environment.h
+++ b/fpdfsdk/include/cpdfsdk_environment.h
@@ -30,41 +30,41 @@ class CPDFSDK_Environment final {
CPDFSDK_Environment(UnderlyingDocumentType* pDoc, FPDF_FORMFILLINFO* pFFinfo);
~CPDFSDK_Environment();
- void FFI_Invalidate(FPDF_PAGE page,
- double left,
- double top,
- double right,
- double bottom) {
+ void Invalidate(FPDF_PAGE page,
+ double left,
+ double top,
+ double right,
+ double bottom) {
if (m_pInfo && m_pInfo->FFI_Invalidate)
m_pInfo->FFI_Invalidate(m_pInfo, page, left, top, right, bottom);
}
- void FFI_OutputSelectedRect(FPDF_PAGE page,
- double left,
- double top,
- double right,
- double bottom) {
+ void OutputSelectedRect(FPDF_PAGE page,
+ double left,
+ double top,
+ double right,
+ double bottom) {
if (m_pInfo && m_pInfo->FFI_OutputSelectedRect)
m_pInfo->FFI_OutputSelectedRect(m_pInfo, page, left, top, right, bottom);
}
- void FFI_SetCursor(int nCursorType) {
+ void SetCursor(int nCursorType) {
if (m_pInfo && m_pInfo->FFI_SetCursor)
m_pInfo->FFI_SetCursor(m_pInfo, nCursorType);
}
- int FFI_SetTimer(int uElapse, TimerCallback lpTimerFunc) {
+ int SetTimer(int uElapse, TimerCallback lpTimerFunc) {
if (m_pInfo && m_pInfo->FFI_SetTimer)
return m_pInfo->FFI_SetTimer(m_pInfo, uElapse, lpTimerFunc);
return -1;
}
- void FFI_KillTimer(int nTimerID) {
+ void KillTimer(int nTimerID) {
if (m_pInfo && m_pInfo->FFI_KillTimer)
m_pInfo->FFI_KillTimer(m_pInfo, nTimerID);
}
- FX_SYSTEMTIME FFI_GetLocalTime() const {
+ FX_SYSTEMTIME GetLocalTime() const {
FX_SYSTEMTIME fxtime;
if (m_pInfo && m_pInfo->FFI_GetLocalTime) {
FPDF_SYSTEMTIME systime = m_pInfo->FFI_GetLocalTime(m_pInfo);
@@ -80,120 +80,114 @@ class CPDFSDK_Environment final {
return fxtime;
}
- void FFI_OnChange() {
+ void OnChange() {
if (m_pInfo && m_pInfo->FFI_OnChange)
m_pInfo->FFI_OnChange(m_pInfo);
}
- FX_BOOL FFI_IsSHIFTKeyDown(uint32_t nFlag) const {
+ FX_BOOL IsSHIFTKeyDown(uint32_t nFlag) const {
return (nFlag & FWL_EVENTFLAG_ShiftKey) != 0;
}
- FX_BOOL FFI_IsCTRLKeyDown(uint32_t nFlag) const {
+ FX_BOOL IsCTRLKeyDown(uint32_t nFlag) const {
return (nFlag & FWL_EVENTFLAG_ControlKey) != 0;
}
- FX_BOOL FFI_IsALTKeyDown(uint32_t nFlag) const {
+ FX_BOOL IsALTKeyDown(uint32_t nFlag) const {
return (nFlag & FWL_EVENTFLAG_AltKey) != 0;
}
- FPDF_PAGE FFI_GetPage(FPDF_DOCUMENT document, int nPageIndex) {
+ FPDF_PAGE GetPage(FPDF_DOCUMENT document, int nPageIndex) {
if (m_pInfo && m_pInfo->FFI_GetPage)
return m_pInfo->FFI_GetPage(m_pInfo, document, nPageIndex);
return nullptr;
}
- FPDF_PAGE FFI_GetCurrentPage(FPDF_DOCUMENT document) {
+ FPDF_PAGE GetCurrentPage(FPDF_DOCUMENT document) {
if (m_pInfo && m_pInfo->FFI_GetCurrentPage)
return m_pInfo->FFI_GetCurrentPage(m_pInfo, document);
return nullptr;
}
- int FFI_GetRotation(FPDF_PAGE page) {
- if (m_pInfo && m_pInfo->FFI_GetRotation)
- return m_pInfo->FFI_GetRotation(m_pInfo, page);
- return 0;
- }
-
- void FFI_ExecuteNamedAction(const FX_CHAR* namedAction) {
+ void ExecuteNamedAction(const FX_CHAR* namedAction) {
if (m_pInfo && m_pInfo->FFI_ExecuteNamedAction)
m_pInfo->FFI_ExecuteNamedAction(m_pInfo, namedAction);
}
- void FFI_OnSetFieldInputFocus(void* field,
- FPDF_WIDESTRING focusText,
- FPDF_DWORD nTextLen,
- FX_BOOL bFocus) {
+ void OnSetFieldInputFocus(void* field,
+ FPDF_WIDESTRING focusText,
+ FPDF_DWORD nTextLen,
+ FX_BOOL bFocus) {
if (m_pInfo && m_pInfo->FFI_SetTextFieldFocus)
m_pInfo->FFI_SetTextFieldFocus(m_pInfo, focusText, nTextLen, bFocus);
}
- void FFI_DoURIAction(const FX_CHAR* bsURI) {
+ void DoURIAction(const FX_CHAR* bsURI) {
if (m_pInfo && m_pInfo->FFI_DoURIAction)
m_pInfo->FFI_DoURIAction(m_pInfo, bsURI);
}
- void FFI_DoGoToAction(int nPageIndex,
- int zoomMode,
- float* fPosArray,
- int sizeOfArray) {
+ void DoGoToAction(int nPageIndex,
+ int zoomMode,
+ float* fPosArray,
+ int sizeOfArray) {
if (m_pInfo && m_pInfo->FFI_DoGoToAction)
m_pInfo->FFI_DoGoToAction(m_pInfo, nPageIndex, zoomMode, fPosArray,
sizeOfArray);
}
#ifdef PDF_ENABLE_XFA
- void FFI_DisplayCaret(FPDF_PAGE page,
- FPDF_BOOL bVisible,
- double left,
- double top,
- double right,
- double bottom) {
+ void DisplayCaret(FPDF_PAGE page,
+ FPDF_BOOL bVisible,
+ double left,
+ double top,
+ double right,
+ double bottom) {
if (m_pInfo && m_pInfo->FFI_DisplayCaret)
m_pInfo->FFI_DisplayCaret(m_pInfo, page, bVisible, left, top, right,
bottom);
}
- int FFI_GetCurrentPageIndex(FPDF_DOCUMENT document) {
- if (!m_pInfo || !m_pInfo->FFI_GetCurrentPageIndex) {
+ int GetCurrentPageIndex(FPDF_DOCUMENT document) {
+ if (!m_pInfo || !m_pInfo->FFI_GetCurrentPageIndex)
return -1;
- }
return m_pInfo->FFI_GetCurrentPageIndex(m_pInfo, document);
}
- void FFI_SetCurrentPage(FPDF_DOCUMENT document, int iCurPage) {
+ void SetCurrentPage(FPDF_DOCUMENT document, int iCurPage) {
if (m_pInfo && m_pInfo->FFI_SetCurrentPage)
m_pInfo->FFI_SetCurrentPage(m_pInfo, document, iCurPage);
}
+ // TODO(dsinclair): This should probably change to PDFium?
CFX_WideString FFI_GetAppName() const { return CFX_WideString(L"Acrobat"); }
- CFX_WideString FFI_GetPlatform() {
- if (m_pInfo && m_pInfo->FFI_GetPlatform) {
- int nRequiredLen = m_pInfo->FFI_GetPlatform(m_pInfo, nullptr, 0);
- if (nRequiredLen <= 0)
- return L"";
-
- char* pbuff = new char[nRequiredLen];
- memset(pbuff, 0, nRequiredLen);
- int nActualLen = m_pInfo->FFI_GetPlatform(m_pInfo, pbuff, nRequiredLen);
- if (nActualLen <= 0 || nActualLen > nRequiredLen) {
- delete[] pbuff;
- return L"";
- }
- CFX_ByteString bsRet = CFX_ByteString(pbuff, nActualLen);
- CFX_WideString wsRet = CFX_WideString::FromUTF16LE(
- (unsigned short*)bsRet.GetBuffer(bsRet.GetLength()),
- bsRet.GetLength() / sizeof(unsigned short));
+ CFX_WideString GetPlatform() {
+ if (!m_pInfo || !m_pInfo->FFI_GetPlatform)
+ return L"";
+
+ int nRequiredLen = m_pInfo->FFI_GetPlatform(m_pInfo, nullptr, 0);
+ if (nRequiredLen <= 0)
+ return L"";
+
+ char* pbuff = new char[nRequiredLen];
+ memset(pbuff, 0, nRequiredLen);
+ int nActualLen = m_pInfo->FFI_GetPlatform(m_pInfo, pbuff, nRequiredLen);
+ if (nActualLen <= 0 || nActualLen > nRequiredLen) {
delete[] pbuff;
- return wsRet;
+ return L"";
}
- return L"";
+ CFX_ByteString bsRet = CFX_ByteString(pbuff, nActualLen);
+ CFX_WideString wsRet = CFX_WideString::FromUTF16LE(
+ (unsigned short*)bsRet.GetBuffer(bsRet.GetLength()),
+ bsRet.GetLength() / sizeof(unsigned short));
+ delete[] pbuff;
+ return wsRet;
}
- void FFI_GotoURL(FPDF_DOCUMENT document,
- const CFX_WideStringC& wsURL,
- FX_BOOL bAppend) {
+ void GotoURL(FPDF_DOCUMENT document,
+ const CFX_WideStringC& wsURL,
+ FX_BOOL bAppend) {
if (m_pInfo && m_pInfo->FFI_GotoURL) {
CFX_ByteString bsTo = CFX_WideString(wsURL).UTF16LE_Encode();
FPDF_WIDESTRING pTo = (FPDF_WIDESTRING)bsTo.GetBuffer(wsURL.GetLength());
@@ -202,7 +196,7 @@ class CPDFSDK_Environment final {
}
}
- void FFI_GetPageViewRect(FPDF_PAGE page, FS_RECTF& dstRect) {
+ void GetPageViewRect(FPDF_PAGE page, FS_RECTF& dstRect) {
if (m_pInfo && m_pInfo->FFI_GetPageViewRect) {
double left;
double top;
@@ -217,157 +211,147 @@ class CPDFSDK_Environment final {
}
}
- FX_BOOL FFI_PopupMenu(FPDF_PAGE page,
- FPDF_WIDGET hWidget,
- int menuFlag,
- CFX_PointF ptPopup,
- const CFX_PointF* pRectExclude) {
+ FX_BOOL PopupMenu(FPDF_PAGE page,
+ FPDF_WIDGET hWidget,
+ int menuFlag,
+ CFX_PointF ptPopup,
+ const CFX_PointF* pRectExclude) {
if (m_pInfo && m_pInfo->FFI_PopupMenu)
return m_pInfo->FFI_PopupMenu(m_pInfo, page, hWidget, menuFlag, ptPopup.x,
ptPopup.y);
return FALSE;
}
- void FFI_Alert(FPDF_WIDESTRING Msg,
- FPDF_WIDESTRING Title,
- int Type,
- int Icon) {
+ void Alert(FPDF_WIDESTRING Msg, FPDF_WIDESTRING Title, int Type, int Icon) {
if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_alert)
m_pInfo->m_pJsPlatform->app_alert(m_pInfo->m_pJsPlatform, Msg, Title,
Type, Icon);
}
- void FFI_EmailTo(FPDF_FILEHANDLER* fileHandler,
- FPDF_WIDESTRING pTo,
- FPDF_WIDESTRING pSubject,
- FPDF_WIDESTRING pCC,
- FPDF_WIDESTRING pBcc,
- FPDF_WIDESTRING pMsg) {
+ void EmailTo(FPDF_FILEHANDLER* fileHandler,
+ FPDF_WIDESTRING pTo,
+ FPDF_WIDESTRING pSubject,
+ FPDF_WIDESTRING pCC,
+ FPDF_WIDESTRING pBcc,
+ FPDF_WIDESTRING pMsg) {
if (m_pInfo && m_pInfo->FFI_EmailTo)
m_pInfo->FFI_EmailTo(m_pInfo, fileHandler, pTo, pSubject, pCC, pBcc,
pMsg);
}
- void FFI_UploadTo(FPDF_FILEHANDLER* fileHandler,
- int fileFlag,
- FPDF_WIDESTRING uploadTo) {
+ void UploadTo(FPDF_FILEHANDLER* fileHandler,
+ int fileFlag,
+ FPDF_WIDESTRING uploadTo) {
if (m_pInfo && m_pInfo->FFI_UploadTo)
m_pInfo->FFI_UploadTo(m_pInfo, fileHandler, fileFlag, uploadTo);
}
- FPDF_FILEHANDLER* FFI_OpenFile(int fileType,
- FPDF_WIDESTRING wsURL,
- const char* mode) {
+ FPDF_FILEHANDLER* OpenFile(int fileType,
+ FPDF_WIDESTRING wsURL,
+ const char* mode) {
if (m_pInfo && m_pInfo->FFI_OpenFile)
return m_pInfo->FFI_OpenFile(m_pInfo, fileType, wsURL, mode);
return nullptr;
}
- CFX_WideString FFI_GetFilePath(FPDF_FILEHANDLER* pFileHandler) const {
- return L"";
- }
-
- int FFI_GetDocumentCount() const { return 0; }
- int FFI_GetCurDocument() const { return 0; }
+ IFX_FileRead* DownloadFromURL(const FX_WCHAR* url) {
+ if (!m_pInfo || !m_pInfo->FFI_DownloadFromURL)
+ return nullptr;
- IFX_FileRead* FFI_DownloadFromURL(const FX_WCHAR* url) {
- if (m_pInfo && m_pInfo->FFI_DownloadFromURL) {
- CFX_ByteString bstrURL = CFX_WideString(url).UTF16LE_Encode();
- FPDF_WIDESTRING wsURL =
- (FPDF_WIDESTRING)bstrURL.GetBuffer(bstrURL.GetLength());
+ CFX_ByteString bstrURL = CFX_WideString(url).UTF16LE_Encode();
+ FPDF_WIDESTRING wsURL =
+ (FPDF_WIDESTRING)bstrURL.GetBuffer(bstrURL.GetLength());
- FPDF_LPFILEHANDLER fileHandler =
- m_pInfo->FFI_DownloadFromURL(m_pInfo, wsURL);
+ FPDF_LPFILEHANDLER fileHandler =
+ m_pInfo->FFI_DownloadFromURL(m_pInfo, wsURL);
- return new CFPDF_FileStream(fileHandler);
- }
- return nullptr;
+ return new CFPDF_FileStream(fileHandler);
}
- CFX_WideString FFI_PostRequestURL(const FX_WCHAR* wsURL,
- const FX_WCHAR* wsData,
- const FX_WCHAR* wsContentType,
- const FX_WCHAR* wsEncode,
- const FX_WCHAR* wsHeader) {
- if (m_pInfo && m_pInfo->FFI_PostRequestURL) {
- CFX_ByteString bsURL = CFX_WideString(wsURL).UTF16LE_Encode();
- FPDF_WIDESTRING URL = (FPDF_WIDESTRING)bsURL.GetBuffer(bsURL.GetLength());
+ CFX_WideString PostRequestURL(const FX_WCHAR* wsURL,
+ const FX_WCHAR* wsData,
+ const FX_WCHAR* wsContentType,
+ const FX_WCHAR* wsEncode,
+ const FX_WCHAR* wsHeader) {
+ if (!m_pInfo || !m_pInfo->FFI_PostRequestURL)
+ return L"";
- CFX_ByteString bsData = CFX_WideString(wsData).UTF16LE_Encode();
- FPDF_WIDESTRING data =
- (FPDF_WIDESTRING)bsData.GetBuffer(bsData.GetLength());
+ CFX_ByteString bsURL = CFX_WideString(wsURL).UTF16LE_Encode();
+ FPDF_WIDESTRING URL = (FPDF_WIDESTRING)bsURL.GetBuffer(bsURL.GetLength());
- CFX_ByteString bsContentType =
- CFX_WideString(wsContentType).UTF16LE_Encode();
- FPDF_WIDESTRING contentType =
- (FPDF_WIDESTRING)bsContentType.GetBuffer(bsContentType.GetLength());
+ CFX_ByteString bsData = CFX_WideString(wsData).UTF16LE_Encode();
+ FPDF_WIDESTRING data =
+ (FPDF_WIDESTRING)bsData.GetBuffer(bsData.GetLength());
- CFX_ByteString bsEncode = CFX_WideString(wsEncode).UTF16LE_Encode();
- FPDF_WIDESTRING encode =
- (FPDF_WIDESTRING)bsEncode.GetBuffer(bsEncode.GetLength());
+ CFX_ByteString bsContentType =
+ CFX_WideString(wsContentType).UTF16LE_Encode();
+ FPDF_WIDESTRING contentType =
+ (FPDF_WIDESTRING)bsContentType.GetBuffer(bsContentType.GetLength());
- CFX_ByteString bsHeader = CFX_WideString(wsHeader).UTF16LE_Encode();
- FPDF_WIDESTRING header =
- (FPDF_WIDESTRING)bsHeader.GetBuffer(bsHeader.GetLength());
+ CFX_ByteString bsEncode = CFX_WideString(wsEncode).UTF16LE_Encode();
+ FPDF_WIDESTRING encode =
+ (FPDF_WIDESTRING)bsEncode.GetBuffer(bsEncode.GetLength());
- FPDF_BSTR response;
- FPDF_BStr_Init(&response);
- m_pInfo->FFI_PostRequestURL(m_pInfo, URL, data, contentType, encode,
- header, &response);
+ CFX_ByteString bsHeader = CFX_WideString(wsHeader).UTF16LE_Encode();
+ FPDF_WIDESTRING header =
+ (FPDF_WIDESTRING)bsHeader.GetBuffer(bsHeader.GetLength());
- CFX_WideString wsRet = CFX_WideString::FromUTF16LE(
- (unsigned short*)response.str, response.len / sizeof(unsigned short));
- FPDF_BStr_Clear(&response);
+ FPDF_BSTR response;
+ FPDF_BStr_Init(&response);
+ m_pInfo->FFI_PostRequestURL(m_pInfo, URL, data, contentType, encode, header,
+ &response);
- return wsRet;
- }
- return L"";
+ CFX_WideString wsRet = CFX_WideString::FromUTF16LE(
+ (unsigned short*)response.str, response.len / sizeof(unsigned short));
+ FPDF_BStr_Clear(&response);
+
+ return wsRet;
}
- FPDF_BOOL FFI_PutRequestURL(const FX_WCHAR* wsURL,
- const FX_WCHAR* wsData,
- const FX_WCHAR* wsEncode) {
- if (m_pInfo && m_pInfo->FFI_PutRequestURL) {
- CFX_ByteString bsURL = CFX_WideString(wsURL).UTF16LE_Encode();
- FPDF_WIDESTRING URL = (FPDF_WIDESTRING)bsURL.GetBuffer(bsURL.GetLength());
+ FPDF_BOOL PutRequestURL(const FX_WCHAR* wsURL,
+ const FX_WCHAR* wsData,
+ const FX_WCHAR* wsEncode) {
+ if (!m_pInfo || !m_pInfo->FFI_PutRequestURL)
+ return FALSE;
- CFX_ByteString bsData = CFX_WideString(wsData).UTF16LE_Encode();
- FPDF_WIDESTRING data =
- (FPDF_WIDESTRING)bsData.GetBuffer(bsData.GetLength());
+ CFX_ByteString bsURL = CFX_WideString(wsURL).UTF16LE_Encode();
+ FPDF_WIDESTRING URL = (FPDF_WIDESTRING)bsURL.GetBuffer(bsURL.GetLength());
- CFX_ByteString bsEncode = CFX_WideString(wsEncode).UTF16LE_Encode();
- FPDF_WIDESTRING encode =
- (FPDF_WIDESTRING)bsEncode.GetBuffer(bsEncode.GetLength());
+ CFX_ByteString bsData = CFX_WideString(wsData).UTF16LE_Encode();
+ FPDF_WIDESTRING data =
+ (FPDF_WIDESTRING)bsData.GetBuffer(bsData.GetLength());
- return m_pInfo->FFI_PutRequestURL(m_pInfo, URL, data, encode);
- }
- return FALSE;
+ CFX_ByteString bsEncode = CFX_WideString(wsEncode).UTF16LE_Encode();
+ FPDF_WIDESTRING encode =
+ (FPDF_WIDESTRING)bsEncode.GetBuffer(bsEncode.GetLength());
+
+ return m_pInfo->FFI_PutRequestURL(m_pInfo, URL, data, encode);
}
- CFX_WideString FFI_GetLanguage() {
- if (m_pInfo && m_pInfo->FFI_GetLanguage) {
- int nRequiredLen = m_pInfo->FFI_GetLanguage(m_pInfo, nullptr, 0);
- if (nRequiredLen <= 0)
- return L"";
-
- char* pbuff = new char[nRequiredLen];
- memset(pbuff, 0, nRequiredLen);
- int nActualLen = m_pInfo->FFI_GetLanguage(m_pInfo, pbuff, nRequiredLen);
- if (nActualLen <= 0 || nActualLen > nRequiredLen) {
- delete[] pbuff;
- return L"";
- }
- CFX_ByteString bsRet = CFX_ByteString(pbuff, nActualLen);
- CFX_WideString wsRet = CFX_WideString::FromUTF16LE(
- (unsigned short*)bsRet.GetBuffer(bsRet.GetLength()),
- bsRet.GetLength() / sizeof(unsigned short));
+ CFX_WideString GetLanguage() {
+ if (!m_pInfo || !m_pInfo->FFI_GetLanguage)
+ return L"";
+
+ int nRequiredLen = m_pInfo->FFI_GetLanguage(m_pInfo, nullptr, 0);
+ if (nRequiredLen <= 0)
+ return L"";
+
+ char* pbuff = new char[nRequiredLen];
+ memset(pbuff, 0, nRequiredLen);
+ int nActualLen = m_pInfo->FFI_GetLanguage(m_pInfo, pbuff, nRequiredLen);
+ if (nActualLen <= 0 || nActualLen > nRequiredLen) {
delete[] pbuff;
- return wsRet;
+ return L"";
}
- return L"";
+ CFX_ByteString bsRet = CFX_ByteString(pbuff, nActualLen);
+ CFX_WideString wsRet = CFX_WideString::FromUTF16LE(
+ (unsigned short*)bsRet.GetBuffer(bsRet.GetLength()),
+ bsRet.GetLength() / sizeof(unsigned short));
+ delete[] pbuff;
+ return wsRet;
}
- void FFI_PageEvent(int iPageCount, uint32_t dwEventType) const {
+ void PageEvent(int iPageCount, uint32_t dwEventType) const {
if (m_pInfo && m_pInfo->FFI_PageEvent)
m_pInfo->FFI_PageEvent(m_pInfo, iPageCount, dwEventType);
}