| 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 #ifndef VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ | 5 #ifndef VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
| 6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ | 6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
| 16 #include "ui/base/ime/composition_text.h" | 16 #include "ui/base/ime/composition_text.h" |
| 17 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
| 18 #include "ui/gfx/render_text.h" | 18 #include "ui/gfx/render_text.h" |
| 19 #include "views/views_api.h" | 19 #include "views/views_export.h" |
| 20 | 20 |
| 21 namespace gfx { | 21 namespace gfx { |
| 22 class Canvas; | 22 class Canvas; |
| 23 class Font; | 23 class Font; |
| 24 class RenderText; | 24 class RenderText; |
| 25 struct StyleRange; | 25 struct StyleRange; |
| 26 } // namespace gfx | 26 } // namespace gfx |
| 27 | 27 |
| 28 namespace ui { | 28 namespace ui { |
| 29 class Range; | 29 class Range; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 45 // Does the edit have to be merged with previous edit? | 45 // Does the edit have to be merged with previous edit? |
| 46 // This forces the merge even if the previous edit is marked | 46 // This forces the merge even if the previous edit is marked |
| 47 // as DO_NOT_MERGE. | 47 // as DO_NOT_MERGE. |
| 48 MERGE_WITH_PREVIOUS, | 48 MERGE_WITH_PREVIOUS, |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace internal | 51 } // namespace internal |
| 52 | 52 |
| 53 // A model that represents a text content for TextfieldViews. | 53 // A model that represents a text content for TextfieldViews. |
| 54 // It supports editing, selection and cursor manipulation. | 54 // It supports editing, selection and cursor manipulation. |
| 55 class VIEWS_API TextfieldViewsModel { | 55 class VIEWS_EXPORT TextfieldViewsModel { |
| 56 public: | 56 public: |
| 57 | 57 |
| 58 // Delegate interface implemented by the textfield view class to provided | 58 // Delegate interface implemented by the textfield view class to provided |
| 59 // additional functionalities required by the model. | 59 // additional functionalities required by the model. |
| 60 class VIEWS_API Delegate { | 60 class VIEWS_EXPORT Delegate { |
| 61 public: | 61 public: |
| 62 // Called when the current composition text is confirmed or cleared. | 62 // Called when the current composition text is confirmed or cleared. |
| 63 virtual void OnCompositionTextConfirmedOrCleared() = 0; | 63 virtual void OnCompositionTextConfirmedOrCleared() = 0; |
| 64 | 64 |
| 65 protected: | 65 protected: |
| 66 virtual ~Delegate(); | 66 virtual ~Delegate(); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 explicit TextfieldViewsModel(Delegate* delegate); | 69 explicit TextfieldViewsModel(Delegate* delegate); |
| 70 virtual ~TextfieldViewsModel(); | 70 virtual ~TextfieldViewsModel(); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 // 2) new edit is added. (redo history is cleared) | 325 // 2) new edit is added. (redo history is cleared) |
| 326 // 3) redone all undone edits. | 326 // 3) redone all undone edits. |
| 327 EditHistory::iterator current_edit_; | 327 EditHistory::iterator current_edit_; |
| 328 | 328 |
| 329 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); | 329 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); |
| 330 }; | 330 }; |
| 331 | 331 |
| 332 } // namespace views | 332 } // namespace views |
| 333 | 333 |
| 334 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ | 334 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
| OLD | NEW |