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 #include "../../include/javascript/JavaScript.h" | 7 #include "../../include/javascript/JavaScript.h" |
8 #include "../../include/javascript/IJavaScript.h" | 8 #include "../../include/javascript/IJavaScript.h" |
9 #include "../../include/javascript/JS_Define.h" | 9 #include "../../include/javascript/JS_Define.h" |
10 #include "../../include/javascript/JS_Object.h" | 10 #include "../../include/javascript/JS_Object.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 m_DelayData.SetAt(i, NULL); | 183 m_DelayData.SetAt(i, NULL); |
184 | 184 |
185 } | 185 } |
186 } | 186 } |
187 | 187 |
188 m_DelayData.RemoveAll(); | 188 m_DelayData.RemoveAll(); |
189 m_DelayAnnotData.RemoveAll(); | 189 m_DelayAnnotData.RemoveAll(); |
190 } | 190 } |
191 | 191 |
192 //the total number of fileds in document. | 192 //the total number of fileds in document. |
193 FX_BOOL Document::numFields(OBJ_PROP_PARAMS) | 193 FX_BOOL Document::numFields(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString
& sError) |
194 { | 194 { |
195 if (!vp.IsGetting()) return FALSE; | 195 if (!vp.IsGetting()) return FALSE; |
196 | 196 |
197 ASSERT(m_pDocument != NULL); | 197 ASSERT(m_pDocument != NULL); |
198 | 198 |
199 CPDFSDK_InterForm *pInterForm = m_pDocument->GetInterForm(); | 199 CPDFSDK_InterForm *pInterForm = m_pDocument->GetInterForm(); |
200 ASSERT(pInterForm != NULL); | 200 ASSERT(pInterForm != NULL); |
201 | 201 |
202 CPDF_InterForm *pPDFForm = pInterForm->GetInterForm(); | 202 CPDF_InterForm *pPDFForm = pInterForm->GetInterForm(); |
203 ASSERT(pPDFForm != NULL); | 203 ASSERT(pPDFForm != NULL); |
204 | 204 |
205 vp << (int)pPDFForm->CountFields(); | 205 vp << (int)pPDFForm->CountFields(); |
206 | 206 |
207 return TRUE; | 207 return TRUE; |
208 } | 208 } |
209 | 209 |
210 FX_BOOL Document::dirty(OBJ_PROP_PARAMS) | 210 FX_BOOL Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sE
rror) |
211 { | 211 { |
212 ASSERT(m_pDocument != NULL); | 212 ASSERT(m_pDocument != NULL); |
213 | 213 |
214 if (vp.IsGetting()) | 214 if (vp.IsGetting()) |
215 { | 215 { |
216 if (m_pDocument->GetChangeMark()) | 216 if (m_pDocument->GetChangeMark()) |
217 vp << true; | 217 vp << true; |
218 else | 218 else |
219 vp << false; | 219 vp << false; |
220 } | 220 } |
221 else | 221 else |
222 { | 222 { |
223 bool bChanged = false; | 223 bool bChanged = false; |
224 | 224 |
225 vp >> bChanged; | 225 vp >> bChanged; |
226 | 226 |
227 if (bChanged) | 227 if (bChanged) |
228 m_pDocument->SetChangeMark(); | 228 m_pDocument->SetChangeMark(); |
229 else | 229 else |
230 m_pDocument->ClearChangeMark(); | 230 m_pDocument->ClearChangeMark(); |
231 } | 231 } |
232 | 232 |
233 return TRUE; | 233 return TRUE; |
234 } | 234 } |
235 | 235 |
236 FX_BOOL Document::ADBE(OBJ_PROP_PARAMS) | 236 FX_BOOL Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sEr
ror) |
237 { | 237 { |
238 ASSERT(m_pDocument != NULL); | 238 ASSERT(m_pDocument != NULL); |
239 | 239 |
240 if (vp.IsGetting()) | 240 if (vp.IsGetting()) |
241 { | 241 { |
242 vp.SetNull(); | 242 vp.SetNull(); |
243 } | 243 } |
244 else | 244 else |
245 { | 245 { |
246 } | 246 } |
247 | 247 |
248 return TRUE; | 248 return TRUE; |
249 } | 249 } |
250 | 250 |
251 FX_BOOL Document::pageNum(OBJ_PROP_PARAMS) | 251 FX_BOOL Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
252 { | 252 { |
253 ASSERT(m_pDocument != NULL); | 253 ASSERT(m_pDocument != NULL); |
254 | 254 |
255 if (vp.IsGetting()) | 255 if (vp.IsGetting()) |
256 { | 256 { |
257 if (CPDFSDK_PageView* pPageView = m_pDocument->GetCurrentView()) | 257 if (CPDFSDK_PageView* pPageView = m_pDocument->GetCurrentView()) |
258 { | 258 { |
259 vp << pPageView->GetPageIndex(); | 259 vp << pPageView->GetPageIndex(); |
260 } | 260 } |
261 } | 261 } |
(...skipping 24 matching lines...) Expand all Loading... |
286 | 286 |
287 return TRUE; | 287 return TRUE; |
288 } | 288 } |
289 | 289 |
290 FX_BOOL Document::ParserParams(JSObject* pObj,CJS_AnnotObj& annotobj) | 290 FX_BOOL Document::ParserParams(JSObject* pObj,CJS_AnnotObj& annotobj) |
291 { | 291 { |
292 // Not supported. | 292 // Not supported. |
293 return TRUE; | 293 return TRUE; |
294 } | 294 } |
295 | 295 |
296 FX_BOOL Document::addAnnot(OBJ_METHOD_PARAMS) | 296 FX_BOOL Document::addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
Value& vRet, JS_ErrorString& sError) |
297 { | 297 { |
298 // Not supported. | 298 // Not supported. |
299 return TRUE; | 299 return TRUE; |
300 } | 300 } |
301 | 301 |
302 FX_BOOL Document::addField(OBJ_METHOD_PARAMS) | 302 FX_BOOL Document::addField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
Value& vRet, JS_ErrorString& sError) |
303 { | 303 { |
304 // Not supported. | 304 // Not supported. |
305 return TRUE; | 305 return TRUE; |
306 } | 306 } |
307 | 307 |
308 FX_BOOL Document::exportAsText(OBJ_METHOD_PARAMS) | 308 FX_BOOL Document::exportAsText(IFXJS_Context* cc, const CJS_Parameters& params,
CJS_Value& vRet, JS_ErrorString& sError) |
309 { | 309 { |
310 // Unsafe, not supported. | 310 // Unsafe, not supported. |
311 return TRUE; | 311 return TRUE; |
312 } | 312 } |
313 | 313 |
314 FX_BOOL Document::exportAsFDF(OBJ_METHOD_PARAMS) | 314 FX_BOOL Document::exportAsFDF(IFXJS_Context* cc, const CJS_Parameters& params, C
JS_Value& vRet, JS_ErrorString& sError) |
315 { | 315 { |
316 // Unsafe, not supported. | 316 // Unsafe, not supported. |
317 return TRUE; | 317 return TRUE; |
318 } | 318 } |
319 | 319 |
320 FX_BOOL Document::exportAsXFDF(OBJ_METHOD_PARAMS) | 320 FX_BOOL Document::exportAsXFDF(IFXJS_Context* cc, const CJS_Parameters& params,
CJS_Value& vRet, JS_ErrorString& sError) |
321 { | 321 { |
322 // Unsafe, not supported. | 322 // Unsafe, not supported. |
323 return TRUE; | 323 return TRUE; |
324 } | 324 } |
325 | 325 |
326 //Maps a field object in PDF document to a JavaScript variable | 326 //Maps a field object in PDF document to a JavaScript variable |
327 //comment: | 327 //comment: |
328 //note: the paremter cName, this is clue how to treat if the cName is not a vali
able filed name in this document | 328 //note: the paremter cName, this is clue how to treat if the cName is not a vali
able filed name in this document |
329 | 329 |
330 FX_BOOL Document::getField(OBJ_METHOD_PARAMS) | 330 FX_BOOL Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
Value& vRet, JS_ErrorString& sError) |
331 { | 331 { |
332 v8::Isolate* isolate = GetIsolate(cc); | 332 v8::Isolate* isolate = GetIsolate(cc); |
333 ASSERT(m_pDocument != NULL); | 333 ASSERT(m_pDocument != NULL); |
334 | 334 |
335 if (params.size() < 1) return FALSE; | 335 if (params.size() < 1) return FALSE; |
336 | 336 |
337 CFX_WideString wideName = params[0].operator CFX_WideString(); | 337 CFX_WideString wideName = params[0].operator CFX_WideString(); |
338 | 338 |
339 CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); | 339 CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); |
340 ASSERT(pInterForm != NULL); | 340 ASSERT(pInterForm != NULL); |
(...skipping 20 matching lines...) Expand all Loading... |
361 Field * pField = (Field *)pJSField->GetEmbedObject(); | 361 Field * pField = (Field *)pJSField->GetEmbedObject(); |
362 ASSERT(pField != NULL); | 362 ASSERT(pField != NULL); |
363 | 363 |
364 pField->AttachField(this, wideName); | 364 pField->AttachField(this, wideName); |
365 vRet = pJSField; | 365 vRet = pJSField; |
366 | 366 |
367 return TRUE; | 367 return TRUE; |
368 } | 368 } |
369 | 369 |
370 //Gets the name of the nth field in the document | 370 //Gets the name of the nth field in the document |
371 FX_BOOL Document::getNthFieldName(OBJ_METHOD_PARAMS) | 371 FX_BOOL Document::getNthFieldName(IFXJS_Context* cc, const CJS_Parameters& param
s, CJS_Value& vRet, JS_ErrorString& sError) |
372 { | 372 { |
373 ASSERT(m_pDocument != NULL); | 373 ASSERT(m_pDocument != NULL); |
374 | 374 |
375 int nIndex = params.size() > 0 ? (int)params[0] : -1; | 375 int nIndex = params.size() > 0 ? (int)params[0] : -1; |
376 if (nIndex == -1) return FALSE; | 376 if (nIndex == -1) return FALSE; |
377 | 377 |
378 CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); | 378 CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); |
379 ASSERT(pInterForm != NULL); | 379 ASSERT(pInterForm != NULL); |
380 | 380 |
381 CPDF_InterForm* pPDFForm = pInterForm->GetInterForm(); | 381 CPDF_InterForm* pPDFForm = pInterForm->GetInterForm(); |
382 ASSERT(pPDFForm != NULL); | 382 ASSERT(pPDFForm != NULL); |
383 | 383 |
384 CPDF_FormField* pField = pPDFForm->GetField(nIndex); | 384 CPDF_FormField* pField = pPDFForm->GetField(nIndex); |
385 if (!pField) | 385 if (!pField) |
386 return FALSE; | 386 return FALSE; |
387 | 387 |
388 vRet = pField->GetFullName(); | 388 vRet = pField->GetFullName(); |
389 return TRUE; | 389 return TRUE; |
390 } | 390 } |
391 | 391 |
392 FX_BOOL Document::importAnFDF(OBJ_METHOD_PARAMS) | 392 FX_BOOL Document::importAnFDF(IFXJS_Context* cc, const CJS_Parameters& params, C
JS_Value& vRet, JS_ErrorString& sError) |
393 { | 393 { |
394 // Unsafe, not supported. | 394 // Unsafe, not supported. |
395 return TRUE; | 395 return TRUE; |
396 } | 396 } |
397 | 397 |
398 FX_BOOL Document::importAnXFDF(OBJ_METHOD_PARAMS) | 398 FX_BOOL Document::importAnXFDF(IFXJS_Context* cc, const CJS_Parameters& params,
CJS_Value& vRet, JS_ErrorString& sError) |
399 { | 399 { |
400 // Unsafe, not supported. | 400 // Unsafe, not supported. |
401 return TRUE; | 401 return TRUE; |
402 } | 402 } |
403 | 403 |
404 FX_BOOL Document::importTextData(OBJ_METHOD_PARAMS) | 404 FX_BOOL Document::importTextData(IFXJS_Context* cc, const CJS_Parameters& params
, CJS_Value& vRet, JS_ErrorString& sError) |
405 { | 405 { |
406 // Unsafe, not supported. | 406 // Unsafe, not supported. |
407 return TRUE; | 407 return TRUE; |
408 } | 408 } |
409 | 409 |
410 //exports the form data and mails the resulting fdf file as an attachment to all
recipients. | 410 //exports the form data and mails the resulting fdf file as an attachment to all
recipients. |
411 //comment: need reader supports | 411 //comment: need reader supports |
412 //note: | 412 //note: |
413 //int CPDFSDK_Document::mailForm(FX_BOOL bUI,String cto,string ccc,string cbcc,s
tring cSubject,string cms); | 413 //int CPDFSDK_Document::mailForm(FX_BOOL bUI,String cto,string ccc,string cbcc,s
tring cSubject,string cms); |
414 | 414 |
415 FX_BOOL Document::mailForm(OBJ_METHOD_PARAMS) | 415 FX_BOOL Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
Value& vRet, JS_ErrorString& sError) |
416 { | 416 { |
417 ASSERT(m_pDocument != NULL); | 417 ASSERT(m_pDocument != NULL); |
418 | 418 |
419 if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; | 419 if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; |
420 | 420 |
421 int iLength = params.size(); | 421 int iLength = params.size(); |
422 | 422 |
423 FX_BOOL bUI = iLength > 0 ? (FX_BOOL)params[0] : TRUE; | 423 FX_BOOL bUI = iLength > 0 ? (FX_BOOL)params[0] : TRUE; |
424 CFX_WideString cTo = iLength > 1 ? (FX_LPCWSTR)params[1].operator CFX_Wi
deString() : L""; | 424 CFX_WideString cTo = iLength > 1 ? (FX_LPCWSTR)params[1].operator CFX_Wi
deString() : L""; |
425 CFX_WideString cCc = iLength > 2 ? (FX_LPCWSTR)params[2].operator CFX_Wi
deString() : L""; | 425 CFX_WideString cCc = iLength > 2 ? (FX_LPCWSTR)params[2].operator CFX_Wi
deString() : L""; |
(...skipping 14 matching lines...) Expand all Loading... |
440 ASSERT(pEnv != NULL); | 440 ASSERT(pEnv != NULL); |
441 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 441 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
442 ASSERT(pRuntime != NULL); | 442 ASSERT(pRuntime != NULL); |
443 | 443 |
444 pRuntime->BeginBlock(); | 444 pRuntime->BeginBlock(); |
445 pEnv->JS_docmailForm(textBuf.GetBuffer(), textBuf.GetLength(), bUI, cTo.
c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), cMsg.c_str()); | 445 pEnv->JS_docmailForm(textBuf.GetBuffer(), textBuf.GetLength(), bUI, cTo.
c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), cMsg.c_str()); |
446 pRuntime->EndBlock(); | 446 pRuntime->EndBlock(); |
447 return TRUE; | 447 return TRUE; |
448 } | 448 } |
449 | 449 |
450 FX_BOOL Document::print(OBJ_METHOD_PARAMS) | 450 FX_BOOL Document::print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
ue& vRet, JS_ErrorString& sError) |
451 { | 451 { |
452 CJS_Context* pContext = (CJS_Context*)cc; | 452 CJS_Context* pContext = (CJS_Context*)cc; |
453 ASSERT(pContext != NULL); | 453 ASSERT(pContext != NULL); |
454 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 454 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
455 ASSERT(pRuntime != NULL); | 455 ASSERT(pRuntime != NULL); |
456 | 456 |
457 FX_BOOL bUI = TRUE; | 457 FX_BOOL bUI = TRUE; |
458 int nStart = 0; | 458 int nStart = 0; |
459 int nEnd = 0; | 459 int nEnd = 0; |
460 FX_BOOL bSilent = FALSE; | 460 FX_BOOL bSilent = FALSE; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 pEnv->JS_docprint(bUI, nStart, nEnd, bSilent, bShrinkToFit, bPri
ntAsImage, bReverse, bAnnotations); | 517 pEnv->JS_docprint(bUI, nStart, nEnd, bSilent, bShrinkToFit, bPri
ntAsImage, bReverse, bAnnotations); |
518 return TRUE; | 518 return TRUE; |
519 } | 519 } |
520 return FALSE; | 520 return FALSE; |
521 } | 521 } |
522 | 522 |
523 //removes the specified field from the document. | 523 //removes the specified field from the document. |
524 //comment: | 524 //comment: |
525 //note: if the filed name is not retional, adobe is dumb for it. | 525 //note: if the filed name is not retional, adobe is dumb for it. |
526 | 526 |
527 FX_BOOL Document::removeField(OBJ_METHOD_PARAMS) | 527 FX_BOOL Document::removeField(IFXJS_Context* cc, const CJS_Parameters& params, C
JS_Value& vRet, JS_ErrorString& sError) |
528 { | 528 { |
529 ASSERT(m_pDocument != NULL); | 529 ASSERT(m_pDocument != NULL); |
530 | 530 |
531 if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) || | 531 if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) || |
532 m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM))) return FALSE; | 532 m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM))) return FALSE; |
533 | 533 |
534 if (params.size() < 1) | 534 if (params.size() < 1) |
535 return TRUE; | 535 return TRUE; |
536 | 536 |
537 CFX_WideString sFieldName = params[0].operator CFX_WideString(); | 537 CFX_WideString sFieldName = params[0].operator CFX_WideString(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 m_pDocument->SetChangeMark(); | 571 m_pDocument->SetChangeMark(); |
572 } | 572 } |
573 | 573 |
574 return TRUE; | 574 return TRUE; |
575 } | 575 } |
576 | 576 |
577 //reset filed values within a document. | 577 //reset filed values within a document. |
578 //comment: | 578 //comment: |
579 //note: if the fields names r not rational, aodbe is dumb for it. | 579 //note: if the fields names r not rational, aodbe is dumb for it. |
580 | 580 |
581 FX_BOOL Document::resetForm(OBJ_METHOD_PARAMS) | 581 FX_BOOL Document::resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS
_Value& vRet, JS_ErrorString& sError) |
582 { | 582 { |
583 ASSERT(m_pDocument != NULL); | 583 ASSERT(m_pDocument != NULL); |
584 | 584 |
585 if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) || | 585 if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) || |
586 m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) || | 586 m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) || |
587 m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE; | 587 m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE; |
588 | 588 |
589 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInte
rForm(); | 589 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInte
rForm(); |
590 ASSERT(pInterForm != NULL); | 590 ASSERT(pInterForm != NULL); |
591 | 591 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 { | 632 { |
633 pPDFForm->ResetForm(TRUE); | 633 pPDFForm->ResetForm(TRUE); |
634 m_pDocument->SetChangeMark(); | 634 m_pDocument->SetChangeMark(); |
635 | 635 |
636 } | 636 } |
637 | 637 |
638 return TRUE; | 638 return TRUE; |
639 } | 639 } |
640 | 640 |
641 | 641 |
642 FX_BOOL Document::saveAs(OBJ_METHOD_PARAMS) | 642 FX_BOOL Document::saveAs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
lue& vRet, JS_ErrorString& sError) |
643 { | 643 { |
644 // Unsafe, not supported. | 644 // Unsafe, not supported. |
645 return TRUE; | 645 return TRUE; |
646 } | 646 } |
647 | 647 |
648 | 648 |
649 FX_BOOL Document::submitForm(OBJ_METHOD_PARAMS) | 649 FX_BOOL Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJ
S_Value& vRet, JS_ErrorString& sError) |
650 { | 650 { |
651 ASSERT(m_pDocument != NULL); | 651 ASSERT(m_pDocument != NULL); |
652 | 652 |
653 // if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; | 653 // if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; |
654 | 654 |
655 int nSize = params.size(); | 655 int nSize = params.size(); |
656 if (nSize < 1) return FALSE; | 656 if (nSize < 1) return FALSE; |
657 | 657 |
658 CFX_WideString strURL; | 658 CFX_WideString strURL; |
659 FX_BOOL bFDF = TRUE; | 659 FX_BOOL bFDF = TRUE; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 FX_BOOL Document::ExtractFileName(CPDFSDK_Document *pDoc,CFX_ByteString &strFile
Name) | 766 FX_BOOL Document::ExtractFileName(CPDFSDK_Document *pDoc,CFX_ByteString &strFile
Name) |
767 { | 767 { |
768 return FALSE; | 768 return FALSE; |
769 } | 769 } |
770 | 770 |
771 FX_BOOL Document::ExtractFolderName(CPDFSDK_Document *pDoc,CFX_ByteString &strFo
lderName) | 771 FX_BOOL Document::ExtractFolderName(CPDFSDK_Document *pDoc,CFX_ByteString &strFo
lderName) |
772 { | 772 { |
773 return FALSE; | 773 return FALSE; |
774 } | 774 } |
775 | 775 |
776 FX_BOOL Document::bookmarkRoot(OBJ_PROP_PARAMS) | 776 FX_BOOL Document::bookmarkRoot(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorStr
ing& sError) |
777 { | 777 { |
778 return TRUE; | 778 return TRUE; |
779 } | 779 } |
780 | 780 |
781 FX_BOOL Document::mailDoc(OBJ_METHOD_PARAMS) | 781 FX_BOOL Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
alue& vRet, JS_ErrorString& sError) |
782 { | 782 { |
783 ASSERT(m_pDocument != NULL); | 783 ASSERT(m_pDocument != NULL); |
784 | 784 |
785 FX_BOOL bUI = TRUE; | 785 FX_BOOL bUI = TRUE; |
786 CFX_WideString cTo = L""; | 786 CFX_WideString cTo = L""; |
787 CFX_WideString cCc = L""; | 787 CFX_WideString cCc = L""; |
788 CFX_WideString cBcc = L""; | 788 CFX_WideString cBcc = L""; |
789 CFX_WideString cSubject = L""; | 789 CFX_WideString cSubject = L""; |
790 CFX_WideString cMsg = L""; | 790 CFX_WideString cMsg = L""; |
791 | 791 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 ASSERT(pRuntime != NULL); | 829 ASSERT(pRuntime != NULL); |
830 | 830 |
831 pRuntime->BeginBlock(); | 831 pRuntime->BeginBlock(); |
832 CPDFDoc_Environment* pEnv = pRuntime->GetReaderApp(); | 832 CPDFDoc_Environment* pEnv = pRuntime->GetReaderApp(); |
833 pEnv->JS_docmailForm(NULL, 0, bUI, cTo.c_str(), cSubject.c_str(), cCc.c_
str(), cBcc.c_str(), cMsg.c_str()); | 833 pEnv->JS_docmailForm(NULL, 0, bUI, cTo.c_str(), cSubject.c_str(), cCc.c_
str(), cBcc.c_str(), cMsg.c_str()); |
834 pRuntime->EndBlock(); | 834 pRuntime->EndBlock(); |
835 | 835 |
836 return TRUE; | 836 return TRUE; |
837 } | 837 } |
838 | 838 |
839 FX_BOOL Document::author(OBJ_PROP_PARAMS) | 839 FX_BOOL Document::author(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& s
Error) |
840 { | 840 { |
841 ASSERT(m_pDocument != NULL); | 841 ASSERT(m_pDocument != NULL); |
842 | 842 |
843 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); | 843 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); |
844 if (!pDictionary)return FALSE; | 844 if (!pDictionary)return FALSE; |
845 | 845 |
846 if (vp.IsGetting()) | 846 if (vp.IsGetting()) |
847 { | 847 { |
848 vp << pDictionary->GetUnicodeText("Author"); | 848 vp << pDictionary->GetUnicodeText("Author"); |
849 return TRUE; | 849 return TRUE; |
850 } | 850 } |
851 else | 851 else |
852 { | 852 { |
853 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; | 853 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; |
854 | 854 |
855 CFX_WideString csAuthor; | 855 CFX_WideString csAuthor; |
856 vp >> csAuthor; | 856 vp >> csAuthor; |
857 pDictionary->SetAtString("Author", PDF_EncodeText(csAuthor)); | 857 pDictionary->SetAtString("Author", PDF_EncodeText(csAuthor)); |
858 m_pDocument->SetChangeMark(); | 858 m_pDocument->SetChangeMark(); |
859 return TRUE; | 859 return TRUE; |
860 } | 860 } |
861 } | 861 } |
862 | 862 |
863 FX_BOOL Document::info(OBJ_PROP_PARAMS) | 863 FX_BOOL Document::info(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sEr
ror) |
864 { | 864 { |
865 ASSERT(m_pDocument != NULL); | 865 ASSERT(m_pDocument != NULL); |
866 | 866 |
867 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); | 867 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); |
868 if (!pDictionary)return FALSE; | 868 if (!pDictionary)return FALSE; |
869 | 869 |
870 CFX_WideString cwAuthor = pDictionary->GetUnicodeText("A
uthor"); | 870 CFX_WideString cwAuthor = pDictionary->GetUnicodeText("A
uthor"); |
871 CFX_WideString cwTitle = pDictionary->GetUnicodeText("T
itle"); | 871 CFX_WideString cwTitle = pDictionary->GetUnicodeText("T
itle"); |
872 CFX_WideString cwSubject = pDictionary->GetUnicodeText("S
ubject"); | 872 CFX_WideString cwSubject = pDictionary->GetUnicodeText("S
ubject"); |
873 CFX_WideString cwKeywords = pDictionary->GetUnicodeText("K
eywords"); | 873 CFX_WideString cwKeywords = pDictionary->GetUnicodeText("K
eywords"); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 | 912 |
913 vp << pObj; | 913 vp << pObj; |
914 return TRUE; | 914 return TRUE; |
915 } | 915 } |
916 else | 916 else |
917 { | 917 { |
918 return TRUE; | 918 return TRUE; |
919 } | 919 } |
920 } | 920 } |
921 | 921 |
922 FX_BOOL Document::creationDate(OBJ_PROP_PARAMS) | 922 FX_BOOL Document::creationDate(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorStr
ing& sError) |
923 { | 923 { |
924 ASSERT(m_pDocument != NULL); | 924 ASSERT(m_pDocument != NULL); |
925 | 925 |
926 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); | 926 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); |
927 if (!pDictionary)return FALSE; | 927 if (!pDictionary)return FALSE; |
928 | 928 |
929 if (vp.IsGetting()) | 929 if (vp.IsGetting()) |
930 { | 930 { |
931 vp << pDictionary->GetUnicodeText("CreationDate"); | 931 vp << pDictionary->GetUnicodeText("CreationDate"); |
932 return TRUE; | 932 return TRUE; |
933 } | 933 } |
934 else | 934 else |
935 { | 935 { |
936 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; | 936 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; |
937 | 937 |
938 CFX_WideString csCreationDate; | 938 CFX_WideString csCreationDate; |
939 vp >> csCreationDate; | 939 vp >> csCreationDate; |
940 pDictionary->SetAtString("CreationDate", PDF_EncodeText(csCreati
onDate)); | 940 pDictionary->SetAtString("CreationDate", PDF_EncodeText(csCreati
onDate)); |
941 m_pDocument->SetChangeMark(); | 941 m_pDocument->SetChangeMark(); |
942 | 942 |
943 return TRUE; | 943 return TRUE; |
944 } | 944 } |
945 } | 945 } |
946 | 946 |
947 FX_BOOL Document::creator(OBJ_PROP_PARAMS) | 947 FX_BOOL Document::creator(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
948 { | 948 { |
949 ASSERT(m_pDocument != NULL); | 949 ASSERT(m_pDocument != NULL); |
950 | 950 |
951 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); | 951 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); |
952 if (!pDictionary)return FALSE; | 952 if (!pDictionary)return FALSE; |
953 | 953 |
954 if (vp.IsGetting()) | 954 if (vp.IsGetting()) |
955 { | 955 { |
956 vp << pDictionary->GetUnicodeText("Creator"); | 956 vp << pDictionary->GetUnicodeText("Creator"); |
957 return TRUE; | 957 return TRUE; |
958 } | 958 } |
959 else | 959 else |
960 { | 960 { |
961 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; | 961 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; |
962 | 962 |
963 CFX_WideString csCreator; | 963 CFX_WideString csCreator; |
964 vp >> csCreator; | 964 vp >> csCreator; |
965 pDictionary->SetAtString("Creator", PDF_EncodeText(csCreator)); | 965 pDictionary->SetAtString("Creator", PDF_EncodeText(csCreator)); |
966 m_pDocument->SetChangeMark(); | 966 m_pDocument->SetChangeMark(); |
967 return TRUE; | 967 return TRUE; |
968 } | 968 } |
969 } | 969 } |
970 | 970 |
971 FX_BOOL Document::delay(OBJ_PROP_PARAMS) | 971 FX_BOOL Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sE
rror) |
972 { | 972 { |
973 if (vp.IsGetting()) | 973 if (vp.IsGetting()) |
974 { | 974 { |
975 vp << m_bDelay; | 975 vp << m_bDelay; |
976 return TRUE; | 976 return TRUE; |
977 } | 977 } |
978 else | 978 else |
979 { | 979 { |
980 ASSERT(m_pDocument != NULL); | 980 ASSERT(m_pDocument != NULL); |
981 | 981 |
(...skipping 21 matching lines...) Expand all Loading... |
1003 delete m_DelayData.GetAt(i); | 1003 delete m_DelayData.GetAt(i); |
1004 } | 1004 } |
1005 } | 1005 } |
1006 m_DelayData.RemoveAll(); | 1006 m_DelayData.RemoveAll(); |
1007 } | 1007 } |
1008 | 1008 |
1009 return TRUE; | 1009 return TRUE; |
1010 } | 1010 } |
1011 } | 1011 } |
1012 | 1012 |
1013 FX_BOOL Document::keywords(OBJ_PROP_PARAMS) | 1013 FX_BOOL Document::keywords(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
1014 { | 1014 { |
1015 ASSERT(m_pDocument != NULL); | 1015 ASSERT(m_pDocument != NULL); |
1016 | 1016 |
1017 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); | 1017 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); |
1018 if (!pDictionary)return FALSE; | 1018 if (!pDictionary)return FALSE; |
1019 | 1019 |
1020 if (vp.IsGetting()) | 1020 if (vp.IsGetting()) |
1021 { | 1021 { |
1022 vp << pDictionary->GetUnicodeText("Keywords"); | 1022 vp << pDictionary->GetUnicodeText("Keywords"); |
1023 return TRUE; | 1023 return TRUE; |
1024 } | 1024 } |
1025 else | 1025 else |
1026 { | 1026 { |
1027 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; | 1027 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; |
1028 | 1028 |
1029 CFX_WideString csKeywords; | 1029 CFX_WideString csKeywords; |
1030 vp >> csKeywords; | 1030 vp >> csKeywords; |
1031 pDictionary->SetAtString("Keywords", PDF_EncodeText(csKeywords))
; | 1031 pDictionary->SetAtString("Keywords", PDF_EncodeText(csKeywords))
; |
1032 m_pDocument->SetChangeMark(); | 1032 m_pDocument->SetChangeMark(); |
1033 return TRUE; | 1033 return TRUE; |
1034 } | 1034 } |
1035 } | 1035 } |
1036 | 1036 |
1037 FX_BOOL Document::modDate(OBJ_PROP_PARAMS) | 1037 FX_BOOL Document::modDate(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
1038 { | 1038 { |
1039 ASSERT(m_pDocument != NULL); | 1039 ASSERT(m_pDocument != NULL); |
1040 | 1040 |
1041 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); | 1041 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); |
1042 if (!pDictionary)return FALSE; | 1042 if (!pDictionary)return FALSE; |
1043 | 1043 |
1044 if (vp.IsGetting()) | 1044 if (vp.IsGetting()) |
1045 { | 1045 { |
1046 vp << pDictionary->GetUnicodeText("ModDate"); | 1046 vp << pDictionary->GetUnicodeText("ModDate"); |
1047 return TRUE; | 1047 return TRUE; |
1048 } | 1048 } |
1049 else | 1049 else |
1050 { | 1050 { |
1051 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; | 1051 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; |
1052 | 1052 |
1053 CFX_WideString csmodDate; | 1053 CFX_WideString csmodDate; |
1054 vp >> csmodDate; | 1054 vp >> csmodDate; |
1055 pDictionary->SetAtString("ModDate", PDF_EncodeText(csmodDate)); | 1055 pDictionary->SetAtString("ModDate", PDF_EncodeText(csmodDate)); |
1056 m_pDocument->SetChangeMark(); | 1056 m_pDocument->SetChangeMark(); |
1057 return TRUE; | 1057 return TRUE; |
1058 } | 1058 } |
1059 } | 1059 } |
1060 | 1060 |
1061 FX_BOOL Document::producer(OBJ_PROP_PARAMS) | 1061 FX_BOOL Document::producer(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
1062 { | 1062 { |
1063 ASSERT(m_pDocument != NULL); | 1063 ASSERT(m_pDocument != NULL); |
1064 | 1064 |
1065 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); | 1065 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); |
1066 if (!pDictionary)return FALSE; | 1066 if (!pDictionary)return FALSE; |
1067 | 1067 |
1068 if (vp.IsGetting()) | 1068 if (vp.IsGetting()) |
1069 { | 1069 { |
1070 vp << pDictionary->GetUnicodeText("Producer"); | 1070 vp << pDictionary->GetUnicodeText("Producer"); |
1071 return TRUE; | 1071 return TRUE; |
1072 } | 1072 } |
1073 else | 1073 else |
1074 { | 1074 { |
1075 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; | 1075 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; |
1076 | 1076 |
1077 CFX_WideString csproducer; | 1077 CFX_WideString csproducer; |
1078 vp >> csproducer; | 1078 vp >> csproducer; |
1079 pDictionary->SetAtString("Producer", PDF_EncodeText(csproducer))
; | 1079 pDictionary->SetAtString("Producer", PDF_EncodeText(csproducer))
; |
1080 m_pDocument->SetChangeMark(); | 1080 m_pDocument->SetChangeMark(); |
1081 return TRUE; | 1081 return TRUE; |
1082 } | 1082 } |
1083 } | 1083 } |
1084 | 1084 |
1085 FX_BOOL Document::subject(OBJ_PROP_PARAMS) | 1085 FX_BOOL Document::subject(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
1086 { | 1086 { |
1087 ASSERT(m_pDocument != NULL); | 1087 ASSERT(m_pDocument != NULL); |
1088 | 1088 |
1089 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); | 1089 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); |
1090 if (!pDictionary)return FALSE; | 1090 if (!pDictionary)return FALSE; |
1091 | 1091 |
1092 if (vp.IsGetting()) | 1092 if (vp.IsGetting()) |
1093 { | 1093 { |
1094 vp << pDictionary->GetUnicodeText("Subject"); | 1094 vp << pDictionary->GetUnicodeText("Subject"); |
1095 return TRUE; | 1095 return TRUE; |
1096 } | 1096 } |
1097 else | 1097 else |
1098 { | 1098 { |
1099 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; | 1099 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; |
1100 | 1100 |
1101 CFX_WideString cssubject; | 1101 CFX_WideString cssubject; |
1102 vp >> cssubject; | 1102 vp >> cssubject; |
1103 pDictionary->SetAtString("Subject", PDF_EncodeText(cssubject)); | 1103 pDictionary->SetAtString("Subject", PDF_EncodeText(cssubject)); |
1104 m_pDocument->SetChangeMark(); | 1104 m_pDocument->SetChangeMark(); |
1105 return TRUE; | 1105 return TRUE; |
1106 } | 1106 } |
1107 } | 1107 } |
1108 | 1108 |
1109 FX_BOOL Document::title(OBJ_PROP_PARAMS) | 1109 FX_BOOL Document::title(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sE
rror) |
1110 { | 1110 { |
1111 ASSERT(m_pDocument != NULL); | 1111 ASSERT(m_pDocument != NULL); |
1112 | 1112 |
1113 if (m_pDocument == NULL || m_pDocument->GetDocument() == NULL) | 1113 if (m_pDocument == NULL || m_pDocument->GetDocument() == NULL) |
1114 return FALSE; | 1114 return FALSE; |
1115 | 1115 |
1116 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); | 1116 CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); |
1117 if (!pDictionary)return FALSE; | 1117 if (!pDictionary)return FALSE; |
1118 | 1118 |
1119 if (vp.IsGetting()) | 1119 if (vp.IsGetting()) |
1120 { | 1120 { |
1121 vp << pDictionary->GetUnicodeText("Title"); | 1121 vp << pDictionary->GetUnicodeText("Title"); |
1122 return TRUE; | 1122 return TRUE; |
1123 } | 1123 } |
1124 else | 1124 else |
1125 { | 1125 { |
1126 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; | 1126 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE; |
1127 | 1127 |
1128 CFX_WideString cstitle; | 1128 CFX_WideString cstitle; |
1129 vp >> cstitle; | 1129 vp >> cstitle; |
1130 pDictionary->SetAtString("Title", PDF_EncodeText(cstitle)); | 1130 pDictionary->SetAtString("Title", PDF_EncodeText(cstitle)); |
1131 m_pDocument->SetChangeMark(); | 1131 m_pDocument->SetChangeMark(); |
1132 return TRUE; | 1132 return TRUE; |
1133 } | 1133 } |
1134 } | 1134 } |
1135 | 1135 |
1136 FX_BOOL Document::numPages(OBJ_PROP_PARAMS) | 1136 FX_BOOL Document::numPages(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
1137 { | 1137 { |
1138 if (vp.IsGetting()) | 1138 if (vp.IsGetting()) |
1139 { | 1139 { |
1140 ASSERT(m_pDocument != NULL); | 1140 ASSERT(m_pDocument != NULL); |
1141 vp << m_pDocument->GetPageCount(); | 1141 vp << m_pDocument->GetPageCount(); |
1142 return TRUE; | 1142 return TRUE; |
1143 } | 1143 } |
1144 else | 1144 else |
1145 { | 1145 { |
1146 return FALSE; | 1146 return FALSE; |
1147 } | 1147 } |
1148 } | 1148 } |
1149 | 1149 |
1150 FX_BOOL Document::external(OBJ_PROP_PARAMS) | 1150 FX_BOOL Document::external(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
1151 { | 1151 { |
1152 //In Chrome case,should always return true. | 1152 //In Chrome case,should always return true. |
1153 vp << TRUE; | 1153 vp << TRUE; |
1154 return TRUE; | 1154 return TRUE; |
1155 } | 1155 } |
1156 | 1156 |
1157 FX_BOOL Document::filesize(OBJ_PROP_PARAMS) | 1157 FX_BOOL Document::filesize(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
1158 { | 1158 { |
1159 if (!vp.IsGetting())return FALSE; | 1159 if (!vp.IsGetting())return FALSE; |
1160 | 1160 |
1161 vp << 0; | 1161 vp << 0; |
1162 return TRUE; | 1162 return TRUE; |
1163 } | 1163 } |
1164 | 1164 |
1165 FX_BOOL Document::mouseX(OBJ_PROP_PARAMS) | 1165 FX_BOOL Document::mouseX(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& s
Error) |
1166 { | 1166 { |
1167 return TRUE; | 1167 return TRUE; |
1168 } | 1168 } |
1169 | 1169 |
1170 FX_BOOL Document::mouseY(OBJ_PROP_PARAMS) | 1170 FX_BOOL Document::mouseY(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& s
Error) |
1171 { | 1171 { |
1172 return TRUE; | 1172 return TRUE; |
1173 } | 1173 } |
1174 | 1174 |
1175 FX_BOOL Document::baseURL(OBJ_PROP_PARAMS) | 1175 FX_BOOL Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
1176 { | 1176 { |
1177 if (vp.IsGetting()) | 1177 if (vp.IsGetting()) |
1178 { | 1178 { |
1179 vp << m_cwBaseURL; | 1179 vp << m_cwBaseURL; |
1180 return TRUE; | 1180 return TRUE; |
1181 } | 1181 } |
1182 else | 1182 else |
1183 { | 1183 { |
1184 vp >> m_cwBaseURL; | 1184 vp >> m_cwBaseURL; |
1185 return TRUE; | 1185 return TRUE; |
1186 } | 1186 } |
1187 } | 1187 } |
1188 | 1188 |
1189 FX_BOOL Document::calculate(OBJ_PROP_PARAMS) | 1189 FX_BOOL Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString
& sError) |
1190 { | 1190 { |
1191 ASSERT(m_pDocument != NULL); | 1191 ASSERT(m_pDocument != NULL); |
1192 | 1192 |
1193 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInte
rForm(); | 1193 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInte
rForm(); |
1194 ASSERT(pInterForm != NULL); | 1194 ASSERT(pInterForm != NULL); |
1195 | 1195 |
1196 if (vp.IsGetting()) | 1196 if (vp.IsGetting()) |
1197 { | 1197 { |
1198 if (pInterForm->IsCalculateEnabled()) | 1198 if (pInterForm->IsCalculateEnabled()) |
1199 vp << true; | 1199 vp << true; |
1200 else | 1200 else |
1201 vp << false; | 1201 vp << false; |
1202 } | 1202 } |
1203 else | 1203 else |
1204 { | 1204 { |
1205 bool bCalculate; | 1205 bool bCalculate; |
1206 vp >> bCalculate; | 1206 vp >> bCalculate; |
1207 | 1207 |
1208 pInterForm->EnableCalculate(bCalculate); | 1208 pInterForm->EnableCalculate(bCalculate); |
1209 } | 1209 } |
1210 | 1210 |
1211 return TRUE; | 1211 return TRUE; |
1212 } | 1212 } |
1213 | 1213 |
1214 FX_BOOL Document::documentFileName(OBJ_PROP_PARAMS) | 1214 FX_BOOL Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, JS_Erro
rString& sError) |
1215 { | 1215 { |
1216 if (!vp.IsGetting()) | 1216 if (!vp.IsGetting()) |
1217 return FALSE; | 1217 return FALSE; |
1218 | 1218 |
1219 CFX_WideString wsFilePath = m_pDocument->GetPath(); | 1219 CFX_WideString wsFilePath = m_pDocument->GetPath(); |
1220 | 1220 |
1221 FX_INT32 i = wsFilePath.GetLength() - 1; | 1221 FX_INT32 i = wsFilePath.GetLength() - 1; |
1222 for ( ; i >= 0; i-- ) | 1222 for ( ; i >= 0; i-- ) |
1223 { | 1223 { |
1224 if ( wsFilePath.GetAt( i ) == L'\\' || wsFilePath.GetAt( i ) ==
L'/' ) | 1224 if ( wsFilePath.GetAt( i ) == L'\\' || wsFilePath.GetAt( i ) ==
L'/' ) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 } | 1273 } |
1274 pResult[iLength] = L'\0'; | 1274 pResult[iLength] = L'\0'; |
1275 | 1275 |
1276 cbFrom.ReleaseBuffer(); | 1276 cbFrom.ReleaseBuffer(); |
1277 CFX_WideString cbRet = CFX_WideString(pResult); | 1277 CFX_WideString cbRet = CFX_WideString(pResult); |
1278 free(pResult); | 1278 free(pResult); |
1279 pResult = NULL; | 1279 pResult = NULL; |
1280 return cbRet; | 1280 return cbRet; |
1281 } | 1281 } |
1282 | 1282 |
1283 FX_BOOL Document::path(OBJ_PROP_PARAMS) | 1283 FX_BOOL Document::path(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sEr
ror) |
1284 { | 1284 { |
1285 if (!vp.IsGetting()) return FALSE; | 1285 if (!vp.IsGetting()) return FALSE; |
1286 | 1286 |
1287 vp << app::SysPathToPDFPath(m_pDocument->GetPath()); | 1287 vp << app::SysPathToPDFPath(m_pDocument->GetPath()); |
1288 | 1288 |
1289 return TRUE; | 1289 return TRUE; |
1290 } | 1290 } |
1291 | 1291 |
1292 FX_BOOL Document::pageWindowRect(OBJ_PROP_PARAMS) | 1292 FX_BOOL Document::pageWindowRect(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorS
tring& sError) |
1293 { | 1293 { |
1294 return TRUE; | 1294 return TRUE; |
1295 } | 1295 } |
1296 | 1296 |
1297 FX_BOOL Document::layout(OBJ_PROP_PARAMS) | 1297 FX_BOOL Document::layout(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& s
Error) |
1298 { | 1298 { |
1299 return TRUE; | 1299 return TRUE; |
1300 } | 1300 } |
1301 | 1301 |
1302 FX_BOOL Document::addLink(OBJ_METHOD_PARAMS) | 1302 FX_BOOL Document::addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
alue& vRet, JS_ErrorString& sError) |
1303 { | 1303 { |
1304 return TRUE; | 1304 return TRUE; |
1305 } | 1305 } |
1306 | 1306 |
1307 FX_BOOL Document::closeDoc(OBJ_METHOD_PARAMS) | 1307 FX_BOOL Document::closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
Value& vRet, JS_ErrorString& sError) |
1308 { | 1308 { |
1309 ASSERT(m_pDocument != NULL); | 1309 ASSERT(m_pDocument != NULL); |
1310 | 1310 |
1311 | 1311 |
1312 | 1312 |
1313 | 1313 |
1314 | 1314 |
1315 return TRUE; | 1315 return TRUE; |
1316 } | 1316 } |
1317 | 1317 |
1318 FX_BOOL Document::getPageBox(OBJ_METHOD_PARAMS) | 1318 FX_BOOL Document::getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJ
S_Value& vRet, JS_ErrorString& sError) |
1319 { | 1319 { |
1320 return TRUE; | 1320 return TRUE; |
1321 } | 1321 } |
1322 | 1322 |
1323 | 1323 |
1324 FX_BOOL Document::getAnnot(OBJ_METHOD_PARAMS) | 1324 FX_BOOL Document::getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
Value& vRet, JS_ErrorString& sError) |
1325 { | 1325 { |
1326 return TRUE; | 1326 return TRUE; |
1327 } | 1327 } |
1328 | 1328 |
1329 FX_BOOL Document::getAnnots(OBJ_METHOD_PARAMS) | 1329 FX_BOOL Document::getAnnots(IFXJS_Context* cc, const CJS_Parameters& params, CJS
_Value& vRet, JS_ErrorString& sError) |
1330 { | 1330 { |
1331 vRet.SetNull(); | 1331 vRet.SetNull(); |
1332 return TRUE; | 1332 return TRUE; |
1333 } | 1333 } |
1334 | 1334 |
1335 FX_BOOL Document::getAnnot3D(OBJ_METHOD_PARAMS) | 1335 FX_BOOL Document::getAnnot3D(IFXJS_Context* cc, const CJS_Parameters& params, CJ
S_Value& vRet, JS_ErrorString& sError) |
1336 { | 1336 { |
1337 vRet.SetNull(); | 1337 vRet.SetNull(); |
1338 return TRUE; | 1338 return TRUE; |
1339 } | 1339 } |
1340 | 1340 |
1341 FX_BOOL Document::getAnnots3D(OBJ_METHOD_PARAMS) | 1341 FX_BOOL Document::getAnnots3D(IFXJS_Context* cc, const CJS_Parameters& params, C
JS_Value& vRet, JS_ErrorString& sError) |
1342 { | 1342 { |
1343 vRet = VT_undefined; | 1343 vRet = VT_undefined; |
1344 return TRUE; | 1344 return TRUE; |
1345 } | 1345 } |
1346 | 1346 |
1347 FX_BOOL Document::getOCGs(OBJ_METHOD_PARAMS) | 1347 FX_BOOL Document::getOCGs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
alue& vRet, JS_ErrorString& sError) |
1348 { | 1348 { |
1349 return TRUE; | 1349 return TRUE; |
1350 } | 1350 } |
1351 | 1351 |
1352 FX_BOOL Document::getLinks(OBJ_METHOD_PARAMS) | 1352 FX_BOOL Document::getLinks(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
Value& vRet, JS_ErrorString& sError) |
1353 { | 1353 { |
1354 return TRUE; | 1354 return TRUE; |
1355 } | 1355 } |
1356 | 1356 |
1357 bool Document::IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect) | 1357 bool Document::IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect) |
1358 { | 1358 { |
1359 if (rect.left <= LinkRect.left | 1359 if (rect.left <= LinkRect.left |
1360 && rect.top <= LinkRect.top | 1360 && rect.top <= LinkRect.top |
1361 && rect.right >= LinkRect.right | 1361 && rect.right >= LinkRect.right |
1362 && rect.bottom >= LinkRect.bottom) | 1362 && rect.bottom >= LinkRect.bottom) |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 pElement = NULL; | 1453 pElement = NULL; |
1454 } | 1454 } |
1455 | 1455 |
1456 continue; | 1456 continue; |
1457 } | 1457 } |
1458 | 1458 |
1459 pTemp = pTemp->NextIcon; | 1459 pTemp = pTemp->NextIcon; |
1460 } | 1460 } |
1461 } | 1461 } |
1462 | 1462 |
1463 FX_BOOL Document::addIcon(OBJ_METHOD_PARAMS) | 1463 FX_BOOL Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
alue& vRet, JS_ErrorString& sError) |
1464 { | 1464 { |
1465 if (params.size() != 2)return FALSE; | 1465 if (params.size() != 2)return FALSE; |
1466 | 1466 |
1467 CJS_Context* pContext = (CJS_Context*)cc; | 1467 CJS_Context* pContext = (CJS_Context*)cc; |
1468 ASSERT(pContext != NULL); | 1468 ASSERT(pContext != NULL); |
1469 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 1469 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
1470 ASSERT(pRuntime != NULL); | 1470 ASSERT(pRuntime != NULL); |
1471 | 1471 |
1472 CFX_WideString swIconName = params[0].operator CFX_WideString(); | 1472 CFX_WideString swIconName = params[0].operator CFX_WideString(); |
1473 | 1473 |
1474 JSFXObject pJSIcon = (JSFXObject)params[1]; | 1474 JSFXObject pJSIcon = (JSFXObject)params[1]; |
1475 if (JS_GetObjDefnID(pJSIcon) != JS_GetObjDefnID(*pRuntime, L"Icon")) ret
urn FALSE; | 1475 if (JS_GetObjDefnID(pJSIcon) != JS_GetObjDefnID(*pRuntime, L"Icon")) ret
urn FALSE; |
1476 | 1476 |
1477 CJS_EmbedObj* pEmbedObj = ((CJS_Object*)params[1])->GetEmbedObject(); | 1477 CJS_EmbedObj* pEmbedObj = ((CJS_Object*)params[1])->GetEmbedObject(); |
1478 if (!pEmbedObj)return FALSE; | 1478 if (!pEmbedObj)return FALSE; |
1479 Icon* pIcon = (Icon*)pEmbedObj; | 1479 Icon* pIcon = (Icon*)pEmbedObj; |
1480 | 1480 |
1481 if (!m_pIconTree) | 1481 if (!m_pIconTree) |
1482 m_pIconTree = new IconTree(); | 1482 m_pIconTree = new IconTree(); |
1483 | 1483 |
1484 IconElement* pNewIcon = new IconElement(); | 1484 IconElement* pNewIcon = new IconElement(); |
1485 pNewIcon->IconName = swIconName; | 1485 pNewIcon->IconName = swIconName; |
1486 pNewIcon->NextIcon = NULL; | 1486 pNewIcon->NextIcon = NULL; |
1487 pNewIcon->IconStream = pIcon; | 1487 pNewIcon->IconStream = pIcon; |
1488 m_pIconTree->InsertIconElement(pNewIcon); | 1488 m_pIconTree->InsertIconElement(pNewIcon); |
1489 return TRUE; | 1489 return TRUE; |
1490 } | 1490 } |
1491 | 1491 |
1492 FX_BOOL Document::icons(OBJ_PROP_PARAMS) | 1492 FX_BOOL Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sE
rror) |
1493 { | 1493 { |
1494 if (vp.IsSetting()) | 1494 if (vp.IsSetting()) |
1495 return FALSE; | 1495 return FALSE; |
1496 | 1496 |
1497 if (!m_pIconTree) | 1497 if (!m_pIconTree) |
1498 { | 1498 { |
1499 vp.SetNull(); | 1499 vp.SetNull(); |
1500 return TRUE; | 1500 return TRUE; |
1501 } | 1501 } |
1502 | 1502 |
(...skipping 19 matching lines...) Expand all Loading... |
1522 | 1522 |
1523 pIcon->SetStream(pIconElement->IconStream->GetStream()); | 1523 pIcon->SetStream(pIconElement->IconStream->GetStream()); |
1524 pIcon->SetIconName(pIconElement->IconName); | 1524 pIcon->SetIconName(pIconElement->IconName); |
1525 Icons.SetElement(i, CJS_Value(m_isolate,pJS_Icon)); | 1525 Icons.SetElement(i, CJS_Value(m_isolate,pJS_Icon)); |
1526 } | 1526 } |
1527 | 1527 |
1528 vp << Icons; | 1528 vp << Icons; |
1529 return TRUE; | 1529 return TRUE; |
1530 } | 1530 } |
1531 | 1531 |
1532 FX_BOOL Document::getIcon(OBJ_METHOD_PARAMS) | 1532 FX_BOOL Document::getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
alue& vRet, JS_ErrorString& sError) |
1533 { | 1533 { |
1534 if (params.size() != 1)return FALSE; | 1534 if (params.size() != 1)return FALSE; |
1535 if(!m_pIconTree) | 1535 if(!m_pIconTree) |
1536 return FALSE; | 1536 return FALSE; |
1537 CFX_WideString swIconName = params[0].operator CFX_WideString(); | 1537 CFX_WideString swIconName = params[0].operator CFX_WideString(); |
1538 int iIconCounts = m_pIconTree->GetLength(); | 1538 int iIconCounts = m_pIconTree->GetLength(); |
1539 | 1539 |
1540 CJS_Context* pContext = (CJS_Context *)cc; | 1540 CJS_Context* pContext = (CJS_Context *)cc; |
1541 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 1541 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
1542 | 1542 |
(...skipping 15 matching lines...) Expand all Loading... |
1558 pIcon->SetIconName(swIconName); | 1558 pIcon->SetIconName(swIconName); |
1559 pIcon->SetStream(pRetIcon->GetStream()); | 1559 pIcon->SetStream(pRetIcon->GetStream()); |
1560 vRet = pJS_Icon; | 1560 vRet = pJS_Icon; |
1561 return TRUE; | 1561 return TRUE; |
1562 } | 1562 } |
1563 } | 1563 } |
1564 | 1564 |
1565 return FALSE; | 1565 return FALSE; |
1566 } | 1566 } |
1567 | 1567 |
1568 FX_BOOL Document::removeIcon(OBJ_METHOD_PARAMS) | 1568 FX_BOOL Document::removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ
S_Value& vRet, JS_ErrorString& sError) |
1569 { | 1569 { |
1570 if (params.size() != 1)return FALSE; | 1570 if (params.size() != 1)return FALSE; |
1571 if(!m_pIconTree) | 1571 if(!m_pIconTree) |
1572 return FALSE; | 1572 return FALSE; |
1573 CFX_WideString swIconName = params[0].operator CFX_WideString(); | 1573 CFX_WideString swIconName = params[0].operator CFX_WideString(); |
1574 return TRUE; | 1574 return TRUE; |
1575 } | 1575 } |
1576 | 1576 |
1577 FX_BOOL Document::createDataObject(OBJ_METHOD_PARAMS) | 1577 FX_BOOL Document::createDataObject(IFXJS_Context* cc, const CJS_Parameters& para
ms, CJS_Value& vRet, JS_ErrorString& sError) |
1578 { | 1578 { |
1579 // Unsafe, not implemented. | 1579 // Unsafe, not implemented. |
1580 return TRUE; | 1580 return TRUE; |
1581 } | 1581 } |
1582 | 1582 |
1583 FX_BOOL Document::media(OBJ_PROP_PARAMS) | 1583 FX_BOOL Document::media(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sE
rror) |
1584 { | 1584 { |
1585 return TRUE; | 1585 return TRUE; |
1586 } | 1586 } |
1587 | 1587 |
1588 FX_BOOL Document::calculateNow(OBJ_METHOD_PARAMS) | 1588 FX_BOOL Document::calculateNow(IFXJS_Context* cc, const CJS_Parameters& params,
CJS_Value& vRet, JS_ErrorString& sError) |
1589 { | 1589 { |
1590 ASSERT(m_pDocument != NULL); | 1590 ASSERT(m_pDocument != NULL); |
1591 | 1591 |
1592 if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) || | 1592 if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) || |
1593 m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) || | 1593 m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) || |
1594 m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE; | 1594 m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE; |
1595 | 1595 |
1596 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInte
rForm(); | 1596 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInte
rForm(); |
1597 ASSERT(pInterForm != NULL); | 1597 ASSERT(pInterForm != NULL); |
1598 pInterForm->OnCalculate(); | 1598 pInterForm->OnCalculate(); |
1599 return TRUE; | 1599 return TRUE; |
1600 } | 1600 } |
1601 | 1601 |
1602 FX_BOOL Document::Collab(OBJ_PROP_PARAMS) | 1602 FX_BOOL Document::Collab(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& s
Error) |
1603 { | 1603 { |
1604 return TRUE; | 1604 return TRUE; |
1605 } | 1605 } |
1606 | 1606 |
1607 FX_BOOL Document::getPageNthWord(OBJ_METHOD_PARAMS) | 1607 FX_BOOL Document::getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params
, CJS_Value& vRet, JS_ErrorString& sError) |
1608 { | 1608 { |
1609 ASSERT(m_pDocument != NULL); | 1609 ASSERT(m_pDocument != NULL); |
1610 | 1610 |
1611 if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; | 1611 if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; |
1612 | 1612 |
1613 int nPageNo = params.GetSize() > 0 ? (int)params[0] : 0; | 1613 int nPageNo = params.GetSize() > 0 ? (int)params[0] : 0; |
1614 int nWordNo = params.GetSize() > 1 ? (int)params[1] : 0; | 1614 int nWordNo = params.GetSize() > 1 ? (int)params[1] : 0; |
1615 bool bStrip = params.GetSize() > 2 ? (bool)params[2] : true; | 1615 bool bStrip = params.GetSize() > 2 ? (bool)params[2] : true; |
1616 | 1616 |
1617 CPDF_Document* pDocument = m_pDocument->GetDocument(); | 1617 CPDF_Document* pDocument = m_pDocument->GetDocument(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 if (bStrip) | 1659 if (bStrip) |
1660 { | 1660 { |
1661 swRet.TrimLeft(); | 1661 swRet.TrimLeft(); |
1662 swRet.TrimRight(); | 1662 swRet.TrimRight(); |
1663 } | 1663 } |
1664 | 1664 |
1665 vRet = swRet; | 1665 vRet = swRet; |
1666 return TRUE; | 1666 return TRUE; |
1667 } | 1667 } |
1668 | 1668 |
1669 FX_BOOL Document::getPageNthWordQuads(OBJ_METHOD_PARAMS) | 1669 FX_BOOL Document::getPageNthWordQuads(IFXJS_Context* cc, const CJS_Parameters& p
arams, CJS_Value& vRet, JS_ErrorString& sError) |
1670 { | 1670 { |
1671 ASSERT(m_pDocument != NULL); | 1671 ASSERT(m_pDocument != NULL); |
1672 | 1672 |
1673 if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; | 1673 if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; |
1674 | 1674 |
1675 return FALSE; | 1675 return FALSE; |
1676 } | 1676 } |
1677 | 1677 |
1678 FX_BOOL Document::getPageNumWords(OBJ_METHOD_PARAMS) | 1678 FX_BOOL Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& param
s, CJS_Value& vRet, JS_ErrorString& sError) |
1679 { | 1679 { |
1680 ASSERT(m_pDocument != NULL); | 1680 ASSERT(m_pDocument != NULL); |
1681 | 1681 |
1682 if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; | 1682 if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; |
1683 | 1683 |
1684 int nPageNo = params.GetSize() > 0 ? (int)params[0] : 0; | 1684 int nPageNo = params.GetSize() > 0 ? (int)params[0] : 0; |
1685 | 1685 |
1686 CPDF_Document* pDocument = m_pDocument->GetDocument(); | 1686 CPDF_Document* pDocument = m_pDocument->GetDocument(); |
1687 ASSERT(pDocument != NULL); | 1687 ASSERT(pDocument != NULL); |
1688 | 1688 |
(...skipping 25 matching lines...) Expand all Loading... |
1714 nWords += CountWords(pTextObj); | 1714 nWords += CountWords(pTextObj); |
1715 } | 1715 } |
1716 } | 1716 } |
1717 } | 1717 } |
1718 | 1718 |
1719 vRet = nWords; | 1719 vRet = nWords; |
1720 | 1720 |
1721 return TRUE; | 1721 return TRUE; |
1722 } | 1722 } |
1723 | 1723 |
1724 FX_BOOL Document::getPrintParams(OBJ_METHOD_PARAMS) | 1724 FX_BOOL Document::getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params
, CJS_Value& vRet, JS_ErrorString& sError) |
1725 { | 1725 { |
1726 CJS_Context* pContext = (CJS_Context*)cc; | 1726 CJS_Context* pContext = (CJS_Context*)cc; |
1727 ASSERT(pContext != NULL); | 1727 ASSERT(pContext != NULL); |
1728 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 1728 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
1729 ASSERT(pRuntime != NULL); | 1729 ASSERT(pRuntime != NULL); |
1730 JSFXObject pRetObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDe
fnID(*pRuntime, L"PrintParamsObj")); | 1730 JSFXObject pRetObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDe
fnID(*pRuntime, L"PrintParamsObj")); |
1731 //not implemented yet. | 1731 //not implemented yet. |
1732 vRet = pRetObj; | 1732 vRet = pRetObj; |
1733 | 1733 |
1734 return TRUE; | 1734 return TRUE; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1804 nWords++; | 1804 nWords++; |
1805 } | 1805 } |
1806 | 1806 |
1807 if (nWords-1 == nWordIndex) | 1807 if (nWords-1 == nWordIndex) |
1808 swRet += unicode; | 1808 swRet += unicode; |
1809 } | 1809 } |
1810 | 1810 |
1811 return swRet; | 1811 return swRet; |
1812 } | 1812 } |
1813 | 1813 |
1814 FX_BOOL Document::zoom(OBJ_PROP_PARAMS) | 1814 FX_BOOL Document::zoom(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sEr
ror) |
1815 { | 1815 { |
1816 | 1816 |
1817 return TRUE; | 1817 return TRUE; |
1818 } | 1818 } |
1819 | 1819 |
1820 /** | 1820 /** |
1821 (none, NoVary) | 1821 (none, NoVary) |
1822 (fitP, FitPage) | 1822 (fitP, FitPage) |
1823 (fitW, FitWidth) | 1823 (fitW, FitWidth) |
1824 (fitH, FitHeight) | 1824 (fitH, FitHeight) |
1825 (fitV, FitVisibleWidth) | 1825 (fitV, FitVisibleWidth) |
1826 (pref, Preferred) | 1826 (pref, Preferred) |
1827 (refW, ReflowWidth) | 1827 (refW, ReflowWidth) |
1828 */ | 1828 */ |
1829 | 1829 |
1830 FX_BOOL Document::zoomType(OBJ_PROP_PARAMS) | 1830 FX_BOOL Document::zoomType(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
1831 { | 1831 { |
1832 return TRUE; | 1832 return TRUE; |
1833 } | 1833 } |
1834 | 1834 |
1835 FX_BOOL Document::deletePages(OBJ_METHOD_PARAMS) | 1835 FX_BOOL Document::deletePages(IFXJS_Context* cc, const CJS_Parameters& params, C
JS_Value& vRet, JS_ErrorString& sError) |
1836 { | 1836 { |
1837 v8::Isolate* isolate = GetIsolate(cc); | 1837 v8::Isolate* isolate = GetIsolate(cc); |
1838 ASSERT(m_pDocument != NULL); | 1838 ASSERT(m_pDocument != NULL); |
1839 | 1839 |
1840 if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) || | 1840 if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) || |
1841 m_pDocument->GetPermissions(FPDFPERM_ASSEMBLE))) return FALSE; | 1841 m_pDocument->GetPermissions(FPDFPERM_ASSEMBLE))) return FALSE; |
1842 | 1842 |
1843 int iSize = params.size(); | 1843 int iSize = params.size(); |
1844 | 1844 |
1845 int nStart = 0; | 1845 int nStart = 0; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1878 if (nEnd < 0) nEnd = 0; | 1878 if (nEnd < 0) nEnd = 0; |
1879 if (nEnd >= nTotal) nEnd = nTotal - 1; | 1879 if (nEnd >= nTotal) nEnd = nTotal - 1; |
1880 | 1880 |
1881 if (nEnd < nStart) nEnd = nStart; | 1881 if (nEnd < nStart) nEnd = nStart; |
1882 | 1882 |
1883 | 1883 |
1884 | 1884 |
1885 return TRUE; | 1885 return TRUE; |
1886 } | 1886 } |
1887 | 1887 |
1888 FX_BOOL Document::extractPages(OBJ_METHOD_PARAMS) | 1888 FX_BOOL Document::extractPages(IFXJS_Context* cc, const CJS_Parameters& params,
CJS_Value& vRet, JS_ErrorString& sError) |
1889 { | 1889 { |
1890 // Unsafe, not supported. | 1890 // Unsafe, not supported. |
1891 return TRUE; | 1891 return TRUE; |
1892 } | 1892 } |
1893 | 1893 |
1894 FX_BOOL Document::insertPages(OBJ_METHOD_PARAMS) | 1894 FX_BOOL Document::insertPages(IFXJS_Context* cc, const CJS_Parameters& params, C
JS_Value& vRet, JS_ErrorString& sError) |
1895 { | 1895 { |
1896 // Unsafe, not supported. | 1896 // Unsafe, not supported. |
1897 return TRUE; | 1897 return TRUE; |
1898 } | 1898 } |
1899 | 1899 |
1900 FX_BOOL Document::replacePages(OBJ_METHOD_PARAMS) | 1900 FX_BOOL Document::replacePages(IFXJS_Context* cc, const CJS_Parameters& params,
CJS_Value& vRet, JS_ErrorString& sError) |
1901 { | 1901 { |
1902 // Unsafe, not supported. | 1902 // Unsafe, not supported. |
1903 return TRUE; | 1903 return TRUE; |
1904 } | 1904 } |
1905 | 1905 |
1906 FX_BOOL Document::getURL(OBJ_METHOD_PARAMS) | 1906 FX_BOOL Document::getURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
lue& vRet, JS_ErrorString& sError) |
1907 { | 1907 { |
1908 // Unsafe, not supported. | 1908 // Unsafe, not supported. |
1909 return TRUE; | 1909 return TRUE; |
1910 } | 1910 } |
1911 | 1911 |
1912 void Document::AddDelayData(CJS_DelayData* pData) | 1912 void Document::AddDelayData(CJS_DelayData* pData) |
1913 { | 1913 { |
1914 m_DelayData.Add(pData); | 1914 m_DelayData.Add(pData); |
1915 } | 1915 } |
1916 | 1916 |
(...skipping 28 matching lines...) Expand all Loading... |
1945 | 1945 |
1946 void Document::DoAnnotDelay() | 1946 void Document::DoAnnotDelay() |
1947 { | 1947 { |
1948 CFX_DWordArray DelArray; | 1948 CFX_DWordArray DelArray; |
1949 | 1949 |
1950 for (int j=DelArray.GetSize()-1; j>=0; j--) | 1950 for (int j=DelArray.GetSize()-1; j>=0; j--) |
1951 { | 1951 { |
1952 m_DelayData.RemoveAt(DelArray[j]); | 1952 m_DelayData.RemoveAt(DelArray[j]); |
1953 } | 1953 } |
1954 } | 1954 } |
OLD | NEW |