summaryrefslogtreecommitdiffstats
path: root/pdf/preview_mode_client.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-20 01:56:40 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-20 01:56:40 +0000
commit1b1e9effe9fa3b66dd1bcfff4b78455460f66c61 (patch)
treeca185a1ce62737b897b38ed77d8b8945dddec8df /pdf/preview_mode_client.h
parentf0d119a1eb1211961315c7ce31984134798dbb47 (diff)
downloadchromium_src-1b1e9effe9fa3b66dd1bcfff4b78455460f66c61.zip
chromium_src-1b1e9effe9fa3b66dd1bcfff4b78455460f66c61.tar.gz
chromium_src-1b1e9effe9fa3b66dd1bcfff4b78455460f66c61.tar.bz2
Add the pdf plugin's source in src\pdf.
I've updated gypi files to not use internal_pdf variable anymore, which was brought in from pdf repo's supplemental.gypi. R=thestig@chromium.org TBR=darin Review URL: https://codereview.chromium.org/294793003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271531 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'pdf/preview_mode_client.h')
-rw-r--r--pdf/preview_mode_client.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/pdf/preview_mode_client.h b/pdf/preview_mode_client.h
new file mode 100644
index 0000000..0e766f9
--- /dev/null
+++ b/pdf/preview_mode_client.h
@@ -0,0 +1,77 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PDF_PREVIEW_MODE_CLIENT_H_
+#define PDF_PREVIEW_MODE_CLIENT_H_
+
+#include <string>
+#include <vector>
+
+#include "pdf/pdf_engine.h"
+
+namespace chrome_pdf {
+
+// The interface that's provided to the print preview rendering engine.
+class PreviewModeClient : public PDFEngine::Client {
+ public:
+ class Client {
+ public:
+ virtual void PreviewDocumentLoadFailed() = 0;
+ virtual void PreviewDocumentLoadComplete() = 0;
+ };
+ explicit PreviewModeClient(Client* client);
+ virtual ~PreviewModeClient() {}
+
+ // PDFEngine::Client implementation.
+ virtual void DocumentSizeUpdated(const pp::Size& size);
+ virtual void Invalidate(const pp::Rect& rect);
+ virtual void Scroll(const pp::Point& point);
+ virtual void ScrollToX(int position);
+ virtual void ScrollToY(int position);
+ virtual void ScrollToPage(int page);
+ virtual void NavigateTo(const std::string& url, bool open_in_new_tab);
+ virtual void UpdateCursor(PP_CursorType_Dev cursor);
+ virtual void UpdateTickMarks(const std::vector<pp::Rect>& tickmarks);
+ virtual void NotifyNumberOfFindResultsChanged(int total,
+ bool final_result);
+ virtual void NotifySelectedFindResultChanged(int current_find_index);
+ virtual void GetDocumentPassword(
+ pp::CompletionCallbackWithOutput<pp::Var> callback);
+ virtual void Alert(const std::string& message);
+ virtual bool Confirm(const std::string& message);
+ virtual std::string Prompt(const std::string& question,
+ const std::string& default_answer);
+ virtual std::string GetURL();
+ virtual void Email(const std::string& to,
+ const std::string& cc,
+ const std::string& bcc,
+ const std::string& subject,
+ const std::string& body);
+ virtual void Print();
+ virtual void SubmitForm(const std::string& url,
+ const void* data,
+ int length);
+ virtual std::string ShowFileSelectionDialog();
+ virtual pp::URLLoader CreateURLLoader();
+ virtual void ScheduleCallback(int id, int delay_in_ms);
+ virtual void SearchString(const base::char16* string,
+ const base::char16* term,
+ bool case_sensitive,
+ std::vector<SearchStringResult>* results);
+ virtual void DocumentPaintOccurred();
+ virtual void DocumentLoadComplete(int page_count);
+ virtual void DocumentLoadFailed();
+ virtual pp::Instance* GetPluginInstance();
+ virtual void DocumentHasUnsupportedFeature(const std::string& feature);
+ virtual void DocumentLoadProgress(uint32 available, uint32 doc_size);
+ virtual void FormTextFieldFocusChange(bool in_focus);
+ virtual bool IsPrintPreview();
+
+ private:
+ Client* client_;
+};
+
+} // namespace chrome_pdf
+
+#endif // PDF_PREVIEW_MODE_CLIENT_H_