Ai
2 Star 0 Fork 0

chromium_develop/chromium_pdf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
preview_mode_client.h 3.35 KB
一键复制 编辑 原始数据 按行查看 历史
李想 提交于 2022-08-16 15:54 +08:00 . chromium origin init
// 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 <stdint.h>
#include <string>
#include <vector>
#include "base/callback_forward.h"
#include "base/location.h"
#include "pdf/pdf_engine.h"
namespace gfx {
class Rect;
class Vector2d;
} // namespace gfx
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);
~PreviewModeClient() override {}
// PDFEngine::Client implementation.
void ProposeDocumentLayout(const DocumentLayout& layout) override;
void Invalidate(const gfx::Rect& rect) override;
void DidScroll(const gfx::Vector2d& offset) override;
void ScrollToX(int x_in_screen_coords) override;
void ScrollToY(int y_in_screen_coords) override;
void ScrollBy(const gfx::Vector2d& scroll_delta) override;
void ScrollToPage(int page) override;
void NavigateTo(const std::string& url,
WindowOpenDisposition disposition) override;
void UpdateCursor(PP_CursorType_Dev cursor) override;
void UpdateTickMarks(const std::vector<gfx::Rect>& tickmarks) override;
void NotifyNumberOfFindResultsChanged(int total, bool final_result) override;
void NotifySelectedFindResultChanged(int current_find_index) override;
void GetDocumentPassword(
base::OnceCallback<void(const std::string&)> callback) override;
void Alert(const std::string& message) override;
bool Confirm(const std::string& message) override;
std::string Prompt(const std::string& question,
const std::string& default_answer) override;
std::string GetURL() override;
void Email(const std::string& to,
const std::string& cc,
const std::string& bcc,
const std::string& subject,
const std::string& body) override;
void Print() override;
void SubmitForm(const std::string& url,
const void* data,
int length) override;
std::unique_ptr<UrlLoader> CreateUrlLoader() override;
std::vector<SearchStringResult> SearchString(const char16_t* string,
const char16_t* term,
bool case_sensitive) override;
void DocumentLoadComplete() override;
void DocumentLoadFailed() override;
pp::Instance* GetPluginInstance() override;
void DocumentHasUnsupportedFeature(const std::string& feature) override;
void FormTextFieldFocusChange(bool in_focus) override;
bool IsPrintPreview() override;
SkColor GetBackgroundColor() override;
void SetSelectedText(const std::string& selected_text) override;
void SetLinkUnderCursor(const std::string& link_under_cursor) override;
bool IsValidLink(const std::string& url) override;
void ScheduleTaskOnMainThread(
base::TimeDelta delay,
ResultCallback callback,
int32_t result,
const base::Location& from_here = base::Location::Current()) override;
private:
Client* const client_;
};
} // namespace chrome_pdf
#endif // PDF_PREVIEW_MODE_CLIENT_H_
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chromium_develop/chromium_pdf.git
git@gitee.com:chromium_develop/chromium_pdf.git
chromium_develop
chromium_pdf
chromium_pdf
master

搜索帮助