Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: chromeos/ime/candidate_window.h

Issue 132453002: Moves CandidateWindow model to ui/base/ime (2nd) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/chromeos.gyp ('k') | chromeos/ime/candidate_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/ime/candidate_window.h
diff --git a/chromeos/ime/candidate_window.h b/chromeos/ime/candidate_window.h
deleted file mode 100644
index d0f5f895feeb74aed3e5755ba0e1418f7d43e4ae..0000000000000000000000000000000000000000
--- a/chromeos/ime/candidate_window.h
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROMEOS_IME_CANDIDATE_WINDOW_H_
-#define CHROMEOS_IME_CANDIDATE_WINDOW_H_
-
-#include <string>
-#include <vector>
-#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
-#include "chromeos/chromeos_export.h"
-
-namespace chromeos {
-namespace input_method {
-
-// CandidateWindow represents the structure of candidates generated from IME.
-class CHROMEOS_EXPORT CandidateWindow {
- public:
- enum Orientation {
- HORIZONTAL = 0,
- VERTICAL = 1,
- };
-
- struct CandidateWindowProperty {
- CandidateWindowProperty();
- virtual ~CandidateWindowProperty();
- int page_size;
- int cursor_position;
- bool is_cursor_visible;
- bool is_vertical;
- bool show_window_at_composition;
-
- // Auxiliary text is typically displayed in the footer of the candidate
- // window.
- std::string auxiliary_text;
- bool is_auxiliary_text_visible;
- };
-
- // Represents a candidate entry.
- struct Entry {
- Entry();
- virtual ~Entry();
- std::string value;
- std::string label;
- std::string annotation;
- std::string description_title;
- std::string description_body;
- };
-
- CandidateWindow();
- virtual ~CandidateWindow();
-
- // Returns true if the given |candidate_window| is equal to myself.
- bool IsEqual(const CandidateWindow& candidate_window) const;
-
- // Copies |candidate_window| to myself.
- void CopyFrom(const CandidateWindow& candidate_window);
-
- const CandidateWindowProperty& GetProperty() const {
- return *property_;
- }
- void SetProperty(const CandidateWindowProperty& property) {
- *property_ = property;
- }
-
- // Returns the number of candidates in one page.
- uint32 page_size() const { return property_->page_size; }
- void set_page_size(uint32 page_size) { property_->page_size = page_size; }
-
- // Returns the cursor index of the currently selected candidate.
- uint32 cursor_position() const { return property_->cursor_position; }
- void set_cursor_position(uint32 cursor_position) {
- property_->cursor_position = cursor_position;
- }
-
- // Returns true if the cursor is visible.
- bool is_cursor_visible() const { return property_->is_cursor_visible; }
- void set_is_cursor_visible(bool is_cursor_visible) {
- property_->is_cursor_visible = is_cursor_visible;
- }
-
- // Returns the orientation of the candidate window.
- Orientation orientation() const {
- return property_->is_vertical ? VERTICAL : HORIZONTAL;
- }
- void set_orientation(Orientation orientation) {
- property_->is_vertical = (orientation == VERTICAL);
- }
-
- // Returns true if the auxiliary text is visible.
- bool is_auxiliary_text_visible() const {
- return property_->is_auxiliary_text_visible;
- }
- void set_is_auxiliary_text_visible(bool is_auxiliary_text_visible) const {
- property_->is_auxiliary_text_visible = is_auxiliary_text_visible;
- }
-
- // Accessors of auxiliary_text.
- const std::string& auxiliary_text() const {
- return property_->auxiliary_text;
- }
- void set_auxiliary_text(const std::string& auxiliary_text) const {
- property_->auxiliary_text = auxiliary_text;
- }
-
- const std::vector<Entry>& candidates() const { return candidates_; }
- std::vector<Entry>* mutable_candidates() { return &candidates_; }
-
- bool show_window_at_composition() const {
- return property_->show_window_at_composition;
- }
- void set_show_window_at_composition(bool show_window_at_composition) {
- property_->show_window_at_composition = show_window_at_composition;
- }
-
- private:
- scoped_ptr<CandidateWindowProperty> property_;
- std::vector<Entry> candidates_;
-
- DISALLOW_COPY_AND_ASSIGN(CandidateWindow);
-};
-
-} // namespace input_method
-} // namespace chromeos
-
-#endif // CHROMEOS_IME_CANDIDATE_WINDOW_H_
« no previous file with comments | « chromeos/chromeos.gyp ('k') | chromeos/ime/candidate_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698