electron/shell/common/gin_helper/event.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.2 KiB
C
Raw Normal View History

2023-02-13 13:39:18 -08:00
// Copyright (c) 2023 Salesforce, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ELECTRON_SHELL_COMMON_GIN_HELPER_EVENT_H_
#define ELECTRON_SHELL_COMMON_GIN_HELPER_EVENT_H_
#include "gin/wrappable.h"
2023-02-13 13:39:18 -08:00
#include "shell/common/gin_helper/constructible.h"
namespace gin_helper::internal {
class Event final : public gin::Wrappable<Event>,
public gin_helper::Constructible<Event> {
2023-02-13 13:39:18 -08:00
public:
// gin_helper::Constructible
static Event* New(v8::Isolate* isolate);
2023-02-13 13:39:18 -08:00
static v8::Local<v8::ObjectTemplate> FillObjectTemplate(
v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
static const char* GetClassName() { return "Event"; }
2023-02-13 13:39:18 -08:00
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
const gin::WrapperInfo* wrapper_info() const override;
const char* GetHumanReadableName() const override;
2023-02-13 13:39:18 -08:00
Event();
2023-02-13 13:39:18 -08:00
~Event() override;
void PreventDefault() { default_prevented_ = true; }
bool GetDefaultPrevented() { return default_prevented_; }
private:
bool default_prevented_ = false;
};
} // namespace gin_helper::internal
#endif // ELECTRON_SHELL_COMMON_GIN_HELPER_EVENT_H_