blob: b46c5d65ef5388c01647c1e088bbffc697ad8a20 [file] [log] [blame]
/*
* This file is part of the WebKit open source project.
* This file has been generated by generate-bindings.pl. DO NOT MODIFY!
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "config.h"
#include "WebKitDOMValidityState.h"
#include <WebCore/CSSImportRule.h>
#include "DOMObjectCache.h"
#include <WebCore/Document.h>
#include <WebCore/ExceptionCode.h>
#include <WebCore/ExceptionCodeDescription.h>
#include <WebCore/JSMainThreadExecState.h>
#include "WebKitDOMPrivate.h"
#include "WebKitDOMValidityStatePrivate.h"
#include "ConvertToUTF8String.h"
#include <wtf/GetPtr.h>
#include <wtf/RefPtr.h>
#define WEBKIT_DOM_VALIDITY_STATE_GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE(obj, WEBKIT_DOM_TYPE_VALIDITY_STATE, WebKitDOMValidityStatePrivate)
typedef struct _WebKitDOMValidityStatePrivate {
RefPtr<WebCore::ValidityState> coreObject;
} WebKitDOMValidityStatePrivate;
namespace WebKit {
WebKitDOMValidityState* kit(WebCore::ValidityState* obj)
{
if (!obj)
return 0;
if (gpointer ret = DOMObjectCache::get(obj))
return WEBKIT_DOM_VALIDITY_STATE(ret);
return wrapValidityState(obj);
}
WebCore::ValidityState* core(WebKitDOMValidityState* request)
{
return request ? static_cast<WebCore::ValidityState*>(WEBKIT_DOM_OBJECT(request)->coreObject) : 0;
}
WebKitDOMValidityState* wrapValidityState(WebCore::ValidityState* coreObject)
{
ASSERT(coreObject);
return WEBKIT_DOM_VALIDITY_STATE(g_object_new(WEBKIT_DOM_TYPE_VALIDITY_STATE, "core-object", coreObject, nullptr));
}
} // namespace WebKit
G_DEFINE_TYPE(WebKitDOMValidityState, webkit_dom_validity_state, WEBKIT_DOM_TYPE_OBJECT)
enum {
PROP_0,
PROP_VALUE_MISSING,
PROP_TYPE_MISMATCH,
PROP_PATTERN_MISMATCH,
PROP_TOO_LONG,
PROP_RANGE_UNDERFLOW,
PROP_RANGE_OVERFLOW,
PROP_STEP_MISMATCH,
PROP_BAD_INPUT,
PROP_CUSTOM_ERROR,
PROP_VALID,
};
static void webkit_dom_validity_state_finalize(GObject* object)
{
WebKitDOMValidityStatePrivate* priv = WEBKIT_DOM_VALIDITY_STATE_GET_PRIVATE(object);
WebKit::DOMObjectCache::forget(priv->coreObject.get());
priv->~WebKitDOMValidityStatePrivate();
G_OBJECT_CLASS(webkit_dom_validity_state_parent_class)->finalize(object);
}
static void webkit_dom_validity_state_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec)
{
WebKitDOMValidityState* self = WEBKIT_DOM_VALIDITY_STATE(object);
switch (propertyId) {
case PROP_VALUE_MISSING:
g_value_set_boolean(value, webkit_dom_validity_state_get_value_missing(self));
break;
case PROP_TYPE_MISMATCH:
g_value_set_boolean(value, webkit_dom_validity_state_get_type_mismatch(self));
break;
case PROP_PATTERN_MISMATCH:
g_value_set_boolean(value, webkit_dom_validity_state_get_pattern_mismatch(self));
break;
case PROP_TOO_LONG:
g_value_set_boolean(value, webkit_dom_validity_state_get_too_long(self));
break;
case PROP_RANGE_UNDERFLOW:
g_value_set_boolean(value, webkit_dom_validity_state_get_range_underflow(self));
break;
case PROP_RANGE_OVERFLOW:
g_value_set_boolean(value, webkit_dom_validity_state_get_range_overflow(self));
break;
case PROP_STEP_MISMATCH:
g_value_set_boolean(value, webkit_dom_validity_state_get_step_mismatch(self));
break;
case PROP_BAD_INPUT:
g_value_set_boolean(value, webkit_dom_validity_state_get_bad_input(self));
break;
case PROP_CUSTOM_ERROR:
g_value_set_boolean(value, webkit_dom_validity_state_get_custom_error(self));
break;
case PROP_VALID:
g_value_set_boolean(value, webkit_dom_validity_state_get_valid(self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec);
break;
}
}
static GObject* webkit_dom_validity_state_constructor(GType type, guint constructPropertiesCount, GObjectConstructParam* constructProperties)
{
GObject* object = G_OBJECT_CLASS(webkit_dom_validity_state_parent_class)->constructor(type, constructPropertiesCount, constructProperties);
WebKitDOMValidityStatePrivate* priv = WEBKIT_DOM_VALIDITY_STATE_GET_PRIVATE(object);
priv->coreObject = static_cast<WebCore::ValidityState*>(WEBKIT_DOM_OBJECT(object)->coreObject);
WebKit::DOMObjectCache::put(priv->coreObject.get(), object);
return object;
}
static void webkit_dom_validity_state_class_init(WebKitDOMValidityStateClass* requestClass)
{
GObjectClass* gobjectClass = G_OBJECT_CLASS(requestClass);
g_type_class_add_private(gobjectClass, sizeof(WebKitDOMValidityStatePrivate));
gobjectClass->constructor = webkit_dom_validity_state_constructor;
gobjectClass->finalize = webkit_dom_validity_state_finalize;
gobjectClass->get_property = webkit_dom_validity_state_get_property;
g_object_class_install_property(
gobjectClass,
PROP_VALUE_MISSING,
g_param_spec_boolean(
"value-missing",
"ValidityState:value-missing",
"read-only gboolean ValidityState:value-missing",
FALSE,
WEBKIT_PARAM_READABLE));
g_object_class_install_property(
gobjectClass,
PROP_TYPE_MISMATCH,
g_param_spec_boolean(
"type-mismatch",
"ValidityState:type-mismatch",
"read-only gboolean ValidityState:type-mismatch",
FALSE,
WEBKIT_PARAM_READABLE));
g_object_class_install_property(
gobjectClass,
PROP_PATTERN_MISMATCH,
g_param_spec_boolean(
"pattern-mismatch",
"ValidityState:pattern-mismatch",
"read-only gboolean ValidityState:pattern-mismatch",
FALSE,
WEBKIT_PARAM_READABLE));
g_object_class_install_property(
gobjectClass,
PROP_TOO_LONG,
g_param_spec_boolean(
"too-long",
"ValidityState:too-long",
"read-only gboolean ValidityState:too-long",
FALSE,
WEBKIT_PARAM_READABLE));
g_object_class_install_property(
gobjectClass,
PROP_RANGE_UNDERFLOW,
g_param_spec_boolean(
"range-underflow",
"ValidityState:range-underflow",
"read-only gboolean ValidityState:range-underflow",
FALSE,
WEBKIT_PARAM_READABLE));
g_object_class_install_property(
gobjectClass,
PROP_RANGE_OVERFLOW,
g_param_spec_boolean(
"range-overflow",
"ValidityState:range-overflow",
"read-only gboolean ValidityState:range-overflow",
FALSE,
WEBKIT_PARAM_READABLE));
g_object_class_install_property(
gobjectClass,
PROP_STEP_MISMATCH,
g_param_spec_boolean(
"step-mismatch",
"ValidityState:step-mismatch",
"read-only gboolean ValidityState:step-mismatch",
FALSE,
WEBKIT_PARAM_READABLE));
g_object_class_install_property(
gobjectClass,
PROP_BAD_INPUT,
g_param_spec_boolean(
"bad-input",
"ValidityState:bad-input",
"read-only gboolean ValidityState:bad-input",
FALSE,
WEBKIT_PARAM_READABLE));
g_object_class_install_property(
gobjectClass,
PROP_CUSTOM_ERROR,
g_param_spec_boolean(
"custom-error",
"ValidityState:custom-error",
"read-only gboolean ValidityState:custom-error",
FALSE,
WEBKIT_PARAM_READABLE));
g_object_class_install_property(
gobjectClass,
PROP_VALID,
g_param_spec_boolean(
"valid",
"ValidityState:valid",
"read-only gboolean ValidityState:valid",
FALSE,
WEBKIT_PARAM_READABLE));
}
static void webkit_dom_validity_state_init(WebKitDOMValidityState* request)
{
WebKitDOMValidityStatePrivate* priv = WEBKIT_DOM_VALIDITY_STATE_GET_PRIVATE(request);
new (priv) WebKitDOMValidityStatePrivate();
}
gboolean webkit_dom_validity_state_get_value_missing(WebKitDOMValidityState* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(WEBKIT_DOM_IS_VALIDITY_STATE(self), FALSE);
WebCore::ValidityState* item = WebKit::core(self);
gboolean result = item->valueMissing();
return result;
}
gboolean webkit_dom_validity_state_get_type_mismatch(WebKitDOMValidityState* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(WEBKIT_DOM_IS_VALIDITY_STATE(self), FALSE);
WebCore::ValidityState* item = WebKit::core(self);
gboolean result = item->typeMismatch();
return result;
}
gboolean webkit_dom_validity_state_get_pattern_mismatch(WebKitDOMValidityState* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(WEBKIT_DOM_IS_VALIDITY_STATE(self), FALSE);
WebCore::ValidityState* item = WebKit::core(self);
gboolean result = item->patternMismatch();
return result;
}
gboolean webkit_dom_validity_state_get_too_long(WebKitDOMValidityState* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(WEBKIT_DOM_IS_VALIDITY_STATE(self), FALSE);
WebCore::ValidityState* item = WebKit::core(self);
gboolean result = item->tooLong();
return result;
}
gboolean webkit_dom_validity_state_get_range_underflow(WebKitDOMValidityState* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(WEBKIT_DOM_IS_VALIDITY_STATE(self), FALSE);
WebCore::ValidityState* item = WebKit::core(self);
gboolean result = item->rangeUnderflow();
return result;
}
gboolean webkit_dom_validity_state_get_range_overflow(WebKitDOMValidityState* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(WEBKIT_DOM_IS_VALIDITY_STATE(self), FALSE);
WebCore::ValidityState* item = WebKit::core(self);
gboolean result = item->rangeOverflow();
return result;
}
gboolean webkit_dom_validity_state_get_step_mismatch(WebKitDOMValidityState* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(WEBKIT_DOM_IS_VALIDITY_STATE(self), FALSE);
WebCore::ValidityState* item = WebKit::core(self);
gboolean result = item->stepMismatch();
return result;
}
gboolean webkit_dom_validity_state_get_bad_input(WebKitDOMValidityState* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(WEBKIT_DOM_IS_VALIDITY_STATE(self), FALSE);
WebCore::ValidityState* item = WebKit::core(self);
gboolean result = item->badInput();
return result;
}
gboolean webkit_dom_validity_state_get_custom_error(WebKitDOMValidityState* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(WEBKIT_DOM_IS_VALIDITY_STATE(self), FALSE);
WebCore::ValidityState* item = WebKit::core(self);
gboolean result = item->customError();
return result;
}
gboolean webkit_dom_validity_state_get_valid(WebKitDOMValidityState* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(WEBKIT_DOM_IS_VALIDITY_STATE(self), FALSE);
WebCore::ValidityState* item = WebKit::core(self);
gboolean result = item->valid();
return result;
}