| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PPAPI_CPP_PRIVATE_FIND_PRIVATE_H_ | 5 #ifndef PPAPI_CPP_PRIVATE_FIND_PRIVATE_H_ |
| 6 #define PPAPI_CPP_PRIVATE_FIND_PRIVATE_H_ | 6 #define PPAPI_CPP_PRIVATE_FIND_PRIVATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> |
| 9 | 10 |
| 10 #include "ppapi/c/private/ppp_find_private.h" | 11 #include "ppapi/c/private/ppp_find_private.h" |
| 11 #include "ppapi/cpp/instance_handle.h" | 12 #include "ppapi/cpp/instance_handle.h" |
| 12 | 13 |
| 13 namespace pp { | 14 namespace pp { |
| 14 | 15 |
| 15 class Instance; | 16 class Instance; |
| 17 class Rect; |
| 16 | 18 |
| 17 // This class allows you to associate the PPP_Find and PPB_Find C-based | 19 // This class allows you to associate the PPP_Find and PPB_Find C-based |
| 18 // interfaces with an object. It associates itself with the given instance, and | 20 // interfaces with an object. It associates itself with the given instance, and |
| 19 // registers as the global handler for handling the PPP_Find interface that the | 21 // registers as the global handler for handling the PPP_Find interface that the |
| 20 // browser calls. | 22 // browser calls. |
| 21 // | 23 // |
| 22 // You would typically use this either via inheritance on your instance: | 24 // You would typically use this either via inheritance on your instance: |
| 23 // class MyInstance : public pp::Instance, public pp::Find_Private { | 25 // class MyInstance : public pp::Instance, public pp::Find_Private { |
| 24 // class MyInstance() : pp::Find_Private(this) { | 26 // class MyInstance() : pp::Find_Private(this) { |
| 25 // } | 27 // } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 46 // PPP_Find_Private functions exposed as virtual functions for you to | 48 // PPP_Find_Private functions exposed as virtual functions for you to |
| 47 // override. | 49 // override. |
| 48 virtual bool StartFind(const std::string& text, bool case_sensitive) = 0; | 50 virtual bool StartFind(const std::string& text, bool case_sensitive) = 0; |
| 49 virtual void SelectFindResult(bool forward) = 0; | 51 virtual void SelectFindResult(bool forward) = 0; |
| 50 virtual void StopFind() = 0; | 52 virtual void StopFind() = 0; |
| 51 | 53 |
| 52 // PPB_Find_Private functions for you to call to report find results. | 54 // PPB_Find_Private functions for you to call to report find results. |
| 53 void SetPluginToHandleFindRequests(); | 55 void SetPluginToHandleFindRequests(); |
| 54 void NumberOfFindResultsChanged(int32_t total, bool final_result); | 56 void NumberOfFindResultsChanged(int32_t total, bool final_result); |
| 55 void SelectedFindResultChanged(int32_t index); | 57 void SelectedFindResultChanged(int32_t index); |
| 58 void SetTickmarks(const std::vector<pp::Rect>& tickmarks); |
| 56 | 59 |
| 57 private: | 60 private: |
| 58 InstanceHandle associated_instance_; | 61 InstanceHandle associated_instance_; |
| 59 }; | 62 }; |
| 60 | 63 |
| 61 } // namespace pp | 64 } // namespace pp |
| 62 | 65 |
| 63 #endif // PPAPI_CPP_PRIVATE_FIND_PRIVATE_H_ | 66 #endif // PPAPI_CPP_PRIVATE_FIND_PRIVATE_H_ |
| OLD | NEW |