OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file implements the input method candidate window used on Chrome OS. | 5 // This file implements the input method candidate window used on Chrome OS. |
6 | 6 |
7 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_H_ | 7 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_H_ |
8 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_H_ | 8 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 | 12 |
13 namespace chromeos { | 13 namespace chromeos { |
14 namespace input_method { | 14 namespace input_method { |
15 | 15 |
16 // CandidateWindowController is used for controlling the input method | 16 // CandidateWindowController is used for controlling the input method |
17 // candidate window. Once the initialization is done, the controller | 17 // candidate window. Once the initialization is done, the controller |
18 // starts monitoring signals sent from the the background input method | 18 // starts monitoring signals sent from the the background input method |
19 // daemon, and shows and hides the candidate window as neeeded. Upon | 19 // daemon, and shows and hides the candidate window as neeeded. Upon |
20 // deletion of the object, monitoring stops and the view used for | 20 // deletion of the object, monitoring stops and the view used for |
21 // rendering the candidate view is deleted. | 21 // rendering the candidate view is deleted. |
22 class CandidateWindowController { | 22 class CandidateWindowController { |
23 public: | 23 public: |
| 24 class Observer { |
| 25 public: |
| 26 virtual ~Observer() {} |
| 27 |
| 28 virtual void CandidateWindowOpened() = 0; |
| 29 virtual void CandidateWindowClosed() = 0; |
| 30 }; |
| 31 |
24 CandidateWindowController(); | 32 CandidateWindowController(); |
25 virtual ~CandidateWindowController(); | 33 virtual ~CandidateWindowController(); |
26 | 34 |
27 // Initializes the candidate window. Returns true on success. | 35 // Initializes the candidate window. Returns true on success. |
28 bool Init(); | 36 bool Init(); |
29 | 37 |
| 38 void AddObserver(Observer* observer); |
| 39 void RemoveObserver(Observer* observer); |
| 40 |
30 private: | 41 private: |
31 class Impl; | 42 class Impl; |
32 Impl* impl_; | 43 Impl* impl_; |
33 DISALLOW_COPY_AND_ASSIGN(CandidateWindowController); | 44 DISALLOW_COPY_AND_ASSIGN(CandidateWindowController); |
34 }; | 45 }; |
35 | 46 |
36 } // namespace input_method | 47 } // namespace input_method |
37 } // namespace chromeos | 48 } // namespace chromeos |
38 | 49 |
39 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_H_ | 50 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_H_ |
OLD | NEW |