// -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _LIBGDAMM_DICTTYPE_H
#define _LIBGDAMM_DICTTYPE_H


#include <glibmm.h>

/* $Id: dicttype.hg,v 1.2 2006/11/08 00:07:37 murrayc Exp $ */
// -*- C++ -*- // this is for the .hg, I realize gensig puts one in

/* dicttype.h
 *
 * Copyright 2006 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 <libgdamm/object.h>
#include <libgdamm/xmlstorage.h>


#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GdaDictType GdaDictType;
typedef struct _GdaDictTypeClass GdaDictTypeClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace Gda
{ class DictType_Class; } // namespace Gda

} // namespace Gnome
namespace Gnome
{

namespace Gda
{

class Connection;

/** Represents a data type in the DBMS.
 * DBMS systems usually have a large set of data types (which can sometimes be expanded by users). Each DictType 
 * object represents one data type. The libgda library provides some data types, and so it is possible, for each 
 * DictType object, to get the corresponding libgda data type.
 *
 * Every data type can be represented by a DictType (even user defined data types). Complex data types (data types 
 * described as the aggregation of several other data types, similar to C structures) are handled like any other data 
 * type and it is not possible to individually access the different components of the complex data type (it is, however, 
 * possible to write a plugin for this data type). 
 * 
 * @ingroup Dictionaries.
 */

class DictType
: public Gda::Object,
  public XmlStorage
{
  
#ifndef DOXYGEN_SHOULD_SKIP_THIS

public:
  typedef DictType CppObjectType;
  typedef DictType_Class CppClassType;
  typedef GdaDictType BaseObjectType;
  typedef GdaDictTypeClass BaseClassType;

private:  friend class DictType_Class;
  static CppClassType dicttype_class_;

private:
  // noncopyable
  DictType(const DictType&);
  DictType& operator=(const DictType&);

protected:
  explicit DictType(const Glib::ConstructParams& construct_params);
  explicit DictType(GdaDictType* castitem);

#endif /* DOXYGEN_SHOULD_SKIP_THIS */

public:
  virtual ~DictType();

#ifndef DOXYGEN_SHOULD_SKIP_THIS
  static GType get_type()      G_GNUC_CONST;
  static GType get_base_type() G_GNUC_CONST;
#endif

  ///Provides access to the underlying C GObject.
  GdaDictType*       gobj()       { return reinterpret_cast<GdaDictType*>(gobject_); }

  ///Provides access to the underlying C GObject.
  const GdaDictType* gobj() const { return reinterpret_cast<GdaDictType*>(gobject_); }

  ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
  GdaDictType* gobj_copy();

private:

  
protected:

  DictType();

public:
  
  static Glib::RefPtr<DictType> create();


  /** Set the SQL name of the data type.
   */
  void set_sqlname(const Glib::ustring& sqlname);
  
  /** Get the DBMS's name of a data type.
   * @return The name of the data type.
   */
  Glib::ustring get_sqlname() const;

  
  /** Set the gda type for a data type
   */
  void set_g_type(GType g_type);
  
  /** Get the gda type of a data type
   * @return The gda type.
   */
  GType get_g_type() const;

  
  /** Sets a new synonym to the @a dt data type.
   */
  void add_synonym(const Glib::ustring& synonym);

   
  /** Get a list of @a dt's synonyms
   * @return A list of strings which must not be modified.
   */
  Glib::SListHandle<Glib::ustring> get_synonyms() const;

  
  /** Removes any synonym attached to @a dt
   */
  void clear_synonyms();

 //There are no properties, signals or vfuncs.


public:

public:
  //C++ methods used to invoke GTK+ virtual functions:
#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

protected:
  //GTK+ Virtual Functions (override these to change behaviour):
#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

  //Default Signal Handlers::
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED


};

} // namespace Gda
} // namespace Gnome


namespace Glib
{
  /** A Glib::wrap() method for this object.
   * 
   * @param object The C instance.
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
   * @result A C++ instance that wraps this C instance.
   *
   * @relates Gnome::Gda::DictType
   */
  Glib::RefPtr<Gnome::Gda::DictType> wrap(GdaDictType* object, bool take_copy = false);
}


#endif /* _LIBGDAMM_DICTTYPE_H */

