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" |
(...skipping 19 matching lines...) Expand all Loading... |
30 class CJS_RuntimeFactory; | 30 class CJS_RuntimeFactory; |
31 | 31 |
32 #include "javascript/IJavaScript.h" | 32 #include "javascript/IJavaScript.h" |
33 | 33 |
34 class CPDFDoc_Environment FX_FINAL | 34 class CPDFDoc_Environment FX_FINAL |
35 { | 35 { |
36 public: | 36 public: |
37 CPDFDoc_Environment(CPDF_Document * pDoc); | 37 CPDFDoc_Environment(CPDF_Document * pDoc); |
38 ~CPDFDoc_Environment(); | 38 ~CPDFDoc_Environment(); |
39 | 39 |
40 » int RegAppHandle(FPDF_FORMFILLINFO* pFFinfo);//{ m_pInfo = pFFinfo; ret
urn TRUE;} | 40 » int RegAppHandle(FPDF_FORMFILLINFO* pFFinfo); |
41 | 41 |
42 void FFI_Invalidate(FPDF_PAGE page, double left, double top, double righ
t, double bottom) | 42 void FFI_Invalidate(FPDF_PAGE page, double left, double top, double righ
t, double bottom) |
43 { | 43 { |
44 if (m_pInfo && m_pInfo->FFI_Invalidate) | 44 if (m_pInfo && m_pInfo->FFI_Invalidate) |
45 { | 45 { |
46 m_pInfo->FFI_Invalidate(m_pInfo, page, left, top, right,
bottom); | 46 m_pInfo->FFI_Invalidate(m_pInfo, page, left, top, right,
bottom); |
47 } | 47 } |
48 } | 48 } |
49 void FFI_OutputSelectedRect(FPDF_PAGE page, double left, double top, dou
ble right, double bottom) | 49 void FFI_OutputSelectedRect(FPDF_PAGE page, double left, double top, dou
ble right, double bottom) |
50 { | 50 { |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 } | 325 } |
326 | 326 |
327 void FFI_DoGoToAction(int nPageIndex, int zoomMode, float* fPosArray,
int sizeOfArray) | 327 void FFI_DoGoToAction(int nPageIndex, int zoomMode, float* fPosArray,
int sizeOfArray) |
328 { | 328 { |
329 if(m_pInfo && m_pInfo->FFI_DoGoToAction) | 329 if(m_pInfo && m_pInfo->FFI_DoGoToAction) |
330 { | 330 { |
331 m_pInfo->FFI_DoGoToAction(m_pInfo, nPageIndex, zoomMode,
fPosArray, sizeOfArray); | 331 m_pInfo->FFI_DoGoToAction(m_pInfo, nPageIndex, zoomMode,
fPosArray, sizeOfArray); |
332 } | 332 } |
333 } | 333 } |
334 | 334 |
335 public: | |
336 FX_BOOL IsJSInitiated(); | 335 FX_BOOL IsJSInitiated(); |
337 | 336 |
338 public: | |
339 void SetCurrentDoc(CPDFSDK_Document* pFXDoc)
{m_pSDKDoc = pFXDoc;} | 337 void SetCurrentDoc(CPDFSDK_Document* pFXDoc)
{m_pSDKDoc = pFXDoc;} |
340 CPDFSDK_Document* GetCurrentDoc(); | 338 CPDFSDK_Document* GetCurrentDoc(); |
341 CPDF_Document* GetPDFDocument() {return m_pPDFDoc;} | 339 CPDF_Document* GetPDFDocument() {return m_pPDFDoc;} |
342 // CPDFSDK_Document* GetDocument(int nIndex); | |
343 // int CountDocuments() {return m_docMa
p.GetCount();} | |
344 | |
345 CPDFSDK_Document* OpenDocument(CFX_WideString &fileName){r
eturn NULL;} | |
346 CPDFSDK_Document* OpenMemPDFDoc(CPDF_Document* pNewDoc, CF
X_WideString &fileName){return NULL;} | |
347 | |
348 | 340 |
349 CFX_ByteString GetAppName() {return "";} | 341 CFX_ByteString GetAppName() {return "";} |
350 | 342 |
351 CFFL_IFormFiller* GetIFormFiller(); | 343 CFFL_IFormFiller* GetIFormFiller(); |
352 IFX_SystemHandler* GetSysHandler() {return m_pSysHandler;} | 344 IFX_SystemHandler* GetSysHandler() {return m_pSysHandler;} |
353 | 345 |
354 public: | |
355 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); | 346 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); |
356 IFXJS_Runtime* GetJSRuntime(); | 347 IFXJS_Runtime* GetJSRuntime(); |
357 CPDFSDK_ActionHandler* GetActionHander(); | 348 CPDFSDK_ActionHandler* GetActionHander(); |
| 349 FPDF_FORMFILLINFO* GetFormFillInfo() {return m_pInfo;} |
| 350 |
358 private: | 351 private: |
359 CPDFSDK_AnnotHandlerMgr* m_pAnnotHandlerMgr; | 352 CPDFSDK_AnnotHandlerMgr* m_pAnnotHandlerMgr; |
360 CPDFSDK_ActionHandler* m_pActionHandler; | 353 CPDFSDK_ActionHandler* m_pActionHandler; |
361 IFXJS_Runtime* m_pJSRuntime; | 354 IFXJS_Runtime* m_pJSRuntime; |
362 public: | |
363 FPDF_FORMFILLINFO* GetFormFillInfo() {return m_pInfo;} | |
364 private: | |
365 FPDF_FORMFILLINFO* m_pInfo; | 355 FPDF_FORMFILLINFO* m_pInfo; |
366 // CFX_MapPtrTemplate<CPDF_Document*, CPDFSDK_Document*> m_docMap; | |
367 CPDFSDK_Document* m_pSDKDoc; | 356 CPDFSDK_Document* m_pSDKDoc; |
368 CPDF_Document* m_pPDFDoc; | 357 CPDF_Document* m_pPDFDoc; |
369 | 358 |
370 CFFL_IFormFiller* m_pIFormFiller; | 359 CFFL_IFormFiller* m_pIFormFiller; |
371 IFX_SystemHandler* m_pSysHandler; | 360 IFX_SystemHandler* m_pSysHandler; |
372 | 361 |
373 public: | 362 public: |
374 CJS_RuntimeFactory* m_pJSRuntimeFactory; | 363 CJS_RuntimeFactory* m_pJSRuntimeFactory; |
375 }; | 364 }; |
376 | 365 |
377 | 366 |
378 | 367 |
379 // class CFX_App | |
380 // { | |
381 // public: | |
382 // CFX_App():m_pCurDoc(NULL) {} | |
383 // void SetAt(CPDF_Document* pPDFDoc, CPDFSDK_Document* pFXDoc); | |
384 // CPDFSDK_Document* GetAt(CPDF_Document* pPDFDoc); | |
385 // public: | |
386 // void SetCurrentDocument(CPDFSDK_Document* pFXDoc) {m_pCurDoc = pFXDoc;} | |
387 // CPDFSDK_Document* GetCurrentDocument() {return m_pCurDoc;} | |
388 // private: | |
389 // CFX_MapPtrTemplate<CPDF_Document*, CPDFSDK_Document*> m_docArray; | |
390 // CPDFSDK_Document* m_pCurDoc; | |
391 // }; | |
392 class CPDFSDK_InterForm; | 368 class CPDFSDK_InterForm; |
393 class CPDFSDK_Document | 369 class CPDFSDK_Document |
394 { | 370 { |
395 public: | 371 public: |
396 CPDFSDK_Document(CPDF_Document* pDoc, CPDFDoc_Environment* pEnv); | 372 CPDFSDK_Document(CPDF_Document* pDoc, CPDFDoc_Environment* pEnv); |
397 ~CPDFSDK_Document(); | 373 ~CPDFSDK_Document(); |
398 public: | 374 |
399 CPDFSDK_InterForm* GetInterForm() ; | 375 CPDFSDK_InterForm* GetInterForm() ; |
400 CPDF_Document* GetDocument() {return m_pDoc;} | 376 CPDF_Document* GetDocument() {return m_pDoc;} |
401 | 377 |
402 public: | |
403 void InitPageView(); | 378 void InitPageView(); |
404 void AddPageView(CPDF_Page* pPDFPage,
CPDFSDK_PageView* pPageView); | 379 void AddPageView(CPDF_Page* pPDFPage,
CPDFSDK_PageView* pPageView); |
405 CPDFSDK_PageView* GetPageView(CPDF_Page* pPDFPage, FX_BOOL
ReNew = TRUE); | 380 CPDFSDK_PageView* GetPageView(CPDF_Page* pPDFPage, FX_BOOL
ReNew = TRUE); |
406 CPDFSDK_PageView* GetPageView(int nIndex); | 381 CPDFSDK_PageView* GetPageView(int nIndex); |
407 CPDFSDK_PageView* GetCurrentView(); | 382 CPDFSDK_PageView* GetCurrentView(); |
408 void ReMovePageView(CPDF_Page* pPDFPa
ge); | 383 void ReMovePageView(CPDF_Page* pPDFPa
ge); |
409 void UpdateAllViews(CPDFSDK_PageView*
pSender, CPDFSDK_Annot* pAnnot); | 384 void UpdateAllViews(CPDFSDK_PageView*
pSender, CPDFSDK_Annot* pAnnot); |
410 | 385 |
411 » CPDFSDK_Annot*» » » GetFocusAnnot();//{return NULL;} | 386 » CPDFSDK_Annot*» » » GetFocusAnnot(); |
412 | 387 |
413 IFXJS_Runtime * GetJsRuntime(); | 388 IFXJS_Runtime * GetJsRuntime(); |
414 | 389 |
415 » FX_BOOL»» » » » SetFocusAnnot(CPDFSDK_Annot* pAn
not, FX_UINT nFlag = 0);//{return FALSE;} | 390 » FX_BOOL»» » » » SetFocusAnnot(CPDFSDK_Annot* pAn
not, FX_UINT nFlag = 0); |
416 FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0
); | 391 FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0
); |
417 | 392 |
418 FX_BOOL ExtractPages(const CFX_WordArray
&arrExtraPages, CPDF_Document* pDstDoc); | 393 FX_BOOL ExtractPages(const CFX_WordArray
&arrExtraPages, CPDF_Document* pDstDoc); |
419 FX_BOOL InsertPages(int nInsertAt, const
CPDF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages); | 394 FX_BOOL InsertPages(int nInsertAt, const
CPDF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages); |
420 FX_BOOL DeletePages(int nStart, int nCou
nt); | 395 FX_BOOL DeletePages(int nStart, int nCou
nt); |
421 FX_BOOL ReplacePages(int nPage, const CP
DF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages); | 396 FX_BOOL ReplacePages(int nPage, const CP
DF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages); |
422 | 397 |
423 void OnCloseDocument(); | 398 void OnCloseDocument(); |
424 | 399 |
425 int GetPageCount() {return m
_pDoc->GetPageCount();} | 400 int GetPageCount() {return m
_pDoc->GetPageCount();} |
426 FX_BOOL GetPermissions(int nFlag); | 401 FX_BOOL GetPermissions(int nFlag); |
427 FX_BOOL GetChangeMark() {return m_bChang
eMask;} | 402 FX_BOOL GetChangeMark() {return m_bChang
eMask;} |
428 void SetChangeMark() {m_bChangeMask =
TRUE;} | 403 void SetChangeMark() {m_bChangeMask =
TRUE;} |
429 void ClearChangeMark() {m_bChangeMask
= FALSE;} | 404 void ClearChangeMark() {m_bChangeMask
= FALSE;} |
430 // FX_BOOL GetChangeMark(){return FALSE;}//
IsAnnotModified()||IsFormModified() || IsWidgetModified()|| m_nChangeMark>0 ;} | |
431 // void ClearChangeMark(){} | |
432 CFX_WideString GetPath() ; | 405 CFX_WideString GetPath() ; |
433 CPDF_Page* GetPage(int nIndex); | 406 CPDF_Page* GetPage(int nIndex); |
434 CPDFDoc_Environment * GetEnv() {return m_pEnv; } | 407 CPDFDoc_Environment * GetEnv() {return m_pEnv; } |
435 void ProcJavascriptFun(); | 408 void ProcJavascriptFun(); |
436 FX_BOOL ProcOpenAction(); | 409 FX_BOOL ProcOpenAction(); |
437 CPDF_OCContext* GetOCContext(); | 410 CPDF_OCContext* GetOCContext(); |
438 private: | 411 private: |
439 //CFX_ArrayTemplate<CPDFSDK_PageView*> m_pageArray; | |
440 CFX_MapPtrTemplate<CPDF_Page*, CPDFSDK_PageView*> m_pageMap; | 412 CFX_MapPtrTemplate<CPDF_Page*, CPDFSDK_PageView*> m_pageMap; |
441 CPDF_Document* m_pDoc; | 413 CPDF_Document* m_pDoc; |
442 | |
443 CPDFSDK_InterForm* m_pInterForm; | 414 CPDFSDK_InterForm* m_pInterForm; |
444 CPDFSDK_Annot* m_pFocusAnnot; | 415 CPDFSDK_Annot* m_pFocusAnnot; |
445 CPDFDoc_Environment * m_pEnv; | 416 CPDFDoc_Environment * m_pEnv; |
446 CPDF_OCContext * m_pOccontent; | 417 CPDF_OCContext * m_pOccontent; |
447 FX_BOOL m_bChangeMask; | 418 FX_BOOL m_bChangeMask; |
448 }; | 419 }; |
449 class CPDFSDK_PageView FX_FINAL | 420 class CPDFSDK_PageView FX_FINAL |
450 { | 421 { |
451 public: | 422 public: |
452 CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc,CPDF_Page* page); | 423 CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc,CPDF_Page* page); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 } | 557 } |
587 } | 558 } |
588 | 559 |
589 if (nStartPos < m) QuickSort(nStartPos, m, bAscend, pCompare); | 560 if (nStartPos < m) QuickSort(nStartPos, m, bAscend, pCompare); |
590 if (nStopPos > m) QuickSort(m, nStopPos, bAscend, pCompare); | 561 if (nStopPos > m) QuickSort(m, nStopPos, bAscend, pCompare); |
591 } | 562 } |
592 }; | 563 }; |
593 | 564 |
594 | 565 |
595 #endif //_FPDFSDK_MGR_H | 566 #endif //_FPDFSDK_MGR_H |
OLD | NEW |