1 /* gtd-manager.h 2 * 3 * Copyright (C) 2015-2020 Georges Basile Stavracas Neto <georges.stavracas@gmail.com> 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #pragma once 20 21 #include <gio/gio.h> 22 23 #include "gtd-object.h" 24 #include "gtd-types.h" 25 26 G_BEGIN_DECLS 27 28 #define GTD_TYPE_MANAGER (gtd_manager_get_type()) 29 30 G_DECLARE_FINAL_TYPE (GtdManager, gtd_manager, GTD, MANAGER, GtdObject) 31 32 /** 33 * GtdErrorActionFunc: 34 */ 35 typedef void (*GtdErrorActionFunc) (GtdNotification *notification, 36 gpointer user_data); 37 38 39 GtdManager* gtd_manager_new (void); 40 41 GtdManager* gtd_manager_get_default (void); 42 43 GList* gtd_manager_get_providers (GtdManager *manager); 44 45 void gtd_manager_add_provider (GtdManager *self, 46 GtdProvider *provider); 47 48 void gtd_manager_remove_provider (GtdManager *self, 49 GtdProvider *provider); 50 51 GtdProvider* gtd_manager_get_default_provider (GtdManager *manager); 52 53 void gtd_manager_set_default_provider (GtdManager *manager, 54 GtdProvider *provider); 55 56 GtdTaskList* gtd_manager_get_inbox (GtdManager *self); 57 58 GSettings* gtd_manager_get_settings (GtdManager *manager); 59 60 gboolean gtd_manager_get_is_first_run (GtdManager *manager); 61 62 void gtd_manager_set_is_first_run (GtdManager *manager, 63 gboolean is_first_run); 64 65 void gtd_manager_emit_error_message (GtdManager *manager, 66 const gchar *title, 67 const gchar *description, 68 GtdErrorActionFunc function, 69 gpointer user_data); 70 71 void gtd_manager_send_notification (GtdManager *self, 72 GtdNotification *notification); 73 74 GtdClock* gtd_manager_get_clock (GtdManager *self); 75 76 GListModel* gtd_manager_get_task_lists_model (GtdManager *self); 77 78 GListModel* gtd_manager_get_all_tasks_model (GtdManager *self); 79 80 GListModel* gtd_manager_get_tasks_model (GtdManager *self); 81 82 GListModel* gtd_manager_get_inbox_model (GtdManager *self); 83 84 GListModel* gtd_manager_get_providers_model (GtdManager *self); 85 86 G_END_DECLS 87