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


#include <glibmm.h>

// -*- C++ -*- // this is for the .hg, I realize gensig puts one in

/* renderer.h
 *
 * 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 <glibmm/interface.h>
#include <libgdamm/parameterlist.h>
#include <libgda/gda-renderer.h>


#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GdaRenderer GdaRenderer;
typedef struct _GdaRendererClass GdaRendererClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace Gda
{ class Renderer_Class; } // namespace Gda

} // namespace Gnome
namespace Gnome
{

namespace Gda
{

/** @addtogroup libgdammEnums Enums and Flags */

/**
 * @ingroup libgdammEnums
 * @par Bitwise operators:
 * <tt>%RendererOptions operator|(RendererOptions, RendererOptions)</tt><br>
 * <tt>%RendererOptions operator&(RendererOptions, RendererOptions)</tt><br>
 * <tt>%RendererOptions operator^(RendererOptions, RendererOptions)</tt><br>
 * <tt>%RendererOptions operator~(RendererOptions)</tt><br>
 * <tt>%RendererOptions& operator|=(RendererOptions&, RendererOptions)</tt><br>
 * <tt>%RendererOptions& operator&=(RendererOptions&, RendererOptions)</tt><br>
 * <tt>%RendererOptions& operator^=(RendererOptions&, RendererOptions)</tt><br>
 */
enum RendererOptions
{
  RENDERER_EXTRA_PRETTY_SQL = 1 << 0,
  RENDERER_PARAMS_AS_DETAILED = 1 << 1,
  RENDERER_ERROR_IF_DEFAULT = 1 << 2,
  RENDERER_FIELDS_NO_TARGET_ALIAS = 1 << 3,
  RENDERER_PARAMS_AS_COLON = 1 << 4,
  RENDERER_PARAMS_AS_DOLLAR = 1 << 5
};

/** @ingroup libgdammEnums */
inline RendererOptions operator|(RendererOptions lhs, RendererOptions rhs)
  { return static_cast<RendererOptions>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }

/** @ingroup libgdammEnums */
inline RendererOptions operator&(RendererOptions lhs, RendererOptions rhs)
  { return static_cast<RendererOptions>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }

/** @ingroup libgdammEnums */
inline RendererOptions operator^(RendererOptions lhs, RendererOptions rhs)
  { return static_cast<RendererOptions>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }

/** @ingroup libgdammEnums */
inline RendererOptions operator~(RendererOptions flags)
  { return static_cast<RendererOptions>(~static_cast<unsigned>(flags)); }

/** @ingroup libgdammEnums */
inline RendererOptions& operator|=(RendererOptions& lhs, RendererOptions rhs)
  { return (lhs = static_cast<RendererOptions>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }

/** @ingroup libgdammEnums */
inline RendererOptions& operator&=(RendererOptions& lhs, RendererOptions rhs)
  { return (lhs = static_cast<RendererOptions>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }

/** @ingroup libgdammEnums */
inline RendererOptions& operator^=(RendererOptions& lhs, RendererOptions rhs)
  { return (lhs = static_cast<RendererOptions>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }

} // namespace Gda

} // namespace Gnome


#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{

template <>
class Value<Gnome::Gda::RendererOptions> : public Glib::Value_Flags<Gnome::Gda::RendererOptions>
{
public:
  static GType value_type() G_GNUC_CONST;
};

} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace Gda
{


/** Base class to get representations of objects as SQL statements, XML nodes or human readable text.
 *
 * @ingroup Miscellaneous
 */

class Renderer : public Glib::Interface
{
  
#ifndef DOXYGEN_SHOULD_SKIP_THIS

public:
  typedef Renderer CppObjectType;
  typedef Renderer_Class CppClassType;
  typedef GdaRenderer BaseObjectType;
  typedef GdaRendererIface BaseClassType;

private:
  friend class Renderer_Class;
  static CppClassType renderer_class_;

  // noncopyable
  Renderer(const Renderer&);
  Renderer& operator=(const Renderer&);

protected:
  Renderer(); // you must derive from this class

  /** Called by constructors of derived classes. Provide the result of 
   * the Class init() function to ensure that it is properly 
   * initialized.
   * 
   * @param interface_class The Class object for the derived type.
   */
  explicit Renderer(const Glib::Interface_Class& interface_class);

public:
  // This is public so that C++ wrapper instances can be
  // created for C instances of unwrapped types.
  // For instance, if an unexpected C type implements the C interface. 
  explicit Renderer(GdaRenderer* castitem);

protected:
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

public:
  virtual ~Renderer();

  static void add_interface(GType gtype_implementer);

#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.
  GdaRenderer*       gobj()       { return reinterpret_cast<GdaRenderer*>(gobject_); }

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

private:

public:
 
  // TODO: Wrap GSList* output parameter:
  //_WRAP_METHOD(Glib::ustring render_as_sql(const Glib::RefPtr<GdaParameterList> context, GSList **out_params_used, RendererOptions options), gda_renderer_render_as_sql, errthrow)

  
  /** Build a human readable string representing the object, in the specified context.
   * @param context Rendering context.
   * @return The new string.
   */
  Glib::ustring render_as_str(const Glib::RefPtr<ParameterList>& context) const;
  
  /** Tells if @a iface has all the necessary information in @a context to be rendered
   * into a valid statement (which can be executed).
   * @param context Rendering context.
   * @return <tt>true</tt> if @a iface can be rendered with @a context.
   */
#ifdef GLIBMM_EXCEPTIONS_ENABLED
  bool is_valid(const Glib::RefPtr<ParameterList>& context) const;
#else
  bool is_valid(const Glib::RefPtr<ParameterList>& context, std::auto_ptr<Glib::Error>& error) const;
#endif //GLIBMM_EXCEPTIONS_ENABLED


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::Renderer
   */
  Glib::RefPtr<Gnome::Gda::Renderer> wrap(GdaRenderer* object, bool take_copy = false);

} // namespace Glib


#endif /* _LIBGDAMM_RENDERER_H */

