// Generated by gmmproc 2.77.0 -- DO NOT MODIFY!


#include <glibmm.h>

#include <glibmm/timezone.h>
#include <glibmm/private/timezone_p.h>


/* Copyright (C) 2011 The glibmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glibmm/utility.h>

namespace Glib
{

TimeZone::operator bool() const
{
  return gobject_ != nullptr;
}

} // namespace Glib

namespace
{
} // anonymous namespace


namespace Glib
{

Glib::TimeZone wrap(GTimeZone* object, bool take_copy)
{
  return Glib::TimeZone(object, take_copy);
}

} // namespace Glib


namespace Glib
{


// static
GType TimeZone::get_type()
{
  return g_time_zone_get_type();
}

TimeZone::TimeZone()
:
  gobject_ (nullptr) // Allows creation of invalid wrapper, e.g. for output arguments to methods.
{}

TimeZone::TimeZone(const TimeZone& other)
:
  gobject_ ((other.gobject_) ? g_time_zone_ref(other.gobject_) : nullptr)
{}

TimeZone::TimeZone(TimeZone&& other) noexcept
:
  gobject_(other.gobject_)
{
  other.gobject_ = nullptr;
}

TimeZone& TimeZone::operator=(TimeZone&& other) noexcept
{
  TimeZone temp (std::move(other));
  swap(temp);
  return *this;
}

TimeZone::TimeZone(GTimeZone* gobject, bool make_a_copy)
:
  // For BoxedType wrappers, make_a_copy is true by default.  The static
  // BoxedType wrappers must always take a copy, thus make_a_copy = true
  // ensures identical behaviour if the default argument is used.
  gobject_ ((make_a_copy && gobject) ? g_time_zone_ref(gobject) : gobject)
{}

TimeZone& TimeZone::operator=(const TimeZone& other)
{
  TimeZone temp (other);
  swap(temp);
  return *this;
}

TimeZone::~TimeZone() noexcept
{
  if(gobject_)
    g_time_zone_unref(gobject_);
}

void TimeZone::swap(TimeZone& other) noexcept
{
  std::swap(gobject_, other.gobject_);
}

GTimeZone* TimeZone::gobj_copy() const
{
  return g_time_zone_ref(gobject_);
}


#ifndef GLIBMM_DISABLE_DEPRECATED
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
TimeZone TimeZone::create(const Glib::ustring& identifier)
{
  return Glib::wrap(g_time_zone_new(identifier.c_str()));
}
G_GNUC_END_IGNORE_DEPRECATIONS
#endif // GLIBMM_DISABLE_DEPRECATED

TimeZone TimeZone::create_identifier(const Glib::ustring& identifier)
{
  return Glib::wrap(g_time_zone_new_identifier(identifier.c_str()));
}

TimeZone TimeZone::create_local()
{
  return Glib::wrap(g_time_zone_new_local());
}

TimeZone TimeZone::create_utc()
{
  return Glib::wrap(g_time_zone_new_utc());
}

int TimeZone::find_interval(TimeType type, gint64 time) const
{
  return g_time_zone_find_interval(const_cast<GTimeZone*>(gobj()), static_cast<GTimeType>(type), time);
}

int TimeZone::adjust_time(TimeType type, gint64& time) const
{
  return g_time_zone_adjust_time(const_cast<GTimeZone*>(gobj()), static_cast<GTimeType>(type), &(time));
}

Glib::ustring TimeZone::get_abbreviation(int interval) const
{
  return Glib::convert_const_gchar_ptr_to_ustring(g_time_zone_get_abbreviation(const_cast<GTimeZone*>(gobj()), interval));
}

gint32 TimeZone::get_offset(int interval) const
{
  return g_time_zone_get_offset(const_cast<GTimeZone*>(gobj()), interval);
}

bool TimeZone::is_dst(int interval) const
{
  return g_time_zone_is_dst(const_cast<GTimeZone*>(gobj()), interval);
}

Glib::ustring TimeZone::get_identifier() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(g_time_zone_get_identifier(const_cast<GTimeZone*>(gobj())));
}


} // namespace Glib


