electron/atom/browser/api/atom_api_button.h

39 lines
956 B
C
Raw Normal View History

2018-05-24 07:56:02 +00:00
// Copyright (c) 2018 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_API_ATOM_API_BUTTON_H_
#define ATOM_BROWSER_API_ATOM_API_BUTTON_H_
#include "atom/browser/api/atom_api_view.h"
#include "native_mate/handle.h"
2018-05-24 08:11:08 +00:00
#include "ui/views/controls/button/button.h"
2018-05-24 07:56:02 +00:00
namespace atom {
namespace api {
2018-05-24 08:11:08 +00:00
class Button : public View, public views::ButtonListener {
2018-05-24 07:56:02 +00:00
public:
static mate::WrappableBase* New(mate::Arguments* args);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
2018-05-24 08:11:08 +00:00
protected:
2018-05-24 07:56:02 +00:00
explicit Button(views::Button* view);
~Button() override;
2018-05-24 08:11:08 +00:00
// views::ButtonListener:
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
2018-05-24 07:56:02 +00:00
private:
DISALLOW_COPY_AND_ASSIGN(Button);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_BUTTON_H_