blob: 97eab4746c44ac37997a0821b8eac38968245a3a [file] [log] [blame]
[email protected]420949f2009-03-18 20:40:341// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2// source code is governed by a BSD-style license that can be found in the
3// LICENSE file.
4
5#ifndef CHROME_VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_WIN_H_
6#define CHROME_VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_WIN_H_
7
[email protected]420949f2009-03-18 20:40:348#include "chrome/views/controls/native_control_win.h"
9#include "chrome/views/controls/button/native_button_wrapper.h"
10
11namespace views {
12
13// A View that hosts a native Windows button.
14class NativeButtonWin : public NativeControlWin,
15 public NativeButtonWrapper {
16 public:
[email protected]ff9b986c2009-03-19 21:18:4417 explicit NativeButtonWin(NativeButton2* native_button);
[email protected]420949f2009-03-18 20:40:3418 virtual ~NativeButtonWin();
19
20 // Overridden from NativeButtonWrapper:
[email protected]ff9b986c2009-03-19 21:18:4421 virtual void UpdateLabel();
22 virtual void UpdateFont();
23 virtual void UpdateDefault();
[email protected]420949f2009-03-18 20:40:3424 virtual View* GetView();
25
26 // Overridden from View:
27 virtual gfx::Size GetPreferredSize();
28
29 // Overridden from NativeControlWin:
30 virtual LRESULT ProcessMessage(UINT message,
31 WPARAM w_param,
32 LPARAM l_param);
33 virtual bool OnKeyDown(int vkey);
34
35 protected:
36 virtual bool NotifyOnKeyDown() const;
37 virtual void CreateNativeControl();
38 virtual void NativeControlCreated(HWND control_hwnd);
39
40 private:
[email protected]ff9b986c2009-03-19 21:18:4441 // The NativeButton we are bound to.
42 NativeButton2* native_button_;
[email protected]420949f2009-03-18 20:40:3443
44 DISALLOW_COPY_AND_ASSIGN(NativeButtonWin);
45};
46
47// A View that hosts a native Windows checkbox.
48class NativeCheckboxWin : public NativeButtonWin {
49 public:
[email protected]ff9b986c2009-03-19 21:18:4450 explicit NativeCheckboxWin(Checkbox2* native_button);
[email protected]420949f2009-03-18 20:40:3451 virtual ~NativeCheckboxWin();
52
53 // Overridden from NativeButtonWrapper:
[email protected]ff9b986c2009-03-19 21:18:4454 virtual void UpdateChecked();
[email protected]420949f2009-03-18 20:40:3455 virtual void SetHighlight(bool highlight);
56
57 // Overridden from NativeControlWin:
58 virtual LRESULT ProcessMessage(UINT message,
59 WPARAM w_param,
60 LPARAM l_param);
61
62 protected:
63 virtual void CreateNativeControl();
64 virtual void NativeControlCreated(HWND control_hwnd);
65
66 private:
[email protected]ff9b986c2009-03-19 21:18:4467 // The Checkbox we are bound to.
68 Checkbox2* checkbox_;
[email protected]420949f2009-03-18 20:40:3469
70 DISALLOW_COPY_AND_ASSIGN(NativeCheckboxWin);
71};
72
73// A View that hosts a native Windows radio button.
74class NativeRadioButtonWin : public NativeCheckboxWin {
75 public:
[email protected]ff9b986c2009-03-19 21:18:4476 explicit NativeRadioButtonWin(RadioButton2* radio_button);
[email protected]420949f2009-03-18 20:40:3477 virtual ~NativeRadioButtonWin();
78
79 protected:
80 // Overridden from NativeCheckboxWin:
81 virtual void CreateNativeControl();
82
83 private:
84 DISALLOW_COPY_AND_ASSIGN(NativeRadioButtonWin);
85};
86
87} // namespace views
88
89#endif // #ifndef CHROME_VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_WIN_H_