| 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_MGR_H | 7 #ifndef _FPDFSDK_MGR_H |
| 8 #define _FPDFSDK_MGR_H | 8 #define _FPDFSDK_MGR_H |
| 9 | 9 |
| 10 #include "fsdk_common.h" | 10 #include "fsdk_common.h" |
| 11 #include "fsdk_define.h" | 11 #include "fsdk_define.h" |
| 12 #include "fx_systemhandler.h" | 12 #include "fx_systemhandler.h" |
| 13 #include "fpdfxfa/fpdfxfa_doc.h" | 13 #include "fpdfxfa/fpdfxfa_doc.h" |
| 14 #include "fpdfxfa/fpdfxfa_page.h" | 14 #include "fpdfxfa/fpdfxfa_page.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 42 int RegAppHandle(FPDF_FORMFILLINFO* pFFinfo);//{ m_pInfo = pFFinfo; ret
urn TRUE;} | 42 int RegAppHandle(FPDF_FORMFILLINFO* pFFinfo);//{ m_pInfo = pFFinfo; ret
urn TRUE;} |
| 43 | 43 |
| 44 virtual void Release() | 44 virtual void Release() |
| 45 { | 45 { |
| 46 if (m_pInfo && m_pInfo->Release) | 46 if (m_pInfo && m_pInfo->Release) |
| 47 m_pInfo->Release(m_pInfo); | 47 m_pInfo->Release(m_pInfo); |
| 48 delete this; | 48 delete this; |
| 49 } | 49 } |
| 50 void FFI_Invalidate(FPDF_PAGE page, double left, double top, double righ
t, double bottom) | 50 void FFI_Invalidate(FPDF_PAGE page, double left, double top, double righ
t, double bottom) |
| 51 { | 51 { |
| 52 » » if (m_pInfo && m_pInfo->FFI_Invalidate) | 52 » » if (m_pInfo && m_pInfo->FFI_Invalidate) |
| 53 { | 53 { |
| 54 m_pInfo->FFI_Invalidate(m_pInfo, page, left, top, right,
bottom); | 54 m_pInfo->FFI_Invalidate(m_pInfo, page, left, top, right,
bottom); |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 void FFI_OutputSelectedRect(FPDF_PAGE page, double left, double top, dou
ble right, double bottom) | 57 void FFI_OutputSelectedRect(FPDF_PAGE page, double left, double top, dou
ble right, double bottom) |
| 58 { | 58 { |
| 59 » » if (m_pInfo && m_pInfo->FFI_OutputSelectedRect) | 59 » » if (m_pInfo && m_pInfo->FFI_OutputSelectedRect) |
| 60 { | 60 { |
| 61 m_pInfo->FFI_OutputSelectedRect(m_pInfo, page, left, top
, right, bottom); | 61 m_pInfo->FFI_OutputSelectedRect(m_pInfo, page, left, top
, right, bottom); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 void FFI_SetCursor(int nCursorType) | 65 void FFI_SetCursor(int nCursorType) |
| 66 { | 66 { |
| 67 » » if (m_pInfo && m_pInfo->FFI_SetCursor) | 67 » » if (m_pInfo && m_pInfo->FFI_SetCursor) |
| 68 { | 68 { |
| 69 m_pInfo->FFI_SetCursor(m_pInfo, nCursorType); | 69 m_pInfo->FFI_SetCursor(m_pInfo, nCursorType); |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 int FFI_SetTimer(int uElapse, TimerCallback lpTimerFunc) | 73 int FFI_SetTimer(int uElapse, TimerCallback lpTimerFunc) |
| 74 { | 74 { |
| 75 » » if (m_pInfo && m_pInfo->FFI_SetTimer) | 75 » » if (m_pInfo && m_pInfo->FFI_SetTimer) |
| 76 { | 76 { |
| 77 return m_pInfo->FFI_SetTimer(m_pInfo, uElapse, lpTimerFu
nc); | 77 return m_pInfo->FFI_SetTimer(m_pInfo, uElapse, lpTimerFu
nc); |
| 78 } | 78 } |
| 79 return -1; | 79 return -1; |
| 80 } | 80 } |
| 81 » » | 81 |
| 82 void FFI_KillTimer(int nTimerID) | 82 void FFI_KillTimer(int nTimerID) |
| 83 { | 83 { |
| 84 » » if (m_pInfo && m_pInfo->FFI_KillTimer) | 84 » » if (m_pInfo && m_pInfo->FFI_KillTimer) |
| 85 { | 85 { |
| 86 m_pInfo->FFI_KillTimer(m_pInfo, nTimerID); | 86 m_pInfo->FFI_KillTimer(m_pInfo, nTimerID); |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 FX_SYSTEMTIME FFI_GetLocalTime() | 89 FX_SYSTEMTIME FFI_GetLocalTime() |
| 90 { | 90 { |
| 91 FX_SYSTEMTIME fxtime; | 91 FX_SYSTEMTIME fxtime; |
| 92 if(m_pInfo && m_pInfo->FFI_GetLocalTime) | 92 if(m_pInfo && m_pInfo->FFI_GetLocalTime) |
| 93 { | 93 { |
| 94 FPDF_SYSTEMTIME systime = m_pInfo->FFI_GetLocalTime(m_pI
nfo); | 94 FPDF_SYSTEMTIME systime = m_pInfo->FFI_GetLocalTime(m_pI
nfo); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 107 void FFI_OnChange() | 107 void FFI_OnChange() |
| 108 { | 108 { |
| 109 if(m_pInfo && m_pInfo->FFI_OnChange) | 109 if(m_pInfo && m_pInfo->FFI_OnChange) |
| 110 { | 110 { |
| 111 m_pInfo->FFI_OnChange(m_pInfo); | 111 m_pInfo->FFI_OnChange(m_pInfo); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 FX_BOOL FFI_IsSHIFTKeyDown(FX_DWORD nFlag) | 115 FX_BOOL FFI_IsSHIFTKeyDown(FX_DWORD nFlag) |
| 116 { | 116 { |
| 117 » » | 117 |
| 118 return (nFlag & FWL_EVENTFLAG_ShiftKey) != 0; | 118 return (nFlag & FWL_EVENTFLAG_ShiftKey) != 0; |
| 119 } | 119 } |
| 120 FX_BOOL FFI_IsCTRLKeyDown(FX_DWORD nFlag) | 120 FX_BOOL FFI_IsCTRLKeyDown(FX_DWORD nFlag) |
| 121 { | 121 { |
| 122 | 122 |
| 123 return (nFlag & FWL_EVENTFLAG_ControlKey) != 0; | 123 return (nFlag & FWL_EVENTFLAG_ControlKey) != 0; |
| 124 } | 124 } |
| 125 FX_BOOL FFI_IsALTKeyDown(FX_DWORD nFlag) | 125 FX_BOOL FFI_IsALTKeyDown(FX_DWORD nFlag) |
| 126 { | 126 { |
| 127 | 127 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 153 if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform-
>app_response) | 153 if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform-
>app_response) |
| 154 { | 154 { |
| 155 CFX_ByteString bsQuestion = CFX_WideString(Question).UTF
16LE_Encode(); | 155 CFX_ByteString bsQuestion = CFX_WideString(Question).UTF
16LE_Encode(); |
| 156 CFX_ByteString bsTitle = CFX_WideString(Title).UTF16LE_E
ncode(); | 156 CFX_ByteString bsTitle = CFX_WideString(Title).UTF16LE_E
ncode(); |
| 157 CFX_ByteString bsDefault = CFX_WideString(Default).UTF16
LE_Encode(); | 157 CFX_ByteString bsDefault = CFX_WideString(Default).UTF16
LE_Encode(); |
| 158 CFX_ByteString bsLabel = CFX_WideString(cLabel).UTF16LE_
Encode(); | 158 CFX_ByteString bsLabel = CFX_WideString(cLabel).UTF16LE_
Encode(); |
| 159 FPDF_WIDESTRING pQuestion = (FPDF_WIDESTRING)bsQuestion.
GetBuffer(bsQuestion.GetLength()); | 159 FPDF_WIDESTRING pQuestion = (FPDF_WIDESTRING)bsQuestion.
GetBuffer(bsQuestion.GetLength()); |
| 160 FPDF_WIDESTRING pTitle = (FPDF_WIDESTRING)bsTitle.GetBuf
fer(bsTitle.GetLength()); | 160 FPDF_WIDESTRING pTitle = (FPDF_WIDESTRING)bsTitle.GetBuf
fer(bsTitle.GetLength()); |
| 161 FPDF_WIDESTRING pDefault = (FPDF_WIDESTRING)bsDefault.Ge
tBuffer(bsDefault.GetLength()); | 161 FPDF_WIDESTRING pDefault = (FPDF_WIDESTRING)bsDefault.Ge
tBuffer(bsDefault.GetLength()); |
| 162 FPDF_WIDESTRING pLabel = (FPDF_WIDESTRING)bsLabel.GetBuf
fer(bsLabel.GetLength()); | 162 FPDF_WIDESTRING pLabel = (FPDF_WIDESTRING)bsLabel.GetBuf
fer(bsLabel.GetLength()); |
| 163 » » » int ret = m_pInfo->m_pJsPlatform->app_response(m_pInfo->
m_pJsPlatform, pQuestion, pTitle, | 163 » » » int ret = m_pInfo->m_pJsPlatform->app_response(m_pInfo->
m_pJsPlatform, pQuestion, pTitle, |
| 164 pDefault, pLabel, bPassword, response, length); | 164 pDefault, pLabel, bPassword, response, length); |
| 165 bsQuestion.ReleaseBuffer(); | 165 bsQuestion.ReleaseBuffer(); |
| 166 bsTitle.ReleaseBuffer(); | 166 bsTitle.ReleaseBuffer(); |
| 167 bsDefault.ReleaseBuffer(); | 167 bsDefault.ReleaseBuffer(); |
| 168 bsLabel.ReleaseBuffer(); | 168 bsLabel.ReleaseBuffer(); |
| 169 return ret; | 169 return ret; |
| 170 } | 170 } |
| 171 return -1; | 171 return -1; |
| 172 } | 172 } |
| 173 | 173 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 FPDF_WIDESTRING pMsg = (FPDF_WIDESTRING)bsMsg.GetBuffer(
bsMsg.GetLength()); | 260 FPDF_WIDESTRING pMsg = (FPDF_WIDESTRING)bsMsg.GetBuffer(
bsMsg.GetLength()); |
| 261 m_pInfo->m_pJsPlatform->Doc_mail(m_pInfo->m_pJsPlatform,
mailData, length, bUI, pTo, pSubject, | 261 m_pInfo->m_pJsPlatform->Doc_mail(m_pInfo->m_pJsPlatform,
mailData, length, bUI, pTo, pSubject, |
| 262 pCC, pBcc, pMsg); | 262 pCC, pBcc, pMsg); |
| 263 bsTo.ReleaseBuffer(); | 263 bsTo.ReleaseBuffer(); |
| 264 bsCC.ReleaseBuffer(); | 264 bsCC.ReleaseBuffer(); |
| 265 bsBcc.ReleaseBuffer(); | 265 bsBcc.ReleaseBuffer(); |
| 266 bsSubject.ReleaseBuffer(); | 266 bsSubject.ReleaseBuffer(); |
| 267 bsMsg.ReleaseBuffer(); | 267 bsMsg.ReleaseBuffer(); |
| 268 } | 268 } |
| 269 } | 269 } |
| 270 CFX_WideString JS_appbrowseForDoc(FPDF_BOOL bSave, FX_LPCWSTR cFilenameI
nit) | |
| 271 { | |
| 272 //to do.... | |
| 273 return L""; | |
| 274 // if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->
app_browseForDoc) | |
| 275 // { | |
| 276 // CFX_ByteString bsFilenameInit = CFX_WideString(cFilename
Init).UTF16LE_Encode(); | |
| 277 // FPDF_WIDESTRING pFileNameInit = (FPDF_WIDESTRING)bsFilen
ameInit.GetBuffer(bsFilenameInit.GetLength()); | |
| 278 // | |
| 279 // m_pInfo->m_pJsPlatform->app_browseForDoc(m_pInfo->m_pJsP
latform, pFileNameInit); | |
| 280 // bsFilenameInit.ReleaseBuffer(); | |
| 281 // } | |
| 282 } | |
| 283 | 270 |
| 284 void JS_docprint(FPDF_BOOL bUI , int nStart, int nEnd, FPDF_BOOL bSilent
,FPDF_BOOL bShrinkToFit,FPDF_BOOL bPrintAsImage ,FPDF_BOOL bReverse ,FPDF_BOOL
bAnnotations) | 271 void JS_docprint(FPDF_BOOL bUI , int nStart, int nEnd, FPDF_BOOL bSilent
,FPDF_BOOL bShrinkToFit,FPDF_BOOL bPrintAsImage ,FPDF_BOOL bReverse ,FPDF_BOOL
bAnnotations) |
| 285 { | 272 { |
| 286 if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->
Doc_print) | 273 if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->
Doc_print) |
| 287 { | 274 { |
| 288 m_pInfo->m_pJsPlatform->Doc_print(m_pInfo->m_pJsPlatform
, bUI, nStart, nEnd, bSilent, bShrinkToFit, bPrintAsImage, bReverse, bAnnotation
s); | 275 m_pInfo->m_pJsPlatform->Doc_print(m_pInfo->m_pJsPlatform
, bUI, nStart, nEnd, bSilent, bShrinkToFit, bPrintAsImage, bReverse, bAnnotation
s); |
| 289 } | 276 } |
| 290 } | 277 } |
| 291 void JS_docgotoPage(int nPageNum) | 278 void JS_docgotoPage(int nPageNum) |
| 292 { | 279 { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 return CFX_WideString(L"Acrobat"); | 369 return CFX_WideString(L"Acrobat"); |
| 383 | 370 |
| 384 //if (m_pInfo && m_pInfo->FFI_GetAppName) | 371 //if (m_pInfo && m_pInfo->FFI_GetAppName) |
| 385 //{ | 372 //{ |
| 386 // int nLen = m_pInfo->FFI_GetAppName(m_pInfo, NULL, 0); | 373 // int nLen = m_pInfo->FFI_GetAppName(m_pInfo, NULL, 0); |
| 387 // if(nLen <= 0) | 374 // if(nLen <= 0) |
| 388 // return L""; | 375 // return L""; |
| 389 // char* pbuff = new char[nLen]; | 376 // char* pbuff = new char[nLen]; |
| 390 // if(pbuff) | 377 // if(pbuff) |
| 391 // memset(pbuff, 0, nLen); | 378 // memset(pbuff, 0, nLen); |
| 392 » » //» else» | 379 » » //» else |
| 393 // return L""; | 380 // return L""; |
| 394 // nLen = m_pInfo->FFI_GetAppName(m_pInfo, pbuff, nLen); | 381 // nLen = m_pInfo->FFI_GetAppName(m_pInfo, pbuff, nLen); |
| 395 // CFX_ByteString bsRet = CFX_ByteString(pbuff, nLen); | 382 // CFX_ByteString bsRet = CFX_ByteString(pbuff, nLen); |
| 396 // CFX_WideString wsRet = CFX_WideString::FromLocal(bsRet); | 383 // CFX_WideString wsRet = CFX_WideString::FromLocal(bsRet); |
| 397 // delete[] pbuff; | 384 // delete[] pbuff; |
| 398 // return wsRet; | 385 // return wsRet; |
| 399 //} | 386 //} |
| 400 | 387 |
| 401 //return L""; | 388 //return L""; |
| 402 } | 389 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 //if (m_pInfo && m_pInfo->FFI_PageEvent) | 450 //if (m_pInfo && m_pInfo->FFI_PageEvent) |
| 464 //{ | 451 //{ |
| 465 // m_pInfo->FFI_PageEvent(m_pInfo, page, flag); | 452 // m_pInfo->FFI_PageEvent(m_pInfo, page, flag); |
| 466 //} | 453 //} |
| 467 } | 454 } |
| 468 | 455 |
| 469 void FFI_GetPageViewRect(FPDF_PAGE page, FS_RECTF& dstRect) | 456 void FFI_GetPageViewRect(FPDF_PAGE page, FS_RECTF& dstRect) |
| 470 { | 457 { |
| 471 if (m_pInfo && m_pInfo->FFI_GetPageViewRect) | 458 if (m_pInfo && m_pInfo->FFI_GetPageViewRect) |
| 472 { | 459 { |
| 473 » » » double left; | 460 » » » double left; |
| 474 double top; | 461 double top; |
| 475 double right; | 462 double right; |
| 476 double bottom; | 463 double bottom; |
| 477 m_pInfo->FFI_GetPageViewRect(m_pInfo, page, &left, &top,
&right, &bottom); | 464 m_pInfo->FFI_GetPageViewRect(m_pInfo, page, &left, &top,
&right, &bottom); |
| 478 | 465 |
| 479 dstRect.left = static_cast<float>(left); | 466 dstRect.left = static_cast<float>(left); |
| 480 dstRect.top = static_cast<float>(top < bottom ? bottom :
top); | 467 dstRect.top = static_cast<float>(top < bottom ? bottom :
top); |
| 481 dstRect.bottom = static_cast<float>(top < bottom ? top :
bottom); | 468 dstRect.bottom = static_cast<float>(top < bottom ? top :
bottom); |
| 482 dstRect.right = static_cast<float>(right); | 469 dstRect.right = static_cast<float>(right); |
| 483 } | 470 } |
| 484 } | 471 } |
| 485 | 472 |
| 486 | 473 |
| 487 FX_BOOL FFI_PopupMenu(FPDF_PAGE page, FPDF_WIDGET hWidget, int menuFlag
, CFX_PointF ptPopup, const CFX_PointF* pRectExclude) | 474 FX_BOOL FFI_PopupMenu(FPDF_PAGE page, FPDF_WIDGET hWidget, int menuFlag
, CFX_PointF ptPopup, const CFX_PointF* pRectExclude) |
| 488 { | 475 { |
| 489 if (m_pInfo && m_pInfo->FFI_PopupMenu) | 476 if (m_pInfo && m_pInfo->FFI_PopupMenu) |
| 490 { | 477 { |
| 491 return m_pInfo->FFI_PopupMenu(m_pInfo, page, hWidget, me
nuFlag, ptPopup.x, ptPopup.y); | 478 return m_pInfo->FFI_PopupMenu(m_pInfo, page, hWidget, me
nuFlag, ptPopup.x, ptPopup.y); |
| 492 } | 479 } |
| 493 return FALSE; | 480 return FALSE; |
| 494 } | 481 } |
| 495 » | 482 |
| 496 void FFI_Alert(FPDF_WIDESTRING Msg, FPDF_WIDESTRING Title, int Type,
int Icon) | 483 void FFI_Alert(FPDF_WIDESTRING Msg, FPDF_WIDESTRING Title, int Type,
int Icon) |
| 497 { | 484 { |
| 498 if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->
app_alert) | 485 if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->
app_alert) |
| 499 { | 486 { |
| 500 m_pInfo->m_pJsPlatform->app_alert(m_pInfo->m_pJsPlatform
, Msg, Title, Type, Icon); | 487 m_pInfo->m_pJsPlatform->app_alert(m_pInfo->m_pJsPlatform
, Msg, Title, Type, Icon); |
| 501 } | 488 } |
| 502 } | 489 } |
| 503 void FFI_EmailTo(FPDF_FILEHANDLER* fileHandler, FPDF_WIDESTRING pTo,
FPDF_WIDESTRING pSubject, FPDF_WIDESTRING pCC, FPDF_WIDESTRING pBcc, FPDF_WIDEST
RING pMsg) | 490 void FFI_EmailTo(FPDF_FILEHANDLER* fileHandler, FPDF_WIDESTRING pTo,
FPDF_WIDESTRING pSubject, FPDF_WIDESTRING pCC, FPDF_WIDESTRING pBcc, FPDF_WIDEST
RING pMsg) |
| 504 { | 491 { |
| 505 if(m_pInfo && m_pInfo->FFI_EmailTo) | 492 if(m_pInfo && m_pInfo->FFI_EmailTo) |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 /*CFX_ByteString bsTitle = CFX_WideString(wsTitle).UTF16LE_Encod
e(); | 626 /*CFX_ByteString bsTitle = CFX_WideString(wsTitle).UTF16LE_Encod
e(); |
| 640 FPDF_WIDESTRING title = (FPDF_WIDESTRING)bsTitle.GetBuffer(bsTit
le.GetLength()); | 627 FPDF_WIDESTRING title = (FPDF_WIDESTRING)bsTitle.GetBuffer(bsTit
le.GetLength()); |
| 641 | 628 |
| 642 CFX_ByteString bsFilter = CFX_WideString(wsFilter).UTF16LE_Encod
e(); | 629 CFX_ByteString bsFilter = CFX_WideString(wsFilter).UTF16LE_Encod
e(); |
| 643 FPDF_WIDESTRING filter = (FPDF_WIDESTRING)bsFilter.GetBuffer(bsF
ilter.GetLength()); | 630 FPDF_WIDESTRING filter = (FPDF_WIDESTRING)bsFilter.GetBuffer(bsF
ilter.GetLength()); |
| 644 | 631 |
| 645 CFX_ByteStringArray* strPathArr = FX_NEW CFX_ByteStringArray(); | 632 CFX_ByteStringArray* strPathArr = FX_NEW CFX_ByteStringArray(); |
| 646 if (m_pInfo && m_pInfo->FFI_ShowFileDialog) | 633 if (m_pInfo && m_pInfo->FFI_ShowFileDialog) |
| 647 { | 634 { |
| 648 FPDF_BOOL bRet = m_pInfo->FFI_ShowFileDialog(m_pInfo, ti
tle, filter, bOpen, (FPDF_STRINGHANDLE)strPathArr); | 635 FPDF_BOOL bRet = m_pInfo->FFI_ShowFileDialog(m_pInfo, ti
tle, filter, bOpen, (FPDF_STRINGHANDLE)strPathArr); |
| 649 » » » if (bRet) | 636 » » » if (bRet) |
| 650 { | 637 { |
| 651 int count = strPathArr->GetSize(); | 638 int count = strPathArr->GetSize(); |
| 652 for (int i=0; i<count; i++) | 639 for (int i=0; i<count; i++) |
| 653 { | 640 { |
| 654 CFX_ByteString bsPath = *strPathArr->Get
DataPtr(i); | 641 CFX_ByteString bsPath = *strPathArr->Get
DataPtr(i); |
| 655 CFX_WideString wsPath = CFX_WideString::
FromUTF16LE((unsigned short*)bsPath.GetBuffer(bsPath.GetLength()), bsPath.GetLen
gth()/sizeof(unsigned short)); | 642 CFX_WideString wsPath = CFX_WideString::
FromUTF16LE((unsigned short*)bsPath.GetBuffer(bsPath.GetLength()), bsPath.GetLen
gth()/sizeof(unsigned short)); |
| 656 if (!wsPath.IsEmpty()) | 643 if (!wsPath.IsEmpty()) |
| 657 wsPathArr.Add(wsPath); | 644 wsPathArr.Add(wsPath); |
| 658 wsPath = L""; | 645 wsPath = L""; |
| 659 } | 646 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 689 CFX_WideString wsRet = CFX_WideString::FromUTF16LE((unsi
gned short*)bsRet.GetBuffer(bsRet.GetLength()), bsRet.GetLength()/sizeof(unsigne
d short)); | 676 CFX_WideString wsRet = CFX_WideString::FromUTF16LE((unsi
gned short*)bsRet.GetBuffer(bsRet.GetLength()), bsRet.GetLength()/sizeof(unsigne
d short)); |
| 690 delete[] pbuff; | 677 delete[] pbuff; |
| 691 return wsRet; | 678 return wsRet; |
| 692 } | 679 } |
| 693 return L""; | 680 return L""; |
| 694 } | 681 } |
| 695 | 682 |
| 696 public: | 683 public: |
| 697 FX_BOOL IsJSInitiated(); | 684 FX_BOOL IsJSInitiated(); |
| 698 | 685 |
| 699 public:» | 686 public: |
| 700 void SetCurrentDoc(CPDFSDK_Document* pFXDoc)
{m_pSDKDoc = pFXDoc;} | 687 void SetCurrentDoc(CPDFSDK_Document* pFXDoc)
{m_pSDKDoc = pFXDoc;} |
| 701 CPDFSDK_Document* GetCurrentDoc(); | 688 CPDFSDK_Document* GetCurrentDoc(); |
| 702 CPDFXFA_Document* GetPDFXFADocument() {return m_pDoc;} | 689 CPDFXFA_Document* GetPDFXFADocument() {return m_pDoc;} |
| 703 // CPDFSDK_Document* GetDocument(int nIndex); | 690 // CPDFSDK_Document* GetDocument(int nIndex); |
| 704 // int CountDocuments() {return m_docMa
p.GetCount();} | 691 // int CountDocuments() {return m_docMa
p.GetCount();} |
| 705 | 692 |
| 706 CPDFSDK_Document* OpenDocument(CFX_WideString &fileName){r
eturn NULL;} | 693 CPDFSDK_Document* OpenDocument(CFX_WideString &fileName){r
eturn NULL;} |
| 707 CPDFSDK_Document* OpenMemPDFDoc(CPDF_Document* pNewDoc, CF
X_WideString &fileName){return NULL;} | 694 CPDFSDK_Document* OpenMemPDFDoc(CPDF_Document* pNewDoc, CF
X_WideString &fileName){return NULL;} |
| 708 » FX_BOOL»» » » » OpenURL(CFX_WideString &filePath
){return FALSE;} | 695 |
| 709 » | |
| 710 | 696 |
| 711 CFX_ByteString GetAppName() {return "";} | 697 CFX_ByteString GetAppName() {return "";} |
| 712 | 698 |
| 713 CFFL_IFormFiller* GetIFormFiller(); | 699 CFFL_IFormFiller* GetIFormFiller(); |
| 714 IFX_SystemHandler* GetSysHandler() {return m_pSysHandler;} | 700 IFX_SystemHandler* GetSysHandler() {return m_pSysHandler;} |
| 715 | 701 |
| 716 public: | 702 public: |
| 717 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); | 703 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); |
| 718 IFXJS_Runtime* GetJSRuntime(); | 704 IFXJS_Runtime* GetJSRuntime(); |
| 719 CPDFSDK_ActionHandler* GetActionHander(); | 705 CPDFSDK_ActionHandler* GetActionHander(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 void AddPageView(CPDFXFA_Page* pPDFXF
APage, CPDFSDK_PageView* pPageView); | 753 void AddPageView(CPDFXFA_Page* pPDFXF
APage, CPDFSDK_PageView* pPageView); |
| 768 CPDFSDK_PageView* GetPageView(CPDFXFA_Page* pPDFXFAPage, F
X_BOOL ReNew = TRUE); | 754 CPDFSDK_PageView* GetPageView(CPDFXFA_Page* pPDFXFAPage, F
X_BOOL ReNew = TRUE); |
| 769 CPDFSDK_PageView* GetPageView(int nIndex); | 755 CPDFSDK_PageView* GetPageView(int nIndex); |
| 770 CPDFSDK_PageView* GetCurrentView(); | 756 CPDFSDK_PageView* GetCurrentView(); |
| 771 void ReMovePageView(CPDFXFA_Page* pPD
FPage); | 757 void ReMovePageView(CPDFXFA_Page* pPD
FPage); |
| 772 void UpdateAllViews(CPDFSDK_PageView*
pSender, CPDFSDK_Annot* pAnnot); | 758 void UpdateAllViews(CPDFSDK_PageView*
pSender, CPDFSDK_Annot* pAnnot); |
| 773 | 759 |
| 774 CPDFSDK_Annot* GetFocusAnnot();//{return NULL;} | 760 CPDFSDK_Annot* GetFocusAnnot();//{return NULL;} |
| 775 | 761 |
| 776 IFXJS_Runtime * GetJsRuntime(); | 762 IFXJS_Runtime * GetJsRuntime(); |
| 777 » | 763 |
| 778 FX_BOOL SetFocusAnnot(CPDFSDK_Annot* pAn
not, FX_UINT nFlag = 0);//{return FALSE;} | 764 FX_BOOL SetFocusAnnot(CPDFSDK_Annot* pAn
not, FX_UINT nFlag = 0);//{return FALSE;} |
| 779 FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0
); | 765 FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0
); |
| 780 | 766 |
| 781 FX_BOOL ExtractPages(const CFX_WordArray
&arrExtraPages, CPDF_Document* pDstDoc); | 767 FX_BOOL ExtractPages(const CFX_WordArray
&arrExtraPages, CPDF_Document* pDstDoc); |
| 782 FX_BOOL InsertPages(int nInsertAt, const
CPDF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages); | 768 FX_BOOL InsertPages(int nInsertAt, const
CPDF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages); |
| 783 FX_BOOL DeletePages(int nStart, int nCou
nt); | 769 FX_BOOL DeletePages(int nStart, int nCou
nt); |
| 784 FX_BOOL ReplacePages(int nPage, const CP
DF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages); | 770 FX_BOOL ReplacePages(int nPage, const CP
DF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages); |
| 785 | 771 |
| 786 void OnCloseDocument(); | 772 void OnCloseDocument(); |
| 787 | 773 |
| 788 int GetPageCount() {return m
_pDoc->GetPageCount();} | 774 int GetPageCount() {return m
_pDoc->GetPageCount();} |
| 789 FX_BOOL GetPermissions(int nFlag); | 775 FX_BOOL GetPermissions(int nFlag); |
| 790 FX_BOOL GetChangeMark() {return m_bChang
eMask;} | 776 FX_BOOL GetChangeMark() {return m_bChang
eMask;} |
| 791 void SetChangeMark() {m_bChangeMask =
TRUE;} | 777 void SetChangeMark() {m_bChangeMask =
TRUE;} |
| 792 void ClearChangeMark() {m_bChangeMask
= FALSE;} | 778 void ClearChangeMark() {m_bChangeMask
= FALSE;} |
| 793 //» FX_BOOL»» » » » GetChangeMark(){return FALSE;}//
IsAnnotModified()||IsFormModified() || IsWidgetModified()|| m_nChangeMark>0 ;}» | 779 //» FX_BOOL»» » » » GetChangeMark(){return FALSE;}//
IsAnnotModified()||IsFormModified() || IsWidgetModified()|| m_nChangeMark>0 ;} |
| 794 // void ClearChangeMark(){} | 780 // void ClearChangeMark(){} |
| 795 CFX_WideString GetPath() ; | 781 CFX_WideString GetPath() ; |
| 796 CPDFXFA_Page* GetPage(int nIndex); | 782 CPDFXFA_Page* GetPage(int nIndex); |
| 797 CPDFDoc_Environment * GetEnv() {return m_pEnv; } | 783 CPDFDoc_Environment * GetEnv() {return m_pEnv; } |
| 798 void ProcJavascriptFun(); | 784 void ProcJavascriptFun(); |
| 799 FX_BOOL ProcOpenAction(); | 785 FX_BOOL ProcOpenAction(); |
| 800 CPDF_OCContext* GetOCContext(); | 786 CPDF_OCContext* GetOCContext(); |
| 801 private: | 787 private: |
| 802 //CFX_ArrayTemplate<CPDFSDK_PageView*> m_pageArray; | 788 //CFX_ArrayTemplate<CPDFSDK_PageView*> m_pageArray; |
| 803 CFX_MapPtrTemplate<CPDFXFA_Page*, CPDFSDK_PageView*> m_pageMap; | 789 CFX_MapPtrTemplate<CPDFXFA_Page*, CPDFSDK_PageView*> m_pageMap; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 822 CPDFSDK_Annot* GetFXWidgetAtPoint(FX_FL
OAT pageX, FX_FLOAT pageY); | 808 CPDFSDK_Annot* GetFXWidgetAtPoint(FX_FL
OAT pageX, FX_FLOAT pageY); |
| 823 CPDFSDK_Annot* GetFocusAnnot() ; | 809 CPDFSDK_Annot* GetFocusAnnot() ; |
| 824 void SetFocusAnnot(CP
DFSDK_Annot* pSDKAnnot,FX_UINT nFlag = 0) {m_pSDKDoc->SetFocusAnnot(pSDKAnnot, n
Flag);} | 810 void SetFocusAnnot(CP
DFSDK_Annot* pSDKAnnot,FX_UINT nFlag = 0) {m_pSDKDoc->SetFocusAnnot(pSDKAnnot, n
Flag);} |
| 825 FX_BOOL KillFocusAnnot(F
X_UINT nFlag = 0) {return m_pSDKDoc->KillFocusAnnot(nFlag);} | 811 FX_BOOL KillFocusAnnot(F
X_UINT nFlag = 0) {return m_pSDKDoc->KillFocusAnnot(nFlag);} |
| 826 FX_BOOL Annot_HasAppeara
nce(CPDF_Annot* pAnnot); | 812 FX_BOOL Annot_HasAppeara
nce(CPDF_Annot* pAnnot); |
| 827 | 813 |
| 828 CPDFSDK_Annot* AddAnnot(CPDF_Dictionary
* pDict); | 814 CPDFSDK_Annot* AddAnnot(CPDF_Dictionary
* pDict); |
| 829 CPDFSDK_Annot* AddAnnot(FX_LPCSTR lpSub
Type,CPDF_Dictionary * pDict); | 815 CPDFSDK_Annot* AddAnnot(FX_LPCSTR lpSub
Type,CPDF_Dictionary * pDict); |
| 830 CPDFSDK_Annot* AddAnnot(CPDF_Annot * pP
DFAnnot); | 816 CPDFSDK_Annot* AddAnnot(CPDF_Annot * pP
DFAnnot); |
| 831 CPDFSDK_Annot* AddAnnot(XFA_HWIDGET pPD
FAnnot); | 817 CPDFSDK_Annot* AddAnnot(XFA_HWIDGET pPD
FAnnot); |
| 832 » FX_BOOL»» » » » » » DeleteAnnot(CPDF
SDK_Annot* pAnnot);» » » » » » » | 818 » FX_BOOL»» » » » » » DeleteAnnot(CPDF
SDK_Annot* pAnnot); |
| 833 » | 819 |
| 834 int CountAnn
ots(); | 820 int CountAnn
ots(); |
| 835 CPDFSDK_Annot* GetAnnot(int nIndex); | 821 CPDFSDK_Annot* GetAnnot(int nIndex); |
| 836 CPDFSDK_Annot* GetAnnotByDict(CPDF_Dictiona
ry * pDict); | 822 CPDFSDK_Annot* GetAnnotByDict(CPDF_Dictiona
ry * pDict); |
| 837 CPDFSDK_Annot* GetAnnotByXFAWidget(XFA_
HWIDGET hWidget); | 823 CPDFSDK_Annot* GetAnnotByXFAWidget(XFA_
HWIDGET hWidget); |
| 838 CPDFXFA_Page* GetPDFXFAPage(){return m
_page;} | 824 CPDFXFA_Page* GetPDFXFAPage(){return m
_page;} |
| 839 CPDF_Page* GetPDFPage(); | 825 CPDF_Page* GetPDFPage(); |
| 840 CPDF_Document* GetPDFDocument(); | 826 CPDF_Document* GetPDFDocument(); |
| 841 » CPDFSDK_Document*» » » » GetSDKDocument() {return
m_pSDKDoc;}» | 827 » CPDFSDK_Document*» » » » GetSDKDocument() {return
m_pSDKDoc;} |
| 842 FX_BOOL OnLButtonDown(const CPDF_Point &
point, FX_UINT nFlag); | 828 FX_BOOL OnLButtonDown(const CPDF_Point &
point, FX_UINT nFlag); |
| 843 FX_BOOL OnLButtonUp(const CPDF_Point & p
oint, FX_UINT nFlag); | 829 FX_BOOL OnLButtonUp(const CPDF_Point & p
oint, FX_UINT nFlag); |
| 844 FX_BOOL OnRButtonDown(const CPDF_Point &
point, FX_UINT nFlag); | 830 FX_BOOL OnRButtonDown(const CPDF_Point &
point, FX_UINT nFlag); |
| 845 FX_BOOL OnRButtonUp(const CPDF_Point & p
oint, FX_UINT nFlag); | 831 FX_BOOL OnRButtonUp(const CPDF_Point & p
oint, FX_UINT nFlag); |
| 846 FX_BOOL OnChar(int nChar, FX_UINT nFlag)
; | 832 FX_BOOL OnChar(int nChar, FX_UINT nFlag)
; |
| 847 FX_BOOL OnKeyDown(int nKeyCode, int nFla
g); | 833 FX_BOOL OnKeyDown(int nKeyCode, int nFla
g); |
| 848 FX_BOOL OnKeyUp(int nKeyCode, int nFlag)
; | 834 FX_BOOL OnKeyUp(int nKeyCode, int nFlag)
; |
| 849 | 835 |
| 850 FX_BOOL OnMouseMove(const CPDF_Point & p
oint, int nFlag); | 836 FX_BOOL OnMouseMove(const CPDF_Point & p
oint, int nFlag); |
| 851 FX_BOOL OnMouseWheel(double deltaX, doub
le deltaY,const CPDF_Point& point, int nFlag); | 837 FX_BOOL OnMouseWheel(double deltaX, doub
le deltaY,const CPDF_Point& point, int nFlag); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 874 FX_BOOL m_bExitWidget; | 860 FX_BOOL m_bExitWidget; |
| 875 FX_BOOL m_bOnWidget; | 861 FX_BOOL m_bOnWidget; |
| 876 FX_BOOL m_bValid; | 862 FX_BOOL m_bValid; |
| 877 FX_BOOL m_bLocked; | 863 FX_BOOL m_bLocked; |
| 878 }; | 864 }; |
| 879 | 865 |
| 880 | 866 |
| 881 template<class TYPE> | 867 template<class TYPE> |
| 882 class CGW_ArrayTemplate : public CFX_ArrayTemplate<TYPE> | 868 class CGW_ArrayTemplate : public CFX_ArrayTemplate<TYPE> |
| 883 { | 869 { |
| 884 public: | 870 public: |
| 885 CGW_ArrayTemplate(){} | 871 CGW_ArrayTemplate(){} |
| 886 virtual ~CGW_ArrayTemplate(){} | 872 virtual ~CGW_ArrayTemplate(){} |
| 887 » | 873 |
| 888 typedef int (*LP_COMPARE)(TYPE p1, TYPE p2); | 874 typedef int (*LP_COMPARE)(TYPE p1, TYPE p2); |
| 889 » | 875 |
| 890 void Sort(LP_COMPARE pCompare, FX_BOOL bAscent = TRUE) | 876 void Sort(LP_COMPARE pCompare, FX_BOOL bAscent = TRUE) |
| 891 { | 877 { |
| 892 int nSize = this->GetSize(); | 878 int nSize = this->GetSize(); |
| 893 QuickSort(0, nSize -1, bAscent, pCompare); | 879 QuickSort(0, nSize -1, bAscent, pCompare); |
| 894 } | 880 } |
| 895 » | 881 |
| 896 private: | 882 private: |
| 897 void QuickSort(FX_UINT nStartPos, FX_UINT nStopPos, FX_BOOL bAscend, LP_
COMPARE pCompare) | 883 void QuickSort(FX_UINT nStartPos, FX_UINT nStopPos, FX_BOOL bAscend, LP_
COMPARE pCompare) |
| 898 { | 884 { |
| 899 if (nStartPos >= nStopPos) return; | 885 if (nStartPos >= nStopPos) return; |
| 900 » » | 886 |
| 901 if ((nStopPos - nStartPos) == 1) | 887 if ((nStopPos - nStartPos) == 1) |
| 902 { | 888 { |
| 903 TYPE Value1 = this->GetAt(nStartPos); | 889 TYPE Value1 = this->GetAt(nStartPos); |
| 904 TYPE Value2 = this->GetAt(nStopPos); | 890 TYPE Value2 = this->GetAt(nStopPos); |
| 905 » » » | 891 |
| 906 int iGreate = (*pCompare)(Value1, Value2); | 892 int iGreate = (*pCompare)(Value1, Value2); |
| 907 if ((bAscend && iGreate > 0) || (!bAscend && iGreate < 0
)) | 893 if ((bAscend && iGreate > 0) || (!bAscend && iGreate < 0
)) |
| 908 { | 894 { |
| 909 this->SetAt(nStartPos, Value2); | 895 this->SetAt(nStartPos, Value2); |
| 910 this->SetAt(nStopPos, Value1); | 896 this->SetAt(nStopPos, Value1); |
| 911 } | 897 } |
| 912 return; | 898 return; |
| 913 } | 899 } |
| 914 » » | 900 |
| 915 FX_UINT m = nStartPos + (nStopPos - nStartPos) / 2; | 901 FX_UINT m = nStartPos + (nStopPos - nStartPos) / 2; |
| 916 FX_UINT i = nStartPos; | 902 FX_UINT i = nStartPos; |
| 917 » » | 903 |
| 918 TYPE Value = this->GetAt(m); | 904 TYPE Value = this->GetAt(m); |
| 919 » » | 905 |
| 920 while (i < m) | 906 while (i < m) |
| 921 { | 907 { |
| 922 TYPE temp = this->GetAt(i); | 908 TYPE temp = this->GetAt(i); |
| 923 » » » | 909 |
| 924 int iGreate = (*pCompare)(temp, Value); | 910 int iGreate = (*pCompare)(temp, Value); |
| 925 if ((bAscend && iGreate > 0) || (!bAscend && iGreate < 0
)) | 911 if ((bAscend && iGreate > 0) || (!bAscend && iGreate < 0
)) |
| 926 { | 912 { |
| 927 this->InsertAt(m+1, temp); | 913 this->InsertAt(m+1, temp); |
| 928 this->RemoveAt(i); | 914 this->RemoveAt(i); |
| 929 m--; | 915 m--; |
| 930 } | 916 } |
| 931 else | 917 else |
| 932 { | 918 { |
| 933 i++; | 919 i++; |
| 934 } | 920 } |
| 935 } | 921 } |
| 936 » » | 922 |
| 937 FX_UINT j = nStopPos; | 923 FX_UINT j = nStopPos; |
| 938 » » | 924 |
| 939 while (j > m) | 925 while (j > m) |
| 940 { | 926 { |
| 941 TYPE temp = this->GetAt(j); | 927 TYPE temp = this->GetAt(j); |
| 942 » » » | 928 |
| 943 int iGreate = (*pCompare)(temp, Value); | 929 int iGreate = (*pCompare)(temp, Value); |
| 944 if ((bAscend && iGreate < 0) || (!bAscend && iGreate > 0
)) | 930 if ((bAscend && iGreate < 0) || (!bAscend && iGreate > 0
)) |
| 945 { | 931 { |
| 946 this->RemoveAt(j); | 932 this->RemoveAt(j); |
| 947 this->InsertAt(m, temp); | 933 this->InsertAt(m, temp); |
| 948 m++; | 934 m++; |
| 949 } | 935 } |
| 950 else | 936 else |
| 951 { | 937 { |
| 952 j--; | 938 j--; |
| 953 } | 939 } |
| 954 } | 940 } |
| 955 » » | 941 |
| 956 if (nStartPos < m) QuickSort(nStartPos, m, bAscend, pCompare); | 942 if (nStartPos < m) QuickSort(nStartPos, m, bAscend, pCompare); |
| 957 if (nStopPos > m) QuickSort(m, nStopPos, bAscend, pCompare); | 943 if (nStopPos > m) QuickSort(m, nStopPos, bAscend, pCompare); |
| 958 } | 944 } |
| 959 }; | 945 }; |
| 960 | 946 |
| 961 | 947 |
| 962 #endif //_FPDFSDK_MGR_H | 948 #endif //_FPDFSDK_MGR_H |
| 963 | |
| OLD | NEW |