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

Unified Diff: mojo/examples/keyboard/keyboard_view.h

Issue 684543003: Move //mojo/examples to //examples (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 | « mojo/examples/keyboard/keyboard_delegate.h ('k') | mojo/examples/keyboard/keyboard_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/keyboard/keyboard_view.h
diff --git a/mojo/examples/keyboard/keyboard_view.h b/mojo/examples/keyboard/keyboard_view.h
deleted file mode 100644
index 4086a2dc7624de6748cc94793658ec6a4bc0bec5..0000000000000000000000000000000000000000
--- a/mojo/examples/keyboard/keyboard_view.h
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright 2014 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 MOJO_EXAMPLES_KEYBOARD_KEYBOARD_VIEW_H_
-#define MOJO_EXAMPLES_KEYBOARD_KEYBOARD_VIEW_H_
-
-#include <vector>
-
-#include "base/macros.h"
-#include "ui/gfx/font_list.h"
-#include "ui/views/controls/button/button.h"
-#include "ui/views/view.h"
-
-namespace views {
-class LabelButton;
-}
-
-namespace mojo {
-namespace examples {
-
-class KeyboardDelegate;
-struct Key;
-struct Row;
-
-// Shows a keyboard the user can interact with. The delegate is notified any
-// time the user presses a button.
-class KeyboardView : public views::View, public views::ButtonListener {
- public:
- explicit KeyboardView(KeyboardDelegate* delegate);
- virtual ~KeyboardView();
-
- // views::View:
- virtual void Layout() override;
-
- private:
- // The type of keys that are shown.
- enum KeyboardLayout {
- KEYBOARD_LAYOUT_ALPHA,
-
- // Uppercase characters.
- KEYBOARD_LAYOUT_SHIFT,
-
- // Numeric characters.
- KEYBOARD_LAYOUT_NUMERIC,
- };
-
- int event_flags() const {
- return (keyboard_layout_ == KEYBOARD_LAYOUT_SHIFT) ?
- ui::EF_SHIFT_DOWN : ui::EF_NONE;
- }
-
- void SetLayout(KeyboardLayout layout);
-
- // Lays out the buttons for the specified row.
- void LayoutRow(const Row& row,
- int row_index,
- int initial_x,
- int button_width,
- int button_height);
-
- // Sets the rows to show.
- void SetRows(const std::vector<const Row*>& rows);
-
- // Configures the button in a row.
- void ConfigureButtonsInRow(int row_index, const Row& row);
-
- // Creates a new button.
- views::View* CreateButton();
-
- // Returns the button corresponding to a key at the specified row/column.
- views::LabelButton* GetButton(int row, int column);
-
- const Key& GetKeyForButton(views::Button* button) const;
-
- // Reset the fonts of all the buttons. |special_font| is used for the buttons
- // that toggle the layout.
- void ResetFonts(const gfx::FontList& button_font,
- const gfx::FontList& special_font);
-
- // views::ButtonListener:
- virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) override;
-
- KeyboardDelegate* delegate_;
-
- // Maximium number of keys in a row. Determined from |rows_|.
- int max_keys_in_row_;
-
- KeyboardLayout keyboard_layout_;
-
- std::vector<const Row*> rows_;
-
- gfx::Size last_layout_size_;
-
- gfx::FontList button_font_;
-
- DISALLOW_COPY_AND_ASSIGN(KeyboardView);
-};
-
-} // namespace examples
-} // namespace mojo
-
-#endif // MOJO_EXAMPLES_KEYBOARD_KEYBOARD_VIEW_H_
« no previous file with comments | « mojo/examples/keyboard/keyboard_delegate.h ('k') | mojo/examples/keyboard/keyboard_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698