1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43

pdf / pdf_accessibility_data_handler.h [blame]

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef PDF_PDF_ACCESSIBILITY_DATA_HANDLER_H_
#define PDF_PDF_ACCESSIBILITY_DATA_HANDLER_H_

#include <vector>

#include "services/screen_ai/buildflags/buildflags.h"

namespace chrome_pdf {

struct AccessibilityCharInfo;
struct AccessibilityDocInfo;
struct AccessibilityPageInfo;
struct AccessibilityPageObjects;
struct AccessibilityTextRunInfo;
struct AccessibilityViewportInfo;

class PdfAccessibilityDataHandler {
 public:
  virtual ~PdfAccessibilityDataHandler() = default;

  virtual void SetAccessibilityViewportInfo(
      AccessibilityViewportInfo viewport_info) = 0;
  virtual void SetAccessibilityDocInfo(AccessibilityDocInfo doc_info) = 0;
  virtual void SetAccessibilityPageInfo(
      AccessibilityPageInfo page_info,
      std::vector<AccessibilityTextRunInfo> text_runs,
      std::vector<AccessibilityCharInfo> chars,
      AccessibilityPageObjects page_objects) = 0;

#if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
  // Notifies that at least one page is searchified. This function is called at
  // most once.
  virtual void OnHasSearchifyText() = 0;
#endif
};

}  // namespace chrome_pdf

#endif  // PDF_PDF_ACCESSIBILITY_DATA_HANDLER_H_