#ifndef __ROCCAT_MACRO_EDITOR_INTERFACE_H__
#define __ROCCAT_MACRO_EDITOR_INTERFACE_H__

/*
 * This file is part of roccat-tools.
 *
 * roccat-tools is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * roccat-tools 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with roccat-tools. If not, see <http://www.gnu.org/licenses/>.
 */

#include "roccat/roccat.h"
#include <gtk/gtk.h>

G_BEGIN_DECLS

#define ROCCAT_MACRO_EDITOR_INTERFACE_TYPE (roccat_macro_editor_interface_get_type())
#define ROCCAT_MACRO_EDITOR_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ROCCAT_MACRO_EDITOR_INTERFACE_TYPE, RoccatMacroEditorInterface))
#define IS_ROCCAT_MACRO_EDITOR_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ROCCAT_MACRO_EDITOR_INTERFACE_TYPE))
#define ROCCAT_MACRO_EDITOR_INTERFACE_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), ROCCAT_MACRO_EDITOR_INTERFACE_TYPE, RoccatMacroEditorInterfaceInterface))

typedef struct _RoccatMacroEditorInterface RoccatMacroEditorInterface;
typedef struct _RoccatMacroEditorInterfaceInterface RoccatMacroEditorInterfaceInterface;

struct _RoccatMacroEditorInterfaceInterface {
	GTypeInterface parent;

	/* signals */

	void (*modified)(RoccatMacroEditorInterface *self);
	void (*empty_changed)(RoccatMacroEditorInterface *self);

	/* virtual table */

	gchar const *(*name)(RoccatMacroEditorInterface *self);

	void (*clear)(RoccatMacroEditorInterface *self);

	/* should return true if macro has no keystrokes */
	gboolean (*empty)(RoccatMacroEditorInterface *self);

	/* times are in milliseconds */
	void (*add_keystroke)(RoccatMacroEditorInterface *self, guint key, guint action, glong abs_time, glong rel_time);

	void (*set_keystrokes)(RoccatMacroEditorInterface *self, RoccatMacroKeystrokes const *keystrokes);

	RoccatMacroKeystrokes *(*get_keystrokes)(RoccatMacroEditorInterface *self);

	glong (*abs_time)(RoccatMacroEditorInterface *self);

	gboolean (*get_modified)(RoccatMacroEditorInterface *self);
	void (*set_modified)(RoccatMacroEditorInterface *self, gboolean new_state);
};

GType roccat_macro_editor_interface_get_type(void);

gchar const *roccat_macro_editor_interface_name(RoccatMacroEditorInterface *self);
void roccat_macro_editor_interface_set_keystrokes(RoccatMacroEditorInterface *self, RoccatMacroKeystrokes const *keystrokes);
RoccatMacroKeystrokes *roccat_macro_editor_interface_get_keystrokes(RoccatMacroEditorInterface *self);
void roccat_macro_editor_interface_clear(RoccatMacroEditorInterface *self);
gboolean roccat_macro_editor_interface_empty(RoccatMacroEditorInterface *self);
void roccat_macro_editor_interface_add_keystroke(RoccatMacroEditorInterface *self, guint key, guint action, glong abs_time, glong rel_time);
glong roccat_macro_editor_interface_abs_time(RoccatMacroEditorInterface *self);
gboolean roccat_macro_editor_interface_get_modified(RoccatMacroEditorInterface *self);
void roccat_macro_editor_interface_set_modified(RoccatMacroEditorInterface *self, gboolean new_state);

void roccat_macro_editor_interface_modified(RoccatMacroEditorInterface *self);
void roccat_macro_editor_interface_empty_changed(RoccatMacroEditorInterface *self);

G_END_DECLS

#endif
