/* $Id: transactionstatus.hg,v 1.2 2006/12/23 09:34:17 murrayc Exp $ */
// -*- C++ -*- //

/* transactionstatus.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 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 <glibmm/object.h>

_DEFS(libgdamm,libgda)
_PINCLUDE(glibmm/private/object_p.h)

namespace Gnome
{
  
namespace Gda
{

_WRAP_ENUM(TransactionIsolation, GdaTransactionIsolation)

/** Keeps track of the transactional status of a connection.
 *
 * On any connection (as a Connection object), if the database provider used by the connection supports it, 
 * transactions may be started, committed or rolledback, or savepoints added, removed or rolledback. 
 * These operations can be performed using libgda's API (such as Connection::begin_transaction()), or directly using some 
 * SQL on the connection (usually a "BEGIN;" command). The TransactionStatus's aim is to make it easy to keep track of 
 * all the commands which have been issued on a connection regarding transactions.
 * 
 * One TransactionStatus object is automatically attached to a Connection when a transaction is started, and is destroyed 
 * when the transaction is finished. This object can be fetched using Connection::get_transaction_status() (beware that it should then not be modified).
 *
 * @ingroup Connections
 */
class TransactionStatus : public Glib::Object
{
  _CLASS_GOBJECT(TransactionStatus, GdaTransactionStatus, GDA_TRANSACTION_STATUS, Glib::Object, GObject)
protected:
  explicit TransactionStatus(const Glib::ustring& name = Glib::ustring());
  _IGNORE(gda_transaction_status_new)

public:
  _WRAP_CREATE(const Glib::ustring& name)

  _MEMBER_GET(get_isolation_level, isolation_level, TransactionIsolation, GdaTransactionIsolation)
  _MEMBER_GET(get_name, name, Glib::ustring, gchar*)
};

} // namespace Gda
} // namespace Gnome

