1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PPAPI_CPP_PRIVATE_FIND_PRIVATE_H_
6 #define PPAPI_CPP_PRIVATE_FIND_PRIVATE_H_
11 #include "ppapi/c/private/ppp_find_private.h"
12 #include "ppapi/cpp/instance_handle.h"
19 // This class allows you to associate the PPP_Find and PPB_Find C-based
20 // interfaces with an object. It associates itself with the given instance, and
21 // registers as the global handler for handling the PPP_Find interface that the
24 // You would typically use this either via inheritance on your instance:
25 // class MyInstance : public pp::Instance, public pp::Find_Private {
26 // class MyInstance() : pp::Find_Private(this) {
32 // class MyFinder : public pp::Find {
36 // class MyInstance : public pp::Instance {
37 // MyInstance() : finder_(this) {
44 // The instance parameter must outlive this class.
45 Find_Private(Instance
* instance
);
46 virtual ~Find_Private();
48 // PPP_Find_Private functions exposed as virtual functions for you to
50 virtual bool StartFind(const std::string
& text
, bool case_sensitive
) = 0;
51 virtual void SelectFindResult(bool forward
) = 0;
52 virtual void StopFind() = 0;
54 // PPB_Find_Private functions for you to call to report find results.
55 void SetPluginToHandleFindRequests();
56 void NumberOfFindResultsChanged(int32_t total
, bool final_result
);
57 void SelectedFindResultChanged(int32_t index
);
58 void SetTickmarks(const std::vector
<pp::Rect
>& tickmarks
);
61 InstanceHandle associated_instance_
;
66 #endif // PPAPI_CPP_PRIVATE_FIND_PRIVATE_H_