/*
 *  Copyright (C) 2004 Mathias Andre <mathias@openbrookes.org>
 *
 *  This program 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.
 *
 *  This program 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 this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 */

#ifndef __NB_NOTE_LIST_H__
#define __NB_NOTE_LIST_H__

#include <glib.h>

#include "nb_note.h"

enum {
	ADD_NOTE,
	REMOVE_NOTE,
	UPDATE_NOTE,
};

typedef struct _note_list NoteList;

struct _note_list 
{
	gchar * filename;
	GPtrArray * notes;
};

/* create and free object */
NoteList	* nb_note_list_new (gchar * filename);
void		nb_note_list_free (NoteList * self);	

/* manage notes */
void		nb_note_list_add (NoteList * self, Note * n);
gboolean	nb_note_list_remove (NoteList * self, Note * n);
gint		nb_note_list_get_note_index (NoteList * self, Note * n);
gint		nb_note_list_get_nb (NoteList * self);

/* read/write from/to xml doc */
gboolean	nb_note_list_load_xml_file (NoteList * self);
gchar 		* nb_note_list_get_note_text_from_index (NoteList * self, gint index);
gboolean	nb_note_list_update_xml_file (NoteList * self, Note * n, gint action);

#endif
