#ifndef __QUERY_BROWSER_WR_H__
#define __QUERY_BROWSER_WR_H__


#include "sqlide/sql_editor_be.h"
#include "GrtTemplates.h"
#include "SigCSlot.h"

using namespace System;
using namespace System::Runtime::InteropServices;
using namespace System::Collections::Generic;


namespace MySQL {
namespace Grt {
namespace Db {
namespace Sql {

ref class Recordset;


public ref class Sql_editor
{
private:
  ::Sql_editor *_inner;

public:
  Sql_editor(::Sql_editor *inner) : _inner(inner) {}

  int int_option(String ^name);
  String ^ string_option(String ^name);

  void sql(String ^sql) { _inner->sql(NativeToCppString(sql)); }
  void check_sql() { _inner->check_sql(); }

  typedef DelegateSlot4<
    int, int,
    int, int,
    int, int,
    int, int,
    std::string, String^> ParseErrorDelegate;

public:
  void sql_parser_err_cb(ParseErrorDelegate::ManagedDelegate ^cb)
  {
    on_parse_err_delegate= gcnew ParseErrorDelegate(cb);
    _inner->sql_parser_err_cb(on_parse_err_delegate->get_slot());
  }
private:
  ParseErrorDelegate^ on_parse_err_delegate;
};


};  // namespace Sql
};  // namespace Db
};  // namespace Grt
};  // namespace MySQL


#endif // __QUERY_BROWSER_WR_H__
