/* * 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 . */ #include "db-model-holder.h" /** * SECTION: db-model-holder * @Short_description: * @Title: DbModelHolder * @See_also: #DbModel * * This interface should be implemented from any class that uses a #DbModel as * datasource. **/ G_DEFINE_INTERFACE (DbModelHolder, db_model_holder, G_TYPE_INTERFACE); /** * db_model_holder_get_model: * @obj: a #DbModelHolder * * Gets the model used by holder. * * Return value: the #DbModel **/ DbModel * db_model_holder_get_model (DbModelHolder * obj) { g_return_val_if_fail (DB_IS_MODEL_HOLDER (obj), NULL); return DB_MODEL_HOLDER_GET_INTERFACE (obj)->get_model (obj); } /** * db_model_holder_get_model: * @obj: a #DbModelHolder * @model: the #DbModel * * Sets the model used by holder. **/ void db_model_holder_set_model (DbModelHolder * obj, DbModel * model) { g_return_if_fail (DB_IS_MODEL_HOLDER (obj)); DB_MODEL_HOLDER_GET_INTERFACE (obj)->set_model (obj, model); } //+++++++++++++++++++++++++++++++++++++++++++++++++++ Class static void db_model_holder_default_init (DbModelHolderInterface * klass) { g_object_interface_install_property (klass, g_param_spec_object ("model" ,"Model" ,"The model used by the holder" ,DB_TYPE_MODEL ,G_PARAM_READWRITE )); }