
/*

  KLayout Layout Viewer
  Copyright (C) 2006-2016 Matthias Koefferlein

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program 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 General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*/

/**
*  @file gsiDeclQInputMethodEvent.cc 
*
*  DO NOT EDIT THIS FILE. 
*  This file has been created automatically
*/

#include "gsiQtGui.h"
#include "gsiDeclQtTypeTraits.h"
#include "gsiDeclQInputMethodEvent_Enums.h"
#include <memory>

// -----------------------------------------------------------------------
// class QInputMethodEvent

//  Constructor QInputMethodEvent::QInputMethodEvent()


static void _init_ctor_QInputMethodEvent_0 (qt_gsi::GenericStaticMethod *decl)
{
  decl->set_return_new<QInputMethodEvent *> ();
}

static void _call_ctor_QInputMethodEvent_0 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<QInputMethodEvent *> (new QInputMethodEvent ());
}

static qt_gsi::GenericStaticMethod *_create_ctor_QInputMethodEvent_0 ()
{
  return new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QInputMethodEvent::QInputMethodEvent()\nThis method creates an object of class QInputMethodEvent.", &_init_ctor_QInputMethodEvent_0, &_call_ctor_QInputMethodEvent_0);
}

//  Constructor QInputMethodEvent::QInputMethodEvent(const QString &preeditText, const QList<QInputMethodEvent::Attribute> &attributes)


static void _init_ctor_QInputMethodEvent_6641 (qt_gsi::GenericStaticMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("preeditText");
  decl->add_arg<const QString & > (argspec_0);
  static gsi::ArgSpecBase argspec_1 ("attributes");
  decl->add_arg<const qt_gsi::Converter<QList<QInputMethodEvent::Attribute> >::target_type & > (argspec_1);
  decl->set_return_new<QInputMethodEvent *> ();
}

static void _call_ctor_QInputMethodEvent_6641 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const QString &arg1 = args.read<const QString & > ();
  const qt_gsi::Converter<QList<QInputMethodEvent::Attribute> >::target_type & arg2 = args.read<const qt_gsi::Converter<QList<QInputMethodEvent::Attribute> >::target_type & > ();
  ret.write<QInputMethodEvent *> (new QInputMethodEvent (arg1, qt_gsi::QtToCppAdaptor<QList<QInputMethodEvent::Attribute> >(arg2).cref()));
}

static qt_gsi::GenericStaticMethod *_create_ctor_QInputMethodEvent_6641 ()
{
  return new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QInputMethodEvent::QInputMethodEvent(const QString &preeditText, const QList<QInputMethodEvent::Attribute> &attributes)\nThis method creates an object of class QInputMethodEvent.", &_init_ctor_QInputMethodEvent_6641, &_call_ctor_QInputMethodEvent_6641);
}

//  Constructor QInputMethodEvent::QInputMethodEvent(const QInputMethodEvent &other)


static void _init_ctor_QInputMethodEvent_3045 (qt_gsi::GenericStaticMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("other");
  decl->add_arg<const QInputMethodEvent & > (argspec_0);
  decl->set_return_new<QInputMethodEvent *> ();
}

static void _call_ctor_QInputMethodEvent_3045 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const QInputMethodEvent &arg1 = args.read<const QInputMethodEvent & > ();
  ret.write<QInputMethodEvent *> (new QInputMethodEvent (arg1));
}

static qt_gsi::GenericStaticMethod *_create_ctor_QInputMethodEvent_3045 ()
{
  return new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QInputMethodEvent::QInputMethodEvent(const QInputMethodEvent &other)\nThis method creates an object of class QInputMethodEvent.", &_init_ctor_QInputMethodEvent_3045, &_call_ctor_QInputMethodEvent_3045);
}

// const QList<QInputMethodEvent::Attribute> &QInputMethodEvent::attributes()


static void _init_f_attributes_c0 (qt_gsi::GenericMethod *decl)
{
  decl->set_return<qt_gsi::Converter<QList<QInputMethodEvent::Attribute> >::target_type > ();
}

static void _call_f_attributes_c0 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<qt_gsi::Converter<QList<QInputMethodEvent::Attribute> >::target_type > ((qt_gsi::Converter<QList<QInputMethodEvent::Attribute> >::target_type)qt_gsi::CppToQtAdaptor<QList<QInputMethodEvent::Attribute> >(((QInputMethodEvent *)cls)->attributes ()));
}

static qt_gsi::GenericMethod *_create_f_attributes_c0 ()
{
  return new qt_gsi::GenericMethod ("attributes", "@brief Method const QList<QInputMethodEvent::Attribute> &QInputMethodEvent::attributes()\n", true, &_init_f_attributes_c0, &_call_f_attributes_c0);
}

// const QString &QInputMethodEvent::commitString()


static void _init_f_commitString_c0 (qt_gsi::GenericMethod *decl)
{
  decl->set_return<const QString & > ();
}

static void _call_f_commitString_c0 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<const QString & > ((const QString &)((QInputMethodEvent *)cls)->commitString ());
}

static qt_gsi::GenericMethod *_create_f_commitString_c0 ()
{
  return new qt_gsi::GenericMethod (":commitString", "@brief Method const QString &QInputMethodEvent::commitString()\n", true, &_init_f_commitString_c0, &_call_f_commitString_c0);
}

// const QString &QInputMethodEvent::preeditString()


static void _init_f_preeditString_c0 (qt_gsi::GenericMethod *decl)
{
  decl->set_return<const QString & > ();
}

static void _call_f_preeditString_c0 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<const QString & > ((const QString &)((QInputMethodEvent *)cls)->preeditString ());
}

static qt_gsi::GenericMethod *_create_f_preeditString_c0 ()
{
  return new qt_gsi::GenericMethod ("preeditString", "@brief Method const QString &QInputMethodEvent::preeditString()\n", true, &_init_f_preeditString_c0, &_call_f_preeditString_c0);
}

// int QInputMethodEvent::replacementLength()


static void _init_f_replacementLength_c0 (qt_gsi::GenericMethod *decl)
{
  decl->set_return<int > ();
}

static void _call_f_replacementLength_c0 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<int > ((int)((QInputMethodEvent *)cls)->replacementLength ());
}

static qt_gsi::GenericMethod *_create_f_replacementLength_c0 ()
{
  return new qt_gsi::GenericMethod ("replacementLength", "@brief Method int QInputMethodEvent::replacementLength()\n", true, &_init_f_replacementLength_c0, &_call_f_replacementLength_c0);
}

// int QInputMethodEvent::replacementStart()


static void _init_f_replacementStart_c0 (qt_gsi::GenericMethod *decl)
{
  decl->set_return<int > ();
}

static void _call_f_replacementStart_c0 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<int > ((int)((QInputMethodEvent *)cls)->replacementStart ());
}

static qt_gsi::GenericMethod *_create_f_replacementStart_c0 ()
{
  return new qt_gsi::GenericMethod ("replacementStart", "@brief Method int QInputMethodEvent::replacementStart()\n", true, &_init_f_replacementStart_c0, &_call_f_replacementStart_c0);
}

// void QInputMethodEvent::setCommitString(const QString &commitString, int replaceFrom, int replaceLength)


static void _init_f_setCommitString_3343 (qt_gsi::GenericMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("commitString");
  decl->add_arg<const QString & > (argspec_0);
  static gsi::ArgSpecBase argspec_1 ("replaceFrom", true, "0");
  decl->add_arg<int > (argspec_1);
  static gsi::ArgSpecBase argspec_2 ("replaceLength", true, "0");
  decl->add_arg<int > (argspec_2);
  decl->set_return<void > ();
}

static void _call_f_setCommitString_3343 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const QString &arg1 = args.read<const QString & > ();
  int arg2 = args ? args.read<int > () : (int)(0);
  int arg3 = args ? args.read<int > () : (int)(0);
  ((QInputMethodEvent *)cls)->setCommitString (arg1, arg2, arg3);
}

static qt_gsi::GenericMethod *_create_f_setCommitString_3343 ()
{
  return new qt_gsi::GenericMethod ("setCommitString", "@brief Method void QInputMethodEvent::setCommitString(const QString &commitString, int replaceFrom, int replaceLength)\n", false, &_init_f_setCommitString_3343, &_call_f_setCommitString_3343);
}


namespace gsi
{
extern gsi::Class<QEvent> decl_QEvent;

gsi::Class<QInputMethodEvent> decl_QInputMethodEvent (decl_QEvent, "QInputMethodEvent",
  gsi::Methods(_create_ctor_QInputMethodEvent_0 ()) +
  gsi::Methods(_create_ctor_QInputMethodEvent_6641 ()) +
  gsi::Methods(_create_ctor_QInputMethodEvent_3045 ()) +
  gsi::Methods(_create_f_attributes_c0 ()) +
  gsi::Methods(_create_f_commitString_c0 ()) +
  gsi::Methods(_create_f_preeditString_c0 ()) +
  gsi::Methods(_create_f_replacementLength_c0 ()) +
  gsi::Methods(_create_f_replacementStart_c0 ()) +
  gsi::Methods(_create_f_setCommitString_3343 ()),
  "@qt\n@brief Binding of QInputMethodEvent");

}


//  Implementation of the enum wrapper class for QInputMethodEvent::AttributeType
namespace qt_gsi
{

static QInputMethodEvent_AttributeType_Enum *c_1_QInputMethodEvent_AttributeType_Enum () { return new QInputMethodEvent_AttributeType_Enum (QInputMethodEvent::TextFormat); }
static QInputMethodEvent_AttributeType_Enum *c_2_QInputMethodEvent_AttributeType_Enum () { return new QInputMethodEvent_AttributeType_Enum (QInputMethodEvent::Cursor); }
static QInputMethodEvent_AttributeType_Enum *c_3_QInputMethodEvent_AttributeType_Enum () { return new QInputMethodEvent_AttributeType_Enum (QInputMethodEvent::Language); }
static QInputMethodEvent_AttributeType_Enum *c_4_QInputMethodEvent_AttributeType_Enum () { return new QInputMethodEvent_AttributeType_Enum (QInputMethodEvent::Ruby); }
static QInputMethodEvent_AttributeType_Enum *c_5_QInputMethodEvent_AttributeType_Enum () { return new QInputMethodEvent_AttributeType_Enum (QInputMethodEvent::Selection); }

static gsi::Methods mkdefs_QInputMethodEvent_AttributeType () {
  return
    gsi::constant ("TextFormat", &qt_gsi::c_1_QInputMethodEvent_AttributeType_Enum, "@brief Enum constant QInputMethodEvent::TextFormat") +
    gsi::constant ("Cursor", &qt_gsi::c_2_QInputMethodEvent_AttributeType_Enum, "@brief Enum constant QInputMethodEvent::Cursor") +
    gsi::constant ("Language", &qt_gsi::c_3_QInputMethodEvent_AttributeType_Enum, "@brief Enum constant QInputMethodEvent::Language") +
    gsi::constant ("Ruby", &qt_gsi::c_4_QInputMethodEvent_AttributeType_Enum, "@brief Enum constant QInputMethodEvent::Ruby") +
    gsi::constant ("Selection", &qt_gsi::c_5_QInputMethodEvent_AttributeType_Enum, "@brief Enum constant QInputMethodEvent::Selection");
}

static std::string to_s_QInputMethodEvent_AttributeType_Enum (const QInputMethodEvent_AttributeType_Enum *e)
{
  if (e->value () == QInputMethodEvent::TextFormat) { return tl::sprintf ("TextFormat (%u)", (unsigned int) e->value ()); }
  if (e->value () == QInputMethodEvent::Cursor) { return tl::sprintf ("Cursor (%u)", (unsigned int) e->value ()); }
  if (e->value () == QInputMethodEvent::Language) { return tl::sprintf ("Language (%u)", (unsigned int) e->value ()); }
  if (e->value () == QInputMethodEvent::Ruby) { return tl::sprintf ("Ruby (%u)", (unsigned int) e->value ()); }
  if (e->value () == QInputMethodEvent::Selection) { return tl::sprintf ("Selection (%u)", (unsigned int) e->value ()); }
  return std::string ("(not a valid enum evalue)");
}

static unsigned int to_i_QInputMethodEvent_AttributeType_Enum (const QInputMethodEvent_AttributeType_Enum *e)
{
  return (unsigned int) e->value ();
}

static QInputMethodEvent_AttributeType_Enum *from_i_QInputMethodEvent_AttributeType_Enum (unsigned int i)
{
  return new QInputMethodEvent_AttributeType_Enum ((QInputMethodEvent::AttributeType) i);
}

static bool equalQInputMethodEvent_AttributeType_Enum (const QInputMethodEvent_AttributeType_Enum *e, QInputMethodEvent_AttributeType_Enum d)
{
  return e->value () == d.value ();
}

static bool equal2QInputMethodEvent_AttributeType_Enum (const QInputMethodEvent_AttributeType_Enum *e, unsigned int i)
{
  return (unsigned int) e->value () == i;
}

static QInputMethodEvent_AttributeType_Enums oropQInputMethodEvent_AttributeType_Enums (const QInputMethodEvent_AttributeType_Enums *e, const QInputMethodEvent_AttributeType_Enums &d)
{
  return e->flags () | d.flags ();
}

static QInputMethodEvent_AttributeType_Enums andopQInputMethodEvent_AttributeType_Enums (const QInputMethodEvent_AttributeType_Enums *e, const QInputMethodEvent_AttributeType_Enums &d)
{
  return e->flags () & d.flags ();
}

static QInputMethodEvent_AttributeType_Enums xoropQInputMethodEvent_AttributeType_Enums (const QInputMethodEvent_AttributeType_Enums *e, const QInputMethodEvent_AttributeType_Enums &d)
{
  return e->flags () ^ d.flags ();
}

static std::string to_s_QInputMethodEvent_AttributeType_Enums (const QInputMethodEvent_AttributeType_Enums *e)
{
  std::string l;
  if (e->testFlag (QInputMethodEvent::TextFormat)) { if (!l.empty ()) l += "|"; l += "TextFormat"; }
  if (e->testFlag (QInputMethodEvent::Cursor)) { if (!l.empty ()) l += "|"; l += "Cursor"; }
  if (e->testFlag (QInputMethodEvent::Language)) { if (!l.empty ()) l += "|"; l += "Language"; }
  if (e->testFlag (QInputMethodEvent::Ruby)) { if (!l.empty ()) l += "|"; l += "Ruby"; }
  if (e->testFlag (QInputMethodEvent::Selection)) { if (!l.empty ()) l += "|"; l += "Selection"; }
  return tl::sprintf ("%u (%s)", (unsigned int) (e->flags ()), l);
}

static int to_i_QInputMethodEvent_AttributeType_Enums (const QInputMethodEvent_AttributeType_Enums *e)
{
  return int (e->flags ());
}

static bool testFlag_QInputMethodEvent_AttributeType_Enums (const QInputMethodEvent_AttributeType_Enums *e, const QInputMethodEvent_AttributeType_Enum &d)
{
  return e->flags ().testFlag (d.value ());
}

}

namespace gsi
{

//  Declarations for QFlags<enum> wrapper class
gsi::Class<qt_gsi::QInputMethodEvent_AttributeType_Enums> decl_QInputMethodEvent_AttributeType_Enums ("QInputMethodEvent_QFlags_AttributeType",
  gsi::method_ext ("|", &qt_gsi::oropQInputMethodEvent_AttributeType_Enums, gsi::arg ("other"), "@brief 'or' operator between two flag sets") +
  gsi::method_ext ("&", &qt_gsi::andopQInputMethodEvent_AttributeType_Enums, gsi::arg ("other"), "@brief 'and' operator between two flag sets") +
  gsi::method_ext ("^", &qt_gsi::xoropQInputMethodEvent_AttributeType_Enums, gsi::arg ("other"), "@brief 'xor' operator between two flag sets") +
  gsi::method_ext ("to_s|inspect", &qt_gsi::to_s_QInputMethodEvent_AttributeType_Enums, "@brief Converts the flag set to a string") +
  gsi::method_ext ("to_i", &qt_gsi::to_i_QInputMethodEvent_AttributeType_Enums, "@brief Returns the integer value encoding the flag set") +
  gsi::method_ext ("testFlag", &qt_gsi::testFlag_QInputMethodEvent_AttributeType_Enums, gsi::arg ("flag"), "@brief Tests whether the flag is contained in the flag set"),
  "@qt\n@brief This class represents the QFlags<QInputMethodEvent::AttributeType> flag set");

//  Declarations for enum wrapper class
gsi::Class<qt_gsi::QInputMethodEvent_AttributeType_Enum> decl_QInputMethodEvent_AttributeType_Enum (decl_QInputMethodEvent_AttributeType_Enums, "QInputMethodEvent_AttributeType",
  qt_gsi::mkdefs_QInputMethodEvent_AttributeType () +
  gsi::method_ext ("to_s|inspect", &qt_gsi::to_s_QInputMethodEvent_AttributeType_Enum, "@brief Converts the enum class to a string") +
  gsi::method_ext ("to_i", &qt_gsi::to_i_QInputMethodEvent_AttributeType_Enum, "@brief Converts the enum class to an integer") +
  gsi::method_ext ("==", &qt_gsi::equalQInputMethodEvent_AttributeType_Enum, gsi::arg ("other"), "@brief Compares the enum class against an enum of it's own type") +
  gsi::method_ext ("==", &qt_gsi::equal2QInputMethodEvent_AttributeType_Enum, gsi::arg ("other"), "@brief Compares the enum class against an integer") +
  gsi::constructor ("new", &qt_gsi::from_i_QInputMethodEvent_AttributeType_Enum, gsi::arg ("value"), "@brief Creates the enum object from an integer"),
  "@qt\n@brief This class represents the QInputMethodEvent::AttributeType enum");

//  Inject the declarations into the parent
static gsi::ClassExt<QInputMethodEvent> inject_QInputMethodEvent_AttributeType_Enum_in_parent (qt_gsi::mkdefs_QInputMethodEvent_AttributeType ());
static gsi::ClassExt<QInputMethodEvent> decl_QInputMethodEvent_AttributeType_Enum_as_child (decl_QInputMethodEvent_AttributeType_Enum, "AttributeType");

}

