/* * lens.h * * Copyright 2024 Michael Rasmussen * * 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., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * */ #ifndef LENS_H_ #define LENS_H_ 1 #include G_BEGIN_DECLS #define TYPE_LENS (lens_get_type ()) #define LENS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LENS, Lens)) #define LENS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LENS, LensClass)) #define IS_LENS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LENS)) #define IS_LENS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LENS)) #define LENS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LENS, LensClass)) typedef struct _Lens Lens; typedef struct _LensClass LensClass; struct _LensClass { GObjectClass parent_class; }; GType lens_get_type (void); /* * gint id; gchar* sn; gchar* data; gchar* notes; gchar* date; */ Lens *lens_new (gint id, const gchar* sn, const gchar* data, GError** error); gint lens_get_id(Lens* self, GError** error); void lens_set_sn(Lens* self, const gchar* sn, GError** error); void lens_set_data(Lens* self, const gchar* data, GError** error); void lens_set_notes(Lens* self, const gchar* notes, GError** error); void lens_set_date(Lens* self, const gchar* date, GError** error); gchar* lens_to_string(Lens* self); Lens* lens_get_copy(const Lens* self, GError** error); gchar* get_current_timestamp(); G_END_DECLS #endif /* LENS_H_ */