2013-10-11 23:07:35 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 - Juan Ferrer Toribio
|
|
|
|
*
|
|
|
|
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2013-10-14 12:08:06 +00:00
|
|
|
#ifndef DB_MODEL_HOLDER_H
|
|
|
|
#define DB_MODEL_HOLDER_H
|
2013-10-11 23:07:35 +00:00
|
|
|
|
|
|
|
#include "db-model.h"
|
2013-10-14 12:08:06 +00:00
|
|
|
|
|
|
|
#define DB_TYPE_MODEL_HOLDER (db_model_holder_get_type ())
|
2014-07-16 14:12:36 +00:00
|
|
|
#define DB_MODEL_HOLDER(self) (G_TYPE_CHECK_INSTANCE_CAST ((self), DB_TYPE_MODEL_HOLDER, DbModelHolder))
|
|
|
|
#define DB_IS_MODEL_HOLDER(self) (G_TYPE_CHECK_INSTANCE_TYPE ((self), DB_TYPE_MODEL_HOLDER))
|
|
|
|
#define DB_MODEL_HOLDER_GET_INTERFACE(self) (G_TYPE_INSTANCE_GET_INTERFACE ((self), DB_TYPE_MODEL_HOLDER, DbModelHolderInterface))
|
2013-10-14 12:08:06 +00:00
|
|
|
|
|
|
|
typedef struct _DbModelHolder DbModelHolder;
|
2013-10-11 23:07:35 +00:00
|
|
|
typedef struct _DbModelHolderInterface DbModelHolderInterface;
|
|
|
|
|
2014-07-16 14:12:36 +00:00
|
|
|
typedef DbModel * (* DbModelHolderGetModelFunc) (DbModelHolder * self);
|
|
|
|
typedef void (* DbModelHolderSetModelFunc) (DbModelHolder * self, DbModel * model);
|
2013-10-11 23:07:35 +00:00
|
|
|
|
2013-10-14 12:08:06 +00:00
|
|
|
struct _DbModelHolder;
|
|
|
|
|
|
|
|
struct _DbModelHolderInterface
|
2013-10-11 23:07:35 +00:00
|
|
|
{
|
2013-10-14 12:08:06 +00:00
|
|
|
/* <private> */
|
2013-10-11 23:07:35 +00:00
|
|
|
GTypeInterface parent;
|
|
|
|
DbModelHolderGetModelFunc get_model;
|
|
|
|
DbModelHolderSetModelFunc set_model;
|
2013-10-14 12:08:06 +00:00
|
|
|
};
|
|
|
|
|
2013-10-11 23:07:35 +00:00
|
|
|
GType db_model_holder_get_type ();
|
2014-07-16 14:12:36 +00:00
|
|
|
DbModel * db_model_holder_get_model (DbModelHolder * self);
|
|
|
|
void db_model_holder_set_model (DbModelHolder * self, DbModel * model);
|
2013-10-14 12:08:06 +00:00
|
|
|
|
|
|
|
#endif
|