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


#include <glibmm.h>

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

/* serveroperation.h
 *
 * Copyright 2001      Free Software Foundation
 *
 * 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/connection.h>
#include <libgdamm/command.h>
#include <libgdamm/datamodelindex.h>
#include <libgdamm/client.h>
#include <libgda/gda-server-provider.h>


#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GdaServerOperation GdaServerOperation;
typedef struct _GdaServerOperationClass GdaServerOperationClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace Gda
{ class ServerOperation_Class; } // namespace Gda

} // namespace Gnome
namespace Gnome
{

namespace Gda
{


class Connection;

//_WRAP_ENUM(ClientSpecsType, GdaClientSpecsType)
/** @addtogroup libgdammEnums Enums and Flags */

/**
 * @ingroup libgdammEnums
 */
enum ServerOperationNodeType
{
  SERVER_OPERATION_NODE_PARAMLIST,
  SERVER_OPERATION_NODE_DATA_MODEL,
  SERVER_OPERATION_NODE_PARAM,
  SERVER_OPERATION_NODE_SEQUENCE,
  SERVER_OPERATION_NODE_SEQUENCE_ITEM,
  SERVER_OPERATION_NODE_DATA_MODEL_COLUMN,
  SERVER_OPERATION_NODE_UNKNOWN
};

} // namespace Gda

} // namespace Gnome


#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{

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

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


namespace Gnome
{

namespace Gda
{

/**
 * @ingroup libgdammEnums
 */
enum ServerOperationNodeStatus
{
  SERVER_OPERATION_STATUS_OPTIONAL,
  SERVER_OPERATION_STATUS_REQUIRED,
  SERVER_OPERATION_STATUS_UNKNOWN
};

} // namespace Gda

} // namespace Gnome


#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{

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

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


namespace Gnome
{

namespace Gda
{


/** @defgroup DDL Data definition (DDL) queries
 */

/** Handles any DDL query in an abstract way.
 *
 * @ingroup DDL
 */

class ServerOperation : public Glib::Object
{
  
#ifndef DOXYGEN_SHOULD_SKIP_THIS

public:
  typedef ServerOperation CppObjectType;
  typedef ServerOperation_Class CppClassType;
  typedef GdaServerOperation BaseObjectType;
  typedef GdaServerOperationClass BaseClassType;

private:  friend class ServerOperation_Class;
  static CppClassType serveroperation_class_;

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

protected:
  explicit ServerOperation(const Glib::ConstructParams& construct_params);
  explicit ServerOperation(GdaServerOperation* castitem);

#endif /* DOXYGEN_SHOULD_SKIP_THIS */

public:
  virtual ~ServerOperation();

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

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

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

private:


public:
  // The C version of these take varargs for some reason.
  
  /** Get the value for the node at the path formed using @a path_format and ... (the rules are the same as
   * for Glib::strdup_printf())
   * @param path_format A complete path to a node (starting with "/").
   * @param Varargs Arguments to use with @a path_format to make a complete path.
   * @return A constant Value if a value has been defined, or <tt>0</tt> if the value is undefined or
   * if the @a path is not defined or @a path does not hold any value.
   */

  Value get_value_at(const Glib::ustring& path) const;

  
  /** Set the value for the node at the path formed using @a path_format and ... the rules are the same as
   * for Glib::strdup_printf())
   * 
   * Here are the corner cases:
   * &lt;itemizedlist&gt;
   * &lt;listitem&gt;If the path corresponds to a Gda::Parameter, then the parameter is set to @a value&lt;/listitem&gt;
   * &lt;listitem&gt;If the path corresponds to a sequence item like for example "/SEQUENCE_NAME/5/NAME" for
   * the "NAME" value of the 6th item of the "SEQUENCE_NAME" sequence then:
   * &lt;itemizedlist&gt;
   * &lt;listitem&gt;if the sequence already has 6 or more items, then the value is just set to the corresponding 
   * value in the 6th item of the sequence&lt;/listitem&gt;
   * &lt;listitem&gt;if the sequence has less then 6 items, then items are added up to the 6th one before setting
   * the value to the corresponding in the 6th item of the sequence&lt;/listitem&gt;
   * &lt;/itemizedlist&gt;
   * &lt;/listitem&gt;
   * &lt;listitem&gt;If the path corresponds to a Gda::DataModel, like for example "/ARRAY/ @a COLUMN/5" for the value at the
   * 6th row of the "COLUMN" column of the "ARRAY" data model, then:
   * &lt;itemizedlist&gt;
   * &lt;listitem&gt;if the data model already contains 6 or more rows, then the value is just set&lt;/listitem&gt;
   * &lt;listitem&gt;if the data model has less than 6 rows, then rows are added up to the 6th one before setting
   * the value&lt;/listitem&gt;
   * &lt;/itemizedlist&gt;
   * &lt;/listitem&gt;
   * &lt;/itemizedlist&gt;
   * @param value A string.
   * @param path_format A complete path to a node (starting with "/").
   * @param Varargs Arguments to use with @a path_format to make a complete path.
   * @return <tt>true</tt> if no error occurred.
   */

#ifdef GLIBMM_EXCEPTIONS_ENABLED
  void set_value_at(const Glib::ustring& path, const Glib::ustring& value);
#else
  void set_value_at(const Glib::ustring& path, const Glib::ustring& value, std::auto_ptr<Glib::Error>& error);
#endif // GLIBMM_EXCEPTIONS_ENABLED

  
  /** Convenience function to get the type of a node.
   * @param path A complete path to a node (starting with "/").
   * @param status A place to store the status of the node, or <tt>0</tt>.
   * @return The type of node, or GDA_SERVER_OPERATION_NODE_UNKNOWN if the node was not found.
   */
  ServerOperationNodeType get_node_type(const Glib::ustring& path, ServerOperationNodeStatus& status) const;
 //_WRAP_METHOD(ServerOperationNodeType get_node_type_v(const Glib::ustring& *path_array),  gda_server_operation_get_node_type_v)

  //_WRAP_METHOD(GdaParameterList* get_node_parameter_list(const Glib::ustring& path) const, gda_server_operation_get_node_plist)
  //_WRAP_METHOD(GdaParameterList *gda_server_operation_get_node_plist_v(const Glib::ustring& *path_array)

  //_WRAP_METHOD(GdaParameter* get_node_param(const Glib::ustring& path) const, gda_server_operation_get_node_param)
  //_WRAP_METHOD(GdaParameter* gda_server_operation_get_node_param_v(const Glib::ustring& *path_array), gda_server_operation_get_node_param_v)

  //_WRAP_METHOD(GdaDataModel* get_node_datamodel(const Glib::ustring& path) const, gda_server_operation_get_node_datamodel, refreturn)
  //_WRAP_METHOD(GdaDataModel* get_node_datamodel_v(const Glib::ustring& *path_array), gda_server_operation_get_node_datamodel_v, refreturn)

  //_WRAP_METHOD(int get_node_seq_size(const Glib::ustring& path) const, gda_server_operation_get_node_seq_size)
  //_WRAP_METHOD(int get_node_seq_size_v(const Glib::ustring& path_array) const, gda_server_operation_get_node_seq_size_v)


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


#endif /* _LIBGDAMM_SERVEROPERATION_H */

