
/*

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

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

// -----------------------------------------------------------------------
// class QDesktopServices

//  Constructor QDesktopServices::QDesktopServices()


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

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

static qt_gsi::GenericStaticMethod *_create_ctor_QDesktopServices_0 ()
{
  return new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QDesktopServices::QDesktopServices()\nThis method creates an object of class QDesktopServices.", &_init_ctor_QDesktopServices_0, &_call_ctor_QDesktopServices_0);
}

// static QString QDesktopServices::displayName(QDesktopServices::StandardLocation type)


static void _init_f_displayName_3841 (qt_gsi::GenericStaticMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("type");
  decl->add_arg<const qt_gsi::Converter<QDesktopServices::StandardLocation>::target_type & > (argspec_0);
  decl->set_return<QString > ();
}

static void _call_f_displayName_3841 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const qt_gsi::Converter<QDesktopServices::StandardLocation>::target_type & arg1 = args.read<const qt_gsi::Converter<QDesktopServices::StandardLocation>::target_type & > ();
  ret.write<QString > ((QString)QDesktopServices::displayName (qt_gsi::QtToCppAdaptor<QDesktopServices::StandardLocation>(arg1).cref()));
}

static qt_gsi::GenericStaticMethod *_create_f_displayName_3841 ()
{
  return new qt_gsi::GenericStaticMethod ("displayName", "@brief Static method QString QDesktopServices::displayName(QDesktopServices::StandardLocation type)\nThis method is static and can be called without an instance.", &_init_f_displayName_3841, &_call_f_displayName_3841);
}

// static bool QDesktopServices::openUrl(const QUrl &url)


static void _init_f_openUrl_1701 (qt_gsi::GenericStaticMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("url");
  decl->add_arg<const QUrl & > (argspec_0);
  decl->set_return<bool > ();
}

static void _call_f_openUrl_1701 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const QUrl &arg1 = args.read<const QUrl & > ();
  ret.write<bool > ((bool)QDesktopServices::openUrl (arg1));
}

static qt_gsi::GenericStaticMethod *_create_f_openUrl_1701 ()
{
  return new qt_gsi::GenericStaticMethod ("openUrl", "@brief Static method bool QDesktopServices::openUrl(const QUrl &url)\nThis method is static and can be called without an instance.", &_init_f_openUrl_1701, &_call_f_openUrl_1701);
}

// static void QDesktopServices::setUrlHandler(const QString &scheme, QObject *receiver, const char *method)


static void _init_f_setUrlHandler_4842 (qt_gsi::GenericStaticMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("scheme");
  decl->add_arg<const QString & > (argspec_0);
  static gsi::ArgSpecBase argspec_1 ("receiver");
  decl->add_arg<QObject * > (argspec_1);
  static gsi::ArgSpecBase argspec_2 ("method");
  decl->add_arg<const char * > (argspec_2);
  decl->set_return<void > ();
}

static void _call_f_setUrlHandler_4842 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const QString &arg1 = args.read<const QString & > ();
  QObject *arg2 = args.read<QObject * > ();
  const char *arg3 = args.read<const char * > ();
  QDesktopServices::setUrlHandler (arg1, arg2, arg3);
}

static qt_gsi::GenericStaticMethod *_create_f_setUrlHandler_4842 ()
{
  return new qt_gsi::GenericStaticMethod ("setUrlHandler", "@brief Static method void QDesktopServices::setUrlHandler(const QString &scheme, QObject *receiver, const char *method)\nThis method is static and can be called without an instance.", &_init_f_setUrlHandler_4842, &_call_f_setUrlHandler_4842);
}

// static QString QDesktopServices::storageLocation(QDesktopServices::StandardLocation type)


static void _init_f_storageLocation_3841 (qt_gsi::GenericStaticMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("type");
  decl->add_arg<const qt_gsi::Converter<QDesktopServices::StandardLocation>::target_type & > (argspec_0);
  decl->set_return<QString > ();
}

static void _call_f_storageLocation_3841 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const qt_gsi::Converter<QDesktopServices::StandardLocation>::target_type & arg1 = args.read<const qt_gsi::Converter<QDesktopServices::StandardLocation>::target_type & > ();
  ret.write<QString > ((QString)QDesktopServices::storageLocation (qt_gsi::QtToCppAdaptor<QDesktopServices::StandardLocation>(arg1).cref()));
}

static qt_gsi::GenericStaticMethod *_create_f_storageLocation_3841 ()
{
  return new qt_gsi::GenericStaticMethod ("storageLocation", "@brief Static method QString QDesktopServices::storageLocation(QDesktopServices::StandardLocation type)\nThis method is static and can be called without an instance.", &_init_f_storageLocation_3841, &_call_f_storageLocation_3841);
}

// static void QDesktopServices::unsetUrlHandler(const QString &scheme)


static void _init_f_unsetUrlHandler_2025 (qt_gsi::GenericStaticMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("scheme");
  decl->add_arg<const QString & > (argspec_0);
  decl->set_return<void > ();
}

static void _call_f_unsetUrlHandler_2025 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const QString &arg1 = args.read<const QString & > ();
  QDesktopServices::unsetUrlHandler (arg1);
}

static qt_gsi::GenericStaticMethod *_create_f_unsetUrlHandler_2025 ()
{
  return new qt_gsi::GenericStaticMethod ("unsetUrlHandler", "@brief Static method void QDesktopServices::unsetUrlHandler(const QString &scheme)\nThis method is static and can be called without an instance.", &_init_f_unsetUrlHandler_2025, &_call_f_unsetUrlHandler_2025);
}


namespace gsi
{
gsi::Class<QDesktopServices> decl_QDesktopServices ("QDesktopServices",
  gsi::Methods(_create_ctor_QDesktopServices_0 ()) +
  gsi::Methods(_create_f_displayName_3841 ()) +
  gsi::Methods(_create_f_openUrl_1701 ()) +
  gsi::Methods(_create_f_setUrlHandler_4842 ()) +
  gsi::Methods(_create_f_storageLocation_3841 ()) +
  gsi::Methods(_create_f_unsetUrlHandler_2025 ()),
  "@qt\n@brief Binding of QDesktopServices");

}


//  Implementation of the enum wrapper class for QDesktopServices::StandardLocation
namespace qt_gsi
{

static QDesktopServices_StandardLocation_Enum *c_1_QDesktopServices_StandardLocation_Enum () { return new QDesktopServices_StandardLocation_Enum (QDesktopServices::DesktopLocation); }
static QDesktopServices_StandardLocation_Enum *c_2_QDesktopServices_StandardLocation_Enum () { return new QDesktopServices_StandardLocation_Enum (QDesktopServices::DocumentsLocation); }
static QDesktopServices_StandardLocation_Enum *c_3_QDesktopServices_StandardLocation_Enum () { return new QDesktopServices_StandardLocation_Enum (QDesktopServices::FontsLocation); }
static QDesktopServices_StandardLocation_Enum *c_4_QDesktopServices_StandardLocation_Enum () { return new QDesktopServices_StandardLocation_Enum (QDesktopServices::ApplicationsLocation); }
static QDesktopServices_StandardLocation_Enum *c_5_QDesktopServices_StandardLocation_Enum () { return new QDesktopServices_StandardLocation_Enum (QDesktopServices::MusicLocation); }
static QDesktopServices_StandardLocation_Enum *c_6_QDesktopServices_StandardLocation_Enum () { return new QDesktopServices_StandardLocation_Enum (QDesktopServices::MoviesLocation); }
static QDesktopServices_StandardLocation_Enum *c_7_QDesktopServices_StandardLocation_Enum () { return new QDesktopServices_StandardLocation_Enum (QDesktopServices::PicturesLocation); }
static QDesktopServices_StandardLocation_Enum *c_8_QDesktopServices_StandardLocation_Enum () { return new QDesktopServices_StandardLocation_Enum (QDesktopServices::TempLocation); }
static QDesktopServices_StandardLocation_Enum *c_9_QDesktopServices_StandardLocation_Enum () { return new QDesktopServices_StandardLocation_Enum (QDesktopServices::HomeLocation); }
static QDesktopServices_StandardLocation_Enum *c_10_QDesktopServices_StandardLocation_Enum () { return new QDesktopServices_StandardLocation_Enum (QDesktopServices::DataLocation); }
static QDesktopServices_StandardLocation_Enum *c_11_QDesktopServices_StandardLocation_Enum () { return new QDesktopServices_StandardLocation_Enum (QDesktopServices::CacheLocation); }

static gsi::Methods mkdefs_QDesktopServices_StandardLocation () {
  return
    gsi::constant ("DesktopLocation", &qt_gsi::c_1_QDesktopServices_StandardLocation_Enum, "@brief Enum constant QDesktopServices::DesktopLocation") +
    gsi::constant ("DocumentsLocation", &qt_gsi::c_2_QDesktopServices_StandardLocation_Enum, "@brief Enum constant QDesktopServices::DocumentsLocation") +
    gsi::constant ("FontsLocation", &qt_gsi::c_3_QDesktopServices_StandardLocation_Enum, "@brief Enum constant QDesktopServices::FontsLocation") +
    gsi::constant ("ApplicationsLocation", &qt_gsi::c_4_QDesktopServices_StandardLocation_Enum, "@brief Enum constant QDesktopServices::ApplicationsLocation") +
    gsi::constant ("MusicLocation", &qt_gsi::c_5_QDesktopServices_StandardLocation_Enum, "@brief Enum constant QDesktopServices::MusicLocation") +
    gsi::constant ("MoviesLocation", &qt_gsi::c_6_QDesktopServices_StandardLocation_Enum, "@brief Enum constant QDesktopServices::MoviesLocation") +
    gsi::constant ("PicturesLocation", &qt_gsi::c_7_QDesktopServices_StandardLocation_Enum, "@brief Enum constant QDesktopServices::PicturesLocation") +
    gsi::constant ("TempLocation", &qt_gsi::c_8_QDesktopServices_StandardLocation_Enum, "@brief Enum constant QDesktopServices::TempLocation") +
    gsi::constant ("HomeLocation", &qt_gsi::c_9_QDesktopServices_StandardLocation_Enum, "@brief Enum constant QDesktopServices::HomeLocation") +
    gsi::constant ("DataLocation", &qt_gsi::c_10_QDesktopServices_StandardLocation_Enum, "@brief Enum constant QDesktopServices::DataLocation") +
    gsi::constant ("CacheLocation", &qt_gsi::c_11_QDesktopServices_StandardLocation_Enum, "@brief Enum constant QDesktopServices::CacheLocation");
}

static std::string to_s_QDesktopServices_StandardLocation_Enum (const QDesktopServices_StandardLocation_Enum *e)
{
  if (e->value () == QDesktopServices::DesktopLocation) { return tl::sprintf ("DesktopLocation (%u)", (unsigned int) e->value ()); }
  if (e->value () == QDesktopServices::DocumentsLocation) { return tl::sprintf ("DocumentsLocation (%u)", (unsigned int) e->value ()); }
  if (e->value () == QDesktopServices::FontsLocation) { return tl::sprintf ("FontsLocation (%u)", (unsigned int) e->value ()); }
  if (e->value () == QDesktopServices::ApplicationsLocation) { return tl::sprintf ("ApplicationsLocation (%u)", (unsigned int) e->value ()); }
  if (e->value () == QDesktopServices::MusicLocation) { return tl::sprintf ("MusicLocation (%u)", (unsigned int) e->value ()); }
  if (e->value () == QDesktopServices::MoviesLocation) { return tl::sprintf ("MoviesLocation (%u)", (unsigned int) e->value ()); }
  if (e->value () == QDesktopServices::PicturesLocation) { return tl::sprintf ("PicturesLocation (%u)", (unsigned int) e->value ()); }
  if (e->value () == QDesktopServices::TempLocation) { return tl::sprintf ("TempLocation (%u)", (unsigned int) e->value ()); }
  if (e->value () == QDesktopServices::HomeLocation) { return tl::sprintf ("HomeLocation (%u)", (unsigned int) e->value ()); }
  if (e->value () == QDesktopServices::DataLocation) { return tl::sprintf ("DataLocation (%u)", (unsigned int) e->value ()); }
  if (e->value () == QDesktopServices::CacheLocation) { return tl::sprintf ("CacheLocation (%u)", (unsigned int) e->value ()); }
  return std::string ("(not a valid enum evalue)");
}

static unsigned int to_i_QDesktopServices_StandardLocation_Enum (const QDesktopServices_StandardLocation_Enum *e)
{
  return (unsigned int) e->value ();
}

static QDesktopServices_StandardLocation_Enum *from_i_QDesktopServices_StandardLocation_Enum (unsigned int i)
{
  return new QDesktopServices_StandardLocation_Enum ((QDesktopServices::StandardLocation) i);
}

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

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

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

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

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

static std::string to_s_QDesktopServices_StandardLocation_Enums (const QDesktopServices_StandardLocation_Enums *e)
{
  std::string l;
  if (e->testFlag (QDesktopServices::DesktopLocation)) { if (!l.empty ()) l += "|"; l += "DesktopLocation"; }
  if (e->testFlag (QDesktopServices::DocumentsLocation)) { if (!l.empty ()) l += "|"; l += "DocumentsLocation"; }
  if (e->testFlag (QDesktopServices::FontsLocation)) { if (!l.empty ()) l += "|"; l += "FontsLocation"; }
  if (e->testFlag (QDesktopServices::ApplicationsLocation)) { if (!l.empty ()) l += "|"; l += "ApplicationsLocation"; }
  if (e->testFlag (QDesktopServices::MusicLocation)) { if (!l.empty ()) l += "|"; l += "MusicLocation"; }
  if (e->testFlag (QDesktopServices::MoviesLocation)) { if (!l.empty ()) l += "|"; l += "MoviesLocation"; }
  if (e->testFlag (QDesktopServices::PicturesLocation)) { if (!l.empty ()) l += "|"; l += "PicturesLocation"; }
  if (e->testFlag (QDesktopServices::TempLocation)) { if (!l.empty ()) l += "|"; l += "TempLocation"; }
  if (e->testFlag (QDesktopServices::HomeLocation)) { if (!l.empty ()) l += "|"; l += "HomeLocation"; }
  if (e->testFlag (QDesktopServices::DataLocation)) { if (!l.empty ()) l += "|"; l += "DataLocation"; }
  if (e->testFlag (QDesktopServices::CacheLocation)) { if (!l.empty ()) l += "|"; l += "CacheLocation"; }
  return tl::sprintf ("%u (%s)", (unsigned int) (e->flags ()), l);
}

static int to_i_QDesktopServices_StandardLocation_Enums (const QDesktopServices_StandardLocation_Enums *e)
{
  return int (e->flags ());
}

static bool testFlag_QDesktopServices_StandardLocation_Enums (const QDesktopServices_StandardLocation_Enums *e, const QDesktopServices_StandardLocation_Enum &d)
{
  return e->flags ().testFlag (d.value ());
}

}

namespace gsi
{

//  Declarations for QFlags<enum> wrapper class
gsi::Class<qt_gsi::QDesktopServices_StandardLocation_Enums> decl_QDesktopServices_StandardLocation_Enums ("QDesktopServices_QFlags_StandardLocation",
  gsi::method_ext ("|", &qt_gsi::oropQDesktopServices_StandardLocation_Enums, gsi::arg ("other"), "@brief 'or' operator between two flag sets") +
  gsi::method_ext ("&", &qt_gsi::andopQDesktopServices_StandardLocation_Enums, gsi::arg ("other"), "@brief 'and' operator between two flag sets") +
  gsi::method_ext ("^", &qt_gsi::xoropQDesktopServices_StandardLocation_Enums, gsi::arg ("other"), "@brief 'xor' operator between two flag sets") +
  gsi::method_ext ("to_s|inspect", &qt_gsi::to_s_QDesktopServices_StandardLocation_Enums, "@brief Converts the flag set to a string") +
  gsi::method_ext ("to_i", &qt_gsi::to_i_QDesktopServices_StandardLocation_Enums, "@brief Returns the integer value encoding the flag set") +
  gsi::method_ext ("testFlag", &qt_gsi::testFlag_QDesktopServices_StandardLocation_Enums, gsi::arg ("flag"), "@brief Tests whether the flag is contained in the flag set"),
  "@qt\n@brief This class represents the QFlags<QDesktopServices::StandardLocation> flag set");

//  Declarations for enum wrapper class
gsi::Class<qt_gsi::QDesktopServices_StandardLocation_Enum> decl_QDesktopServices_StandardLocation_Enum (decl_QDesktopServices_StandardLocation_Enums, "QDesktopServices_StandardLocation",
  qt_gsi::mkdefs_QDesktopServices_StandardLocation () +
  gsi::method_ext ("to_s|inspect", &qt_gsi::to_s_QDesktopServices_StandardLocation_Enum, "@brief Converts the enum class to a string") +
  gsi::method_ext ("to_i", &qt_gsi::to_i_QDesktopServices_StandardLocation_Enum, "@brief Converts the enum class to an integer") +
  gsi::method_ext ("==", &qt_gsi::equalQDesktopServices_StandardLocation_Enum, gsi::arg ("other"), "@brief Compares the enum class against an enum of it's own type") +
  gsi::method_ext ("==", &qt_gsi::equal2QDesktopServices_StandardLocation_Enum, gsi::arg ("other"), "@brief Compares the enum class against an integer") +
  gsi::constructor ("new", &qt_gsi::from_i_QDesktopServices_StandardLocation_Enum, gsi::arg ("value"), "@brief Creates the enum object from an integer"),
  "@qt\n@brief This class represents the QDesktopServices::StandardLocation enum");

//  Inject the declarations into the parent
static gsi::ClassExt<QDesktopServices> inject_QDesktopServices_StandardLocation_Enum_in_parent (qt_gsi::mkdefs_QDesktopServices_StandardLocation ());
static gsi::ClassExt<QDesktopServices> decl_QDesktopServices_StandardLocation_Enum_as_child (decl_QDesktopServices_StandardLocation_Enum, "StandardLocation");

}

