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


#include <glibmm.h>

#include <atkmm/hyperlink.h>
#include <atkmm/private/hyperlink_p.h>


// -*- c++ -*-
/* $Id: hyperlink.ccg,v 1.1 2004/01/02 09:56:43 murrayc Exp $ */

/* Copyright 2003 The gtkmm 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, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <atkmm/object.h>
#include <atk/atkobject.h>
#include <atk/atkhyperlink.h>


namespace Atk
{

} // namespace Atk


namespace
{


static const Glib::SignalProxyInfo Hyperlink_signal_link_activated_info =
{
  "link_activated",
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};


} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Atk::Hyperlink> wrap(AtkHyperlink* object, bool take_copy)
{
  return Glib::make_refptr_for_instance<Atk::Hyperlink>( dynamic_cast<Atk::Hyperlink*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */


namespace Atk
{


/* The *_Class implementation: */

const Glib::Class& Hyperlink_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &Hyperlink_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(atk_hyperlink_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:
  Action::add_interface(get_type());

  }

  return *this;
}


void Hyperlink_Class::class_init_function(void* g_class, void* class_data)
{
  const auto klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);

  klass->get_uri = &get_uri_vfunc_callback;
  klass->get_object = &get_object_vfunc_callback;
  klass->get_end_index = &get_end_index_vfunc_callback;
  klass->get_start_index = &get_start_index_vfunc_callback;
  klass->is_valid = &is_valid_vfunc_callback;
  klass->get_n_anchors = &get_n_anchors_vfunc_callback;
  klass->link_state = &link_state_vfunc_callback;
  klass->is_selected_link = &is_selected_link_vfunc_callback;

  klass->link_activated = &link_activated_callback;
}

gchar* Hyperlink_Class::get_uri_vfunc_callback(AtkHyperlink* self, gint i)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return obj->get_uri_vfunc(i
);
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
  );

  // Call the original underlying C function:
  if(base && base->get_uri)
    return (*base->get_uri)(self, i);

  using RType = gchar*;
  return RType();
}
AtkObject* Hyperlink_Class::get_object_vfunc_callback(AtkHyperlink* self, gint i)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return Glib::unwrap(obj->get_object_vfunc(i
));
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
  );

  // Call the original underlying C function:
  if(base && base->get_object)
    return (*base->get_object)(self, i);

  using RType = AtkObject*;
  return RType();
}
gint Hyperlink_Class::get_end_index_vfunc_callback(AtkHyperlink* self)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return obj->get_end_index_vfunc();
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
  );

  // Call the original underlying C function:
  if(base && base->get_end_index)
    return (*base->get_end_index)(self);

  using RType = gint;
  return RType();
}
gint Hyperlink_Class::get_start_index_vfunc_callback(AtkHyperlink* self)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return obj->get_start_index_vfunc();
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
  );

  // Call the original underlying C function:
  if(base && base->get_start_index)
    return (*base->get_start_index)(self);

  using RType = gint;
  return RType();
}
gboolean Hyperlink_Class::is_valid_vfunc_callback(AtkHyperlink* self)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return static_cast<int>(obj->is_valid_vfunc());
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
  );

  // Call the original underlying C function:
  if(base && base->is_valid)
    return (*base->is_valid)(self);

  using RType = gboolean;
  return RType();
}
gint Hyperlink_Class::get_n_anchors_vfunc_callback(AtkHyperlink* self)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return obj->get_n_anchors_vfunc();
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
  );

  // Call the original underlying C function:
  if(base && base->get_n_anchors)
    return (*base->get_n_anchors)(self);

  using RType = gint;
  return RType();
}
guint Hyperlink_Class::link_state_vfunc_callback(AtkHyperlink* self)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return obj->link_state_vfunc();
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
  );

  // Call the original underlying C function:
  if(base && base->link_state)
    return (*base->link_state)(self);

  using RType = guint;
  return RType();
}
gboolean Hyperlink_Class::is_selected_link_vfunc_callback(AtkHyperlink* self)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return static_cast<int>(obj->is_selected_link_vfunc());
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
  );

  // Call the original underlying C function:
  if(base && base->is_selected_link)
    return (*base->is_selected_link)(self);

  using RType = gboolean;
  return RType();
}

void Hyperlink_Class::link_activated_callback(AtkHyperlink* self)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        obj->on_link_activated();
        return;
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  const auto base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->link_activated)
    (*base->link_activated)(self);
}


Glib::ObjectBase* Hyperlink_Class::wrap_new(GObject* object)
{
  return new Hyperlink((AtkHyperlink*)object);
}


/* The implementation: */

AtkHyperlink* Hyperlink::gobj_copy()
{
  reference();
  return gobj();
}

Hyperlink::Hyperlink(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{

}

Hyperlink::Hyperlink(AtkHyperlink* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


Hyperlink::Hyperlink(Hyperlink&& src) noexcept
: Glib::Object(std::move(src))
  , Action(std::move(src))
{}

Hyperlink& Hyperlink::operator=(Hyperlink&& src) noexcept
{
  Glib::Object::operator=(std::move(src));
  Action::operator=(std::move(src));
  return *this;
}


Hyperlink::~Hyperlink() noexcept
{}


Hyperlink::CppClassType Hyperlink::hyperlink_class_; // initialize static member

GType Hyperlink::get_type()
{
  return hyperlink_class_.init().get_type();
}


GType Hyperlink::get_base_type()
{
  return atk_hyperlink_get_type();
}


Glib::ustring Hyperlink::get_uri(int i) const
{
  return Glib::convert_return_gchar_ptr_to_ustring(atk_hyperlink_get_uri(const_cast<AtkHyperlink*>(gobj()), i));
}

Glib::RefPtr<Atk::Object> Hyperlink::get_object(int i)
{
  auto retvalue = Glib::wrap(atk_hyperlink_get_object(gobj(), i));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Atk::Object> Hyperlink::get_object(int i) const
{
  return const_cast<Hyperlink*>(this)->get_object(i);
}

int Hyperlink::get_end_index() const
{
  return atk_hyperlink_get_end_index(const_cast<AtkHyperlink*>(gobj()));
}

int Hyperlink::get_start_index() const
{
  return atk_hyperlink_get_start_index(const_cast<AtkHyperlink*>(gobj()));
}

bool Hyperlink::is_valid() const
{
  return atk_hyperlink_is_valid(const_cast<AtkHyperlink*>(gobj()));
}

bool Hyperlink::is_inline() const
{
  return atk_hyperlink_is_inline(const_cast<AtkHyperlink*>(gobj()));
}

int Hyperlink::get_n_anchors() const
{
  return atk_hyperlink_get_n_anchors(const_cast<AtkHyperlink*>(gobj()));
}


Glib::SignalProxy<void()> Hyperlink::signal_link_activated()
{
  return Glib::SignalProxy<void() >(this, &Hyperlink_signal_link_activated_info);
}


Glib::PropertyProxy_ReadOnly< bool > Hyperlink::property_selected_link() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "selected-link");
}

Glib::PropertyProxy_ReadOnly< int > Hyperlink::property_number_of_anchors() const
{
  return Glib::PropertyProxy_ReadOnly< int >(this, "number-of-anchors");
}

Glib::PropertyProxy_ReadOnly< int > Hyperlink::property_end_index() const
{
  return Glib::PropertyProxy_ReadOnly< int >(this, "end-index");
}

Glib::PropertyProxy_ReadOnly< int > Hyperlink::property_start_index() const
{
  return Glib::PropertyProxy_ReadOnly< int >(this, "start-index");
}


void Atk::Hyperlink::on_link_activated()
{
  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->link_activated)
    (*base->link_activated)(gobj());
}

gchar* Atk::Hyperlink::get_uri_vfunc(int i) const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->get_uri)
  {
    gchar* retval((*base->get_uri)(const_cast<AtkHyperlink*>(gobj()),i));
    return retval;
  }

  using RType = gchar*;
  return RType();
}
Glib::RefPtr<Atk::Object> Atk::Hyperlink::get_object_vfunc(int i) 
{
  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->get_object)
  {
    Glib::RefPtr<Atk::Object> retval(Glib::wrap((*base->get_object)(gobj(),i)));
    return retval;
  }

  using RType = Glib::RefPtr<Atk::Object>;
  return RType();
}
int Atk::Hyperlink::get_end_index_vfunc() const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->get_end_index)
  {
    int retval((*base->get_end_index)(const_cast<AtkHyperlink*>(gobj())));
    return retval;
  }

  using RType = int;
  return RType();
}
int Atk::Hyperlink::get_start_index_vfunc() const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->get_start_index)
  {
    int retval((*base->get_start_index)(const_cast<AtkHyperlink*>(gobj())));
    return retval;
  }

  using RType = int;
  return RType();
}
bool Atk::Hyperlink::is_valid_vfunc() const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->is_valid)
  {
    bool retval((*base->is_valid)(const_cast<AtkHyperlink*>(gobj())));
    return retval;
  }

  using RType = bool;
  return RType();
}
int Atk::Hyperlink::get_n_anchors_vfunc() const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->get_n_anchors)
  {
    int retval((*base->get_n_anchors)(const_cast<AtkHyperlink*>(gobj())));
    return retval;
  }

  using RType = int;
  return RType();
}
guint Atk::Hyperlink::link_state_vfunc() const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->link_state)
  {
    guint retval((*base->link_state)(const_cast<AtkHyperlink*>(gobj())));
    return retval;
  }

  using RType = guint;
  return RType();
}
bool Atk::Hyperlink::is_selected_link_vfunc() const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->is_selected_link)
  {
    bool retval((*base->is_selected_link)(const_cast<AtkHyperlink*>(gobj())));
    return retval;
  }

  using RType = bool;
  return RType();
}


} // namespace Atk


