1 /* 2 * Copyright 2017 LarsGit223 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 */ 18 19 #ifndef __WB_PROJECT_H__ 20 #define __WB_PROJECT_H__ 21 22 #include <glib.h> 23 24 typedef struct S_WB_PROJECT WB_PROJECT; 25 typedef struct S_WB_PROJECT_DIR WB_PROJECT_DIR; 26 27 typedef enum 28 { 29 WB_PROJECT_SCAN_MODE_INVALID, 30 WB_PROJECT_SCAN_MODE_WORKBENCH, 31 WB_PROJECT_SCAN_MODE_GIT, 32 }WB_PROJECT_SCAN_MODE; 33 34 WB_PROJECT *wb_project_new(const gchar *filename); 35 void wb_project_free(WB_PROJECT *prj); 36 37 void wb_project_set_modified(WB_PROJECT *prj, gboolean value); 38 gboolean wb_project_is_modified(WB_PROJECT *prj); 39 40 void wb_project_set_filename(WB_PROJECT *prj, const gchar *filename); 41 const gchar *wb_project_get_filename(WB_PROJECT *prj); 42 const gchar *wb_project_get_name(WB_PROJECT *prj); 43 GSList *wb_project_get_directories(WB_PROJECT *prj); 44 gboolean wb_project_add_directory(WB_PROJECT *prj, const gchar *dirname); 45 gboolean wb_project_remove_directory (WB_PROJECT *prj, WB_PROJECT_DIR *dir); 46 void wb_project_rescan(WB_PROJECT *prj); 47 gboolean wb_project_file_is_included(WB_PROJECT *prj, const gchar *filename); 48 gboolean wb_project_is_valid_dir_reference(WB_PROJECT *prj, WB_PROJECT_DIR *dir); 49 50 void wb_project_dir_set_is_prj_base_dir (WB_PROJECT_DIR *directory, gboolean value); 51 gboolean wb_project_dir_get_is_prj_base_dir (WB_PROJECT_DIR *directory); 52 const gchar *wb_project_dir_get_name (WB_PROJECT_DIR *directory); 53 GHashTable *wb_project_dir_get_file_table (WB_PROJECT_DIR *directory); 54 gchar *wb_project_dir_get_base_dir (WB_PROJECT_DIR *directory); 55 gchar **wb_project_dir_get_file_patterns (WB_PROJECT_DIR *directory); 56 gboolean wb_project_dir_set_file_patterns (WB_PROJECT_DIR *directory, gchar **new); 57 gchar **wb_project_dir_get_ignored_dirs_patterns (WB_PROJECT_DIR *directory); 58 gboolean wb_project_dir_set_ignored_dirs_patterns (WB_PROJECT_DIR *directory, gchar **new); 59 gchar **wb_project_dir_get_ignored_file_patterns (WB_PROJECT_DIR *directory); 60 gboolean wb_project_dir_set_ignored_file_patterns (WB_PROJECT_DIR *directory, gchar **new); 61 WB_PROJECT_SCAN_MODE wb_project_dir_get_scan_mode (WB_PROJECT_DIR *directory); 62 gboolean wb_project_dir_set_scan_mode (WB_PROJECT *project, WB_PROJECT_DIR *directory, WB_PROJECT_SCAN_MODE mode); 63 guint wb_project_dir_rescan(WB_PROJECT *prj, WB_PROJECT_DIR *root); 64 gchar *wb_project_dir_get_info (WB_PROJECT_DIR *dir); 65 gboolean wb_project_dir_file_is_included(WB_PROJECT_DIR *dir, const gchar *filename); 66 void wb_project_dir_add_file(WB_PROJECT *prj, WB_PROJECT_DIR *root, const gchar *filepath); 67 void wb_project_dir_remove_file(WB_PROJECT *prj, WB_PROJECT_DIR *root, const gchar *filepath); 68 69 gboolean wb_project_add_bookmark(WB_PROJECT *prj, const gchar *filename); 70 gboolean wb_project_remove_bookmark(WB_PROJECT *prj, const gchar *filename); 71 GPtrArray *wb_project_get_bookmarks(WB_PROJECT *prj); 72 gchar *wb_project_get_bookmark_at_index (WB_PROJECT *prj, guint index); 73 guint wb_project_get_bookmarks_count(WB_PROJECT *prj); 74 75 gboolean wb_project_save(WB_PROJECT *prj, GError **error); 76 gboolean wb_project_load(WB_PROJECT *prj, const gchar *filename, GError **error); 77 78 gchar *wb_project_get_info (WB_PROJECT *prj); 79 80 #endif 81