Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Side by Side Diff: pdf/pdfium/pdfium_engine.h

Issue 705823002: Add pdf layer code for PDFium XFA module (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove pdfium_engine.h Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium 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 #ifndef PDF_PDFIUM_PDFIUM_ENGINE_H_ 5 #ifndef PDF_PDFIUM_PDFIUM_ENGINE_H_
6 #define PDF_PDFIUM_PDFIUM_ENGINE_H_ 6 #define PDF_PDFIUM_PDFIUM_ENGINE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/time/time.h" 14 #include "base/time/time.h"
15 #include "pdf/document_loader.h" 15 #include "pdf/document_loader.h"
16 #include "pdf/pdf_engine.h" 16 #include "pdf/pdf_engine.h"
17 #include "pdf/pdfium/pdfium_page.h" 17 #include "pdf/pdfium/pdfium_page.h"
18 #include "pdf/pdfium/pdfium_range.h" 18 #include "pdf/pdfium/pdfium_range.h"
19 #include "ppapi/cpp/completion_callback.h" 19 #include "ppapi/cpp/completion_callback.h"
20 #include "ppapi/cpp/dev/buffer_dev.h" 20 #include "ppapi/cpp/dev/buffer_dev.h"
21 #include "ppapi/cpp/image_data.h" 21 #include "ppapi/cpp/image_data.h"
22 #include "ppapi/cpp/point.h" 22 #include "ppapi/cpp/point.h"
23 #include "third_party/pdfium/fpdfsdk/include/fpdf_dataavail.h" 23 #include "third_party/pdfium/fpdfsdk/include/fpdf_dataavail.h"
24 #include "third_party/pdfium/fpdfsdk/include/fpdf_progressive.h" 24 #include "third_party/pdfium/fpdfsdk/include/fpdf_progressive.h"
25 #include "third_party/pdfium/fpdfsdk/include/fpdfformfill.h" 25 #include "third_party/pdfium/fpdfsdk/include/fpdfformfill.h"
26 #include "third_party/pdfium/fpdfsdk/include/fpdfview.h" 26 #include "third_party/pdfium/fpdfsdk/include/fpdfview.h"
27 27
28 #ifdef _TEST_XFA_
29 #if defined(WIN32)
30 #define XFA_TESTFILE(filename) "E:/"#filename
Lei Zhang 2014/11/05 22:45:09 Do we need this as part of the CL?
Bo Xu 2014/11/05 22:51:46 This is used in pdfium_engine.cc. But I am not qui
Lei Zhang 2014/11/05 22:58:04 Let's just move this into the .cc file. It doesn't
Bo Xu 2014/11/06 01:26:20 Done.
31 #else
32 #define XFA_TESTFILE(filename) "/home/"#filename
33 #endif
34 #endif
35
28 namespace pp { 36 namespace pp {
29 class KeyboardInputEvent; 37 class KeyboardInputEvent;
30 class MouseInputEvent; 38 class MouseInputEvent;
31 } 39 }
32 40
33 namespace chrome_pdf { 41 namespace chrome_pdf {
34 42
35 class ShadowMatrix; 43 class ShadowMatrix;
36 44
37 class PDFiumEngine : public PDFEngine, 45 class PDFiumEngine : public PDFEngine,
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 FPDF_BOOL shrink_to_fit, 473 FPDF_BOOL shrink_to_fit,
466 FPDF_BOOL print_as_image, 474 FPDF_BOOL print_as_image,
467 FPDF_BOOL reverse, 475 FPDF_BOOL reverse,
468 FPDF_BOOL annotations); 476 FPDF_BOOL annotations);
469 static void Form_SubmitForm(IPDF_JSPLATFORM* param, 477 static void Form_SubmitForm(IPDF_JSPLATFORM* param,
470 void* form_data, 478 void* form_data,
471 int length, 479 int length,
472 FPDF_WIDESTRING url); 480 FPDF_WIDESTRING url);
473 static void Form_GotoPage(IPDF_JSPLATFORM* param, int page_number); 481 static void Form_GotoPage(IPDF_JSPLATFORM* param, int page_number);
474 static int Form_Browse(IPDF_JSPLATFORM* param, void* file_path, int length); 482 static int Form_Browse(IPDF_JSPLATFORM* param, void* file_path, int length);
475 483 #ifdef _TEST_XFA_
484 static void Form_EmailTo(FPDF_FORMFILLINFO* pThis, FPDF_FILEHANDLER* fileHandl er,
485 » FPDF_WIDESTRING to, FPDF_WIDESTRING subject, FPDF_WIDESTRING cc, FPDF_ WIDESTRING bcc, FPDF_WIDESTRING message);
Lei Zhang 2014/11/05 22:45:09 Please try to stick with the Google C++ style guid
Bo Xu 2014/11/06 01:26:20 Done.
486 static void Form_DisplayCaret(FPDF_FORMFILLINFO* pThis, FPDF_PAGE page, FPDF_B OOL bVisible, double left, double top, double right, double bottom);
487 //static int Form_GetCurDocumentIndex(FPDF_FORMFILLINFO* pThis);
Tom Sepez 2014/11/05 22:44:47 nit: completely remove the // commented out code.
Lei Zhang 2014/11/05 22:45:09 Can we add the commented out bits in a later CL, o
Bo Xu 2014/11/06 01:26:20 Done.
Bo Xu 2014/11/06 01:26:20 We can add them in a later CL when needed. The cal
488 //static int Form_GetDocumentCount(FPDF_FORMFILLINFO* pThis);
489 static void Form_SetCurrentPage(FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT docume nt, int iCurPage);
490 static int Form_GetCurrentPageIndex(FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT do cument);
491 static void Form_GetPageViewRect(FPDF_FORMFILLINFO* pThis, FPDF_PAGE page, dou ble* left, double* top, double* right, double* bottom);
492 static int Form_GetPlatform(FPDF_FORMFILLINFO* pThis, void* platform, int leng th);
493 static FPDF_BOOL Form_PopupMenu(FPDF_FORMFILLINFO* pThis, FPDF_PAGE page, FPDF _WIDGET hWidget, int menuFlag, float x, float y);
494 static FPDF_BOOL Form_PostRequestURL(FPDF_FORMFILLINFO* pThis, FPDF_WIDESTRING wsURL, FPDF_WIDESTRING wsData, FPDF_WIDESTRING wsContentType, FPDF_WIDESTRING w sEncode, FPDF_WIDESTRING wsHeader, FPDF_BSTR* respone);
495 static FPDF_BOOL Form_PutRequestURL(FPDF_FORMFILLINFO* pThis, FPDF_WIDESTRING wsURL, FPDF_WIDESTRING wsData, FPDF_WIDESTRING wsEncode);
496 //static FPDF_BOOL Form_ShowFileDialog(FPDF_FORMFILLINFO* pThis, FPDF_WIDESTRI NG wsTitle, FPDF_WIDESTRING wsFilter, FPDF_BOOL isOpen, FPDF_STRINGHANDLE pathAr r);
497 static void Form_UploadTo(FPDF_FORMFILLINFO* pThis, FPDF_FILEHANDLER* fileHand ler, int fileFlag, FPDF_WIDESTRING uploadTo);
498 static FPDF_LPFILEHANDLER Form_DownloadFromURL(FPDF_FORMFILLINFO* pThis, FPDF_ WIDESTRING URL);
499 //static FPDF_BOOL MyForm_GetFilePath(FPDF_FORMFILLINFO* pThis, FPDF_FILEHANDL ER* pFileHandler, void* filePath, int length);
500 static FPDF_FILEHANDLER* Form_OpenFile(FPDF_FORMFILLINFO* pThis, int fileFlag, FPDF_WIDESTRING wsURL, const char* mode);
501 static void Form_GotoURL(FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document, FPD F_WIDESTRING wsURL);
502 static int Form_GetLanguage(FPDF_FORMFILLINFO* pThis, void* language, int leng th);
503 #endif // _TEST_XFA_
476 // IFSDK_PAUSE callbacks 504 // IFSDK_PAUSE callbacks
477 static FPDF_BOOL Pause_NeedToPauseNow(IFSDK_PAUSE* param); 505 static FPDF_BOOL Pause_NeedToPauseNow(IFSDK_PAUSE* param);
478 506
479 PDFEngine::Client* client_; 507 PDFEngine::Client* client_;
480 pp::Size document_size_; // Size of document in pixels. 508 pp::Size document_size_; // Size of document in pixels.
481 509
482 // The scroll position in screen coordinates. 510 // The scroll position in screen coordinates.
483 pp::Point position_; 511 pp::Point position_;
484 // The offset of the page into the viewport. 512 // The offset of the page into the viewport.
485 pp::Point page_offset_; 513 pp::Point page_offset_;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 677
650 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. 678 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details.
651 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, 679 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer,
652 int pdf_buffer_size, int page_number, 680 int pdf_buffer_size, int page_number,
653 double* width, double* height); 681 double* width, double* height);
654 }; 682 };
655 683
656 } // namespace chrome_pdf 684 } // namespace chrome_pdf
657 685
658 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ 686 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698