| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_DEV_FIND_DEV_H_ | 5 #ifndef PPAPI_CPP_PRIVATE_FIND_PRIVATE_H_ |
| 6 #define PPAPI_CPP_DEV_FIND_DEV_H_ | 6 #define PPAPI_CPP_PRIVATE_FIND_PRIVATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ppapi/c/dev/ppp_find_dev.h" | 10 #include "ppapi/c/private/ppp_find_private.h" |
| 11 #include "ppapi/cpp/instance_handle.h" | 11 #include "ppapi/cpp/instance_handle.h" |
| 12 | 12 |
| 13 namespace pp { | 13 namespace pp { |
| 14 | 14 |
| 15 class Instance; | 15 class Instance; |
| 16 | 16 |
| 17 // This class allows you to associate the PPP_Find and PPB_Find C-based | 17 // 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 | 18 // 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 | 19 // registers as the global handler for handling the PPP_Find interface that the |
| 20 // browser calls. | 20 // browser calls. |
| 21 // | 21 // |
| 22 // You would typically use this either via inheritance on your instance: | 22 // You would typically use this either via inheritance on your instance: |
| 23 // class MyInstance : public pp::Instance, public pp::Find_Dev { | 23 // class MyInstance : public pp::Instance, public pp::Find_Private { |
| 24 // class MyInstance() : pp::Find_Dev(this) { | 24 // class MyInstance() : pp::Find_Private(this) { |
| 25 // } | 25 // } |
| 26 // ... | 26 // ... |
| 27 // }; | 27 // }; |
| 28 // | 28 // |
| 29 // or by composition: | 29 // or by composition: |
| 30 // class MyFinder : public pp::Find { | 30 // class MyFinder : public pp::Find { |
| 31 // ... | 31 // ... |
| 32 // }; | 32 // }; |
| 33 // | 33 // |
| 34 // class MyInstance : public pp::Instance { | 34 // class MyInstance : public pp::Instance { |
| 35 // MyInstance() : finder_(this) { | 35 // MyInstance() : finder_(this) { |
| 36 // } | 36 // } |
| 37 // | 37 // |
| 38 // MyFinder finder_; | 38 // MyFinder finder_; |
| 39 // }; | 39 // }; |
| 40 class Find_Dev { | 40 class Find_Private { |
| 41 public: | 41 public: |
| 42 // The instance parameter must outlive this class. | 42 // The instance parameter must outlive this class. |
| 43 Find_Dev(Instance* instance); | 43 Find_Private(Instance* instance); |
| 44 virtual ~Find_Dev(); | 44 virtual ~Find_Private(); |
| 45 | 45 |
| 46 // PPP_Find_Dev functions exposed as virtual functions for you to | 46 // PPP_Find_Private functions exposed as virtual functions for you to |
| 47 // override. | 47 // override. |
| 48 virtual bool StartFind(const std::string& text, bool case_sensitive) = 0; | 48 virtual bool StartFind(const std::string& text, bool case_sensitive) = 0; |
| 49 virtual void SelectFindResult(bool forward) = 0; | 49 virtual void SelectFindResult(bool forward) = 0; |
| 50 virtual void StopFind() = 0; | 50 virtual void StopFind() = 0; |
| 51 | 51 |
| 52 // PPB_Find_Dev functions for you to call to report find results. | 52 // PPB_Find_Private functions for you to call to report find results. |
| 53 void SetPluginToHandleFindRequests(); | 53 void SetPluginToHandleFindRequests(); |
| 54 void NumberOfFindResultsChanged(int32_t total, bool final_result); | 54 void NumberOfFindResultsChanged(int32_t total, bool final_result); |
| 55 void SelectedFindResultChanged(int32_t index); | 55 void SelectedFindResultChanged(int32_t index); |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 InstanceHandle associated_instance_; | 58 InstanceHandle associated_instance_; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace pp | 61 } // namespace pp |
| 62 | 62 |
| 63 #endif // PPAPI_CPP_DEV_FIND_DEV_H_ | 63 #endif // PPAPI_CPP_PRIVATE_FIND_PRIVATE_H_ |
| OLD | NEW |