/* Rwv2 -- Microsoft Word Parser extension
   Copyright (C) 2003 Hannes Wyss, ywesee

   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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

   ywesee - intellectual capital connected
	 Winterthurerstrasse 52, CH-8006 Zürich, Switzerland
   hwyss@ywesee.com
*/

#ifndef RWV2_PARSER_H
#define RWV2_PARSER_H

#include "ruby.h"

#include "parser.h"
#include "sharedptr.h"

#include "rwv2_handlers.h"

extern "C" {

typedef struct rwv2_parser {
	wvWare::SharedPtr<wvWare::Parser> parser;
	wvWare::InlineReplacementHandler * wv_inline_replacement_handler;
	wvWare::SubDocumentHandler * wv_subdocument_handler;
	wvWare::TableHandler * wv_table_handler;
	wvWare::TextHandler * wv_text_handler;
	VALUE rb_inline_replacement_handler;
	VALUE rb_subdocument_handler;
	VALUE rb_table_handler;
	VALUE rb_text_handler;
} Rwv2Parser;

VALUE rwv2_parser_is_ok(VALUE self);
VALUE rwv2_parser_parse(VALUE self);
VALUE rwv2_parser_set_inline_replacement_handler(VALUE self, VALUE rb_handler);
VALUE rwv2_parser_set_subdocument_handler(VALUE self, VALUE rb_handler);
VALUE rwv2_parser_set_table_handler(VALUE self, VALUE rb_handler);
VALUE rwv2_parser_set_text_handler(VALUE self, VALUE rb_handler);
void rwv2_parser_mark(Rwv2Parser * stub);
void rwv2_parser_free(Rwv2Parser * stub);

} // extern "C"

#endif
