1effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch/* Copyright 2014 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/**
7effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch * This file defines the <code>PPB_Find_Private</code> interface.
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)[generate_thunk]
112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)label Chrome {
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  M14 = 0.3
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
16effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch/**
17effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch * This is a private interface for doing browser Find in the PDF plugin.
18effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch */
19effb81e5f8246d0db0270817048dc992db66e9fbBen Murdochinterface PPB_Find_Private {
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  /**
2123730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   * Sets the instance of this plugin as the mechanism that will be used to
2223730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   * handle find requests in the renderer. This will only succeed if the plugin
2323730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   * is embedded within the content of the top level frame. Note that this will
2423730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   * result in the renderer handing over all responsibility for doing find to
2523730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   * the plugin and content from the rest of the page will not be searched.
2623730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   *
2723730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   *
2823730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   * In the case that the plugin is loaded directly as the top level document,
2923730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   * this function does not need to be called. In that case the plugin is
3023730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   * assumed to handle find requests.
3123730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   *
3223730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   * There can only be one plugin which handles find requests. If a plugin calls
3323730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   * this while an existing plugin is registered, the existing plugin will be
3423730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   * de-registered and will no longer receive any requests.
3523730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)   */
3623730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)  void SetPluginToHandleFindRequests(
3723730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)      [in] PP_Instance instance);
3823730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)
3923730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)  /**
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   * Updates the number of find results for the current search term.  If
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   * there are no matches 0 should be passed in.  Only when the plugin has
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   * finished searching should it pass in the final count with final_result set
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   * to PP_TRUE.
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   */
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void NumberOfFindResultsChanged(
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      [in] PP_Instance instance,
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      [in] int32_t total,
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      [in] PP_Bool final_result);
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  /**
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   * Updates the index of the currently selected search item.
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   */
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void SelectedFindResultChanged(
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      [in] PP_Instance instance,
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      [in] int32_t index);
56effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch
57effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch  /**
58effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch   * Updates the tickmarks on the scrollbar for the find request. |tickmarks|
59effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch   * contains |count| PP_Rects indicating the tickmark ranges.
60effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch   */
61effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch  void SetTickmarks(
62effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch      [in] PP_Instance instance,
63effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch      [in, size_as=count] PP_Rect[] tickmarks,
64effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch      [in] uint32_t count);
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
67