summaryrefslogtreecommitdiffstats
path: root/views/examples/examples_main.h
blob: 2b8366ede881d0cf3e6208624fc99627e18c4769 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) 2009 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 VIEWS_EXAMPLES_EXAMPLE_MAIN_H_
#define VIEWS_EXAMPLES_EXAMPLE_MAIN_H_

#include <string>

#include "base/basictypes.h"
#include "views/window/window_delegate.h"

namespace views {
class Label;
class View;
}  // namespace views

namespace examples {

// ExamplesMainBase creates all view examples and start event loop.
class ExamplesMain : public views::WindowDelegate {
 public:
  ExamplesMain() : contents_(NULL), status_label_(NULL) {}
  virtual ~ExamplesMain() {}

  // views::WindowDelegate implementation:
  virtual bool CanResize() const { return true; }
  virtual views::View* GetContentsView();
  virtual void WindowClosing();

  // Prints a message in the status area, at the bottom of the window.
  void SetStatus(const std::wstring& status);

  // Creates all examples and runs the UI event loop.
  void Run();

 private:
  views::View* contents_;

  views::Label* status_label_;

  DISALLOW_COPY_AND_ASSIGN(ExamplesMain);
};

}  // namespace examples

#endif  // VIEWS_EXAMPLES_EXAMPLE_MAIN_H_