#ifndef __ROCCAT_MACROS_H__
#define __ROCCAT_MACROS_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_macro.h"

G_BEGIN_DECLS

typedef struct _RoccatMacros RoccatMacros;

/*!
 * \brief created new empty macros
 * \retval key file that has to be freed with \c roccat_macros_free()
 */
RoccatMacros *roccat_macros_new(void);

/*!
 * \brief load macro file
 * Returns key file even if file does not exist
 * \retval key file that has to be freed with \c roccat_macros_free()
 */
RoccatMacros *roccat_macros_load(void);

/*!
 * \brief save macro file to disk
 * \retval If successful returns +TRUE+. On failure, returns +FALSE+ with +error+ set
 */
gboolean roccat_macros_save(RoccatMacros *roccat_macros, GError **error);

/*!
 * \brief frees macro file
 */
void roccat_macros_free(RoccatMacros *key_file);

/*!
 * \brief gets macro
 */
RoccatMacro *roccat_macros_get(RoccatMacros *roccat_macros, gchar const *macro_set_name, gchar const *macro_name, GError **error);

/*!
 * \brief sets macro
 */
void roccat_macros_set(RoccatMacros *roccat_macros, RoccatMacro const *macro);

/*!
 * \brief returns array of macro set names
 * \retval NULL-terminated array of strings
 *
 * Use g_strfreev() to free array
 */
gchar **roccat_macros_get_macro_sets(RoccatMacros *roccat_macros, gsize *length);

/*!
 * \brief returns array of macro names for macro set
 * \retval NULL-terminated array of strings
 *
 * Use \c g_strfreev() to free array
 */
gchar **roccat_macros_get_macros(RoccatMacros *roccat_macros, gchar const *macro_set_name, gsize *length, GError **error);

G_END_DECLS

#endif
