// Generated by gtkmmproc -- DO NOT MODIFY!


#include <libgdamm/providerinfo.h>
#include <libgdamm/private/providerinfo_p.h>

/* $Id: providerinfo.ccg,v 1.6 2006/10/21 14:40:28 murrayc Exp $ */
// -*- C++ -*- //

/* providerinfo.cc
 * 
 * Copyright 2003 libgdamm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <libgda/gda-parameter.h>
#include <libgda/gda-enum-types.h>

namespace Gnome
{

namespace Gda
{

Glib::RefPtr<ParameterList> ProviderInfo::get_gda_params()
{
  return Glib::wrap(gobj()->gda_params, true);
}

Glib::RefPtr<const ParameterList> ProviderInfo::get_gda_params() const
{
  return Glib::wrap(gobj()->gda_params, true);
}

} // namespace Gda


} // namespace Gnome


namespace
{
} // anonymous namespace


namespace Glib
{

Gnome::Gda::ProviderInfo wrap(GdaProviderInfo* object, bool take_copy /* = false */)
{
  return Gnome::Gda::ProviderInfo(object, take_copy);
}

} // namespace Glib


namespace Gnome
{

namespace Gda
{


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

ProviderInfo::ProviderInfo(const ProviderInfo& src)
:
  gobject_ ((src.gobject_) ? gda_provider_info_copy(src.gobject_) : 0)
{}

ProviderInfo::ProviderInfo(GdaProviderInfo* castitem, bool make_a_copy /* = false */)
{
  if(!make_a_copy)
  {
    // It was given to us by a function which has already made a copy for us to keep.
    gobject_ = castitem;
  }
  else
  {
    // We are probably getting it via direct access to a struct,
    // so we can not just take it - we have to take a copy of it.
    if(castitem)
      gobject_ = gda_provider_info_copy(castitem);
    else
      gobject_ = 0;
  }
}

ProviderInfo& ProviderInfo::operator=(const ProviderInfo& src)
{
  GdaProviderInfo *const new_gobject = (src.gobject_) ? gda_provider_info_copy(src.gobject_) : 0;

  if(gobject_)
    gda_provider_info_free(gobject_);

  gobject_ = new_gobject;

  return *this;
}

ProviderInfo::~ProviderInfo()
{
  if(gobject_)
    gda_provider_info_free(gobject_);
}

GdaProviderInfo* ProviderInfo::gobj_copy() const
{
  return gda_provider_info_copy(gobject_);
}


 Glib::ustring ProviderInfo::get_id() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gobj()->id);
}
 
 Glib::ustring ProviderInfo::get_location() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gobj()->location);
}
 
 Glib::ustring ProviderInfo::get_description() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gobj()->description);
}
 

} // namespace Gda

} // namespace Gnome


