
/*

  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 gsiDeclQTextLength.cc 
*
*  DO NOT EDIT THIS FILE. 
*  This file has been created automatically
*/

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

// -----------------------------------------------------------------------
// class QTextLength

//  Constructor QTextLength::QTextLength()


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

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

static qt_gsi::GenericStaticMethod *_create_ctor_QTextLength_0 ()
{
  return new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QTextLength::QTextLength()\nThis method creates an object of class QTextLength.", &_init_ctor_QTextLength_0, &_call_ctor_QTextLength_0);
}

//  Constructor QTextLength::QTextLength(QTextLength::Type type, double value)


static void _init_ctor_QTextLength_3045 (qt_gsi::GenericStaticMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("type");
  decl->add_arg<const qt_gsi::Converter<QTextLength::Type>::target_type & > (argspec_0);
  static gsi::ArgSpecBase argspec_1 ("value");
  decl->add_arg<double > (argspec_1);
  decl->set_return_new<QTextLength *> ();
}

static void _call_ctor_QTextLength_3045 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const qt_gsi::Converter<QTextLength::Type>::target_type & arg1 = args.read<const qt_gsi::Converter<QTextLength::Type>::target_type & > ();
  double arg2 = args.read<double > ();
  ret.write<QTextLength *> (new QTextLength (qt_gsi::QtToCppAdaptor<QTextLength::Type>(arg1).cref(), arg2));
}

static qt_gsi::GenericStaticMethod *_create_ctor_QTextLength_3045 ()
{
  return new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QTextLength::QTextLength(QTextLength::Type type, double value)\nThis method creates an object of class QTextLength.", &_init_ctor_QTextLength_3045, &_call_ctor_QTextLength_3045);
}

// bool QTextLength::operator!=(const QTextLength &other)


static void _init_f_operator_excl__eq__c2425 (qt_gsi::GenericMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("other");
  decl->add_arg<const QTextLength & > (argspec_0);
  decl->set_return<bool > ();
}

static void _call_f_operator_excl__eq__c2425 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const QTextLength &arg1 = args.read<const QTextLength & > ();
  ret.write<bool > ((bool)((QTextLength *)cls)->operator!= (arg1));
}

static qt_gsi::GenericMethod *_create_f_operator_excl__eq__c2425 ()
{
  return new qt_gsi::GenericMethod ("!=", "@brief Method bool QTextLength::operator!=(const QTextLength &other)\n", true, &_init_f_operator_excl__eq__c2425, &_call_f_operator_excl__eq__c2425);
}

// bool QTextLength::operator==(const QTextLength &other)


static void _init_f_operator_eq__eq__c2425 (qt_gsi::GenericMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("other");
  decl->add_arg<const QTextLength & > (argspec_0);
  decl->set_return<bool > ();
}

static void _call_f_operator_eq__eq__c2425 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const QTextLength &arg1 = args.read<const QTextLength & > ();
  ret.write<bool > ((bool)((QTextLength *)cls)->operator== (arg1));
}

static qt_gsi::GenericMethod *_create_f_operator_eq__eq__c2425 ()
{
  return new qt_gsi::GenericMethod ("==", "@brief Method bool QTextLength::operator==(const QTextLength &other)\n", true, &_init_f_operator_eq__eq__c2425, &_call_f_operator_eq__eq__c2425);
}

// double QTextLength::rawValue()


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

static void _call_f_rawValue_c0 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<double > ((double)((QTextLength *)cls)->rawValue ());
}

static qt_gsi::GenericMethod *_create_f_rawValue_c0 ()
{
  return new qt_gsi::GenericMethod ("rawValue", "@brief Method double QTextLength::rawValue()\n", true, &_init_f_rawValue_c0, &_call_f_rawValue_c0);
}

// QTextLength::Type QTextLength::type()


static void _init_f_type_c0 (qt_gsi::GenericMethod *decl)
{
  decl->set_return<qt_gsi::Converter<QTextLength::Type>::target_type > ();
}

static void _call_f_type_c0 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<qt_gsi::Converter<QTextLength::Type>::target_type > ((qt_gsi::Converter<QTextLength::Type>::target_type)qt_gsi::CppToQtAdaptor<QTextLength::Type>(((QTextLength *)cls)->type ()));
}

static qt_gsi::GenericMethod *_create_f_type_c0 ()
{
  return new qt_gsi::GenericMethod ("type", "@brief Method QTextLength::Type QTextLength::type()\n", true, &_init_f_type_c0, &_call_f_type_c0);
}

// double QTextLength::value(double maximumLength)


static void _init_f_value_c1071 (qt_gsi::GenericMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("maximumLength");
  decl->add_arg<double > (argspec_0);
  decl->set_return<double > ();
}

static void _call_f_value_c1071 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  double arg1 = args.read<double > ();
  ret.write<double > ((double)((QTextLength *)cls)->value (arg1));
}

static qt_gsi::GenericMethod *_create_f_value_c1071 ()
{
  return new qt_gsi::GenericMethod ("value", "@brief Method double QTextLength::value(double maximumLength)\n", true, &_init_f_value_c1071, &_call_f_value_c1071);
}


namespace gsi
{
gsi::Class<QTextLength> decl_QTextLength ("QTextLength",
  gsi::Methods(_create_ctor_QTextLength_0 ()) +
  gsi::Methods(_create_ctor_QTextLength_3045 ()) +
  gsi::Methods(_create_f_operator_excl__eq__c2425 ()) +
  gsi::Methods(_create_f_operator_eq__eq__c2425 ()) +
  gsi::Methods(_create_f_rawValue_c0 ()) +
  gsi::Methods(_create_f_type_c0 ()) +
  gsi::Methods(_create_f_value_c1071 ()),
  "@qt\n@brief Binding of QTextLength");

}


//  Implementation of the enum wrapper class for QTextLength::Type
namespace qt_gsi
{

static QTextLength_Type_Enum *c_1_QTextLength_Type_Enum () { return new QTextLength_Type_Enum (QTextLength::VariableLength); }
static QTextLength_Type_Enum *c_2_QTextLength_Type_Enum () { return new QTextLength_Type_Enum (QTextLength::FixedLength); }
static QTextLength_Type_Enum *c_3_QTextLength_Type_Enum () { return new QTextLength_Type_Enum (QTextLength::PercentageLength); }

static gsi::Methods mkdefs_QTextLength_Type () {
  return
    gsi::constant ("VariableLength", &qt_gsi::c_1_QTextLength_Type_Enum, "@brief Enum constant QTextLength::VariableLength") +
    gsi::constant ("FixedLength", &qt_gsi::c_2_QTextLength_Type_Enum, "@brief Enum constant QTextLength::FixedLength") +
    gsi::constant ("PercentageLength", &qt_gsi::c_3_QTextLength_Type_Enum, "@brief Enum constant QTextLength::PercentageLength");
}

static std::string to_s_QTextLength_Type_Enum (const QTextLength_Type_Enum *e)
{
  if (e->value () == QTextLength::VariableLength) { return tl::sprintf ("VariableLength (%u)", (unsigned int) e->value ()); }
  if (e->value () == QTextLength::FixedLength) { return tl::sprintf ("FixedLength (%u)", (unsigned int) e->value ()); }
  if (e->value () == QTextLength::PercentageLength) { return tl::sprintf ("PercentageLength (%u)", (unsigned int) e->value ()); }
  return std::string ("(not a valid enum evalue)");
}

static unsigned int to_i_QTextLength_Type_Enum (const QTextLength_Type_Enum *e)
{
  return (unsigned int) e->value ();
}

static QTextLength_Type_Enum *from_i_QTextLength_Type_Enum (unsigned int i)
{
  return new QTextLength_Type_Enum ((QTextLength::Type) i);
}

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

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

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

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

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

static std::string to_s_QTextLength_Type_Enums (const QTextLength_Type_Enums *e)
{
  std::string l;
  if (e->testFlag (QTextLength::VariableLength)) { if (!l.empty ()) l += "|"; l += "VariableLength"; }
  if (e->testFlag (QTextLength::FixedLength)) { if (!l.empty ()) l += "|"; l += "FixedLength"; }
  if (e->testFlag (QTextLength::PercentageLength)) { if (!l.empty ()) l += "|"; l += "PercentageLength"; }
  return tl::sprintf ("%u (%s)", (unsigned int) (e->flags ()), l);
}

static int to_i_QTextLength_Type_Enums (const QTextLength_Type_Enums *e)
{
  return int (e->flags ());
}

static bool testFlag_QTextLength_Type_Enums (const QTextLength_Type_Enums *e, const QTextLength_Type_Enum &d)
{
  return e->flags ().testFlag (d.value ());
}

}

namespace gsi
{

//  Declarations for QFlags<enum> wrapper class
gsi::Class<qt_gsi::QTextLength_Type_Enums> decl_QTextLength_Type_Enums ("QTextLength_QFlags_Type",
  gsi::method_ext ("|", &qt_gsi::oropQTextLength_Type_Enums, gsi::arg ("other"), "@brief 'or' operator between two flag sets") +
  gsi::method_ext ("&", &qt_gsi::andopQTextLength_Type_Enums, gsi::arg ("other"), "@brief 'and' operator between two flag sets") +
  gsi::method_ext ("^", &qt_gsi::xoropQTextLength_Type_Enums, gsi::arg ("other"), "@brief 'xor' operator between two flag sets") +
  gsi::method_ext ("to_s|inspect", &qt_gsi::to_s_QTextLength_Type_Enums, "@brief Converts the flag set to a string") +
  gsi::method_ext ("to_i", &qt_gsi::to_i_QTextLength_Type_Enums, "@brief Returns the integer value encoding the flag set") +
  gsi::method_ext ("testFlag", &qt_gsi::testFlag_QTextLength_Type_Enums, gsi::arg ("flag"), "@brief Tests whether the flag is contained in the flag set"),
  "@qt\n@brief This class represents the QFlags<QTextLength::Type> flag set");

//  Declarations for enum wrapper class
gsi::Class<qt_gsi::QTextLength_Type_Enum> decl_QTextLength_Type_Enum (decl_QTextLength_Type_Enums, "QTextLength_Type",
  qt_gsi::mkdefs_QTextLength_Type () +
  gsi::method_ext ("to_s|inspect", &qt_gsi::to_s_QTextLength_Type_Enum, "@brief Converts the enum class to a string") +
  gsi::method_ext ("to_i", &qt_gsi::to_i_QTextLength_Type_Enum, "@brief Converts the enum class to an integer") +
  gsi::method_ext ("==", &qt_gsi::equalQTextLength_Type_Enum, gsi::arg ("other"), "@brief Compares the enum class against an enum of it's own type") +
  gsi::method_ext ("==", &qt_gsi::equal2QTextLength_Type_Enum, gsi::arg ("other"), "@brief Compares the enum class against an integer") +
  gsi::constructor ("new", &qt_gsi::from_i_QTextLength_Type_Enum, gsi::arg ("value"), "@brief Creates the enum object from an integer"),
  "@qt\n@brief This class represents the QTextLength::Type enum");

//  Inject the declarations into the parent
static gsi::ClassExt<QTextLength> inject_QTextLength_Type_Enum_in_parent (qt_gsi::mkdefs_QTextLength_Type ());
static gsi::ClassExt<QTextLength> decl_QTextLength_Type_Enum_as_child (decl_QTextLength_Type_Enum, "Type");

}

