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 // This file defines the interface class AutocompleteEditView. Each toolkit | 5 // This file defines the interface class AutocompleteEditView. Each toolkit |
6 // will implement the edit view differently, so that code is inherently | 6 // will implement the edit view differently, so that code is inherently |
7 // platform specific. However, the AutocompleteEditModel needs to do some | 7 // platform specific. However, the AutocompleteEditModel needs to do some |
8 // communication with the view. Since the model is shared between platforms, | 8 // communication with the view. Since the model is shared between platforms, |
9 // we need to define an interface that all view implementations will share. | 9 // we need to define an interface that all view implementations will share. |
10 | 10 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 // OnAfterPossibleChange() returns true if there was a change that caused it | 152 // OnAfterPossibleChange() returns true if there was a change that caused it |
153 // to call UpdatePopup(). | 153 // to call UpdatePopup(). |
154 virtual bool OnAfterPossibleChange() = 0; | 154 virtual bool OnAfterPossibleChange() = 0; |
155 | 155 |
156 // Returns the gfx::NativeView of the edit view. | 156 // Returns the gfx::NativeView of the edit view. |
157 virtual gfx::NativeView GetNativeView() const = 0; | 157 virtual gfx::NativeView GetNativeView() const = 0; |
158 | 158 |
159 // Returns the command updater for this view. | 159 // Returns the command updater for this view. |
160 virtual CommandUpdater* GetCommandUpdater() = 0; | 160 virtual CommandUpdater* GetCommandUpdater() = 0; |
161 | 161 |
162 // Shows the instant suggestion text. | 162 // Shows the instant suggestion text. If |animate_to_complete| is true the |
163 virtual void SetInstantSuggestion(const string16& input) = 0; | 163 // view should start an animation that when done commits the text. |
| 164 virtual void SetInstantSuggestion(const string16& input, |
| 165 bool animate_to_complete) = 0; |
164 | 166 |
165 // Returns the current instant suggestion text. | 167 // Returns the current instant suggestion text. |
166 virtual string16 GetInstantSuggestion() const = 0; | 168 virtual string16 GetInstantSuggestion() const = 0; |
167 | 169 |
168 // Returns the width in pixels needed to display the current text. The | 170 // Returns the width in pixels needed to display the current text. The |
169 // returned value includes margins. | 171 // returned value includes margins. |
170 virtual int TextWidth() const = 0; | 172 virtual int TextWidth() const = 0; |
171 | 173 |
172 // Returns true if the user is composing something in an IME. | 174 // Returns true if the user is composing something in an IME. |
173 virtual bool IsImeComposing() const = 0; | 175 virtual bool IsImeComposing() const = 0; |
174 | 176 |
175 #if defined(TOOLKIT_VIEWS) | 177 #if defined(TOOLKIT_VIEWS) |
176 // Adds the autocomplete edit view to view hierarchy and | 178 // Adds the autocomplete edit view to view hierarchy and |
177 // returns the views::View of the edit view. | 179 // returns the views::View of the edit view. |
178 virtual views::View* AddToView(views::View* parent) = 0; | 180 virtual views::View* AddToView(views::View* parent) = 0; |
179 | 181 |
180 // Performs the drop of a drag and drop operation on the view. | 182 // Performs the drop of a drag and drop operation on the view. |
181 virtual int OnPerformDrop(const views::DropTargetEvent& event) = 0; | 183 virtual int OnPerformDrop(const views::DropTargetEvent& event) = 0; |
182 #endif | 184 #endif |
183 | 185 |
184 virtual ~AutocompleteEditView() {} | 186 virtual ~AutocompleteEditView() {} |
185 }; | 187 }; |
186 | 188 |
187 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_H_ | 189 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_H_ |
OLD | NEW |