1
/* ipuz-clue-sets.h
2
 *
3
 * Copyright 2023 Jonathan Blandford <jrb@gnome.org>
4
 *
5
 * This library is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Lesser General Public
7
 * License as published by the Free Software Foundation; either
8
 * version 2.1 of the License, or (at your option) any later version.
9
 *
10
 * This library 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 GNU
13
 * Lesser General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Lesser General Public
16
 * License along with this library; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18
 *
19
 * SPDX-License-Identifier: (LGPL-2.1-or-later OR MIT)
20
 */
21

            
22
#pragma once
23

            
24
#include <glib-object.h>
25
#include <libipuz/ipuz-clue.h>
26

            
27
G_BEGIN_DECLS
28

            
29

            
30
typedef struct _IPuzClueSets IPuzClueSets;
31
#define IPUZ_TYPE_CLUE_SETS (ipuz_clue_sets_get_type ())
32

            
33

            
34
typedef void (*IPuzClueSetsForeachFunc) (IPuzClueSets            *clue_sets,
35
                                         IPuzClueDirection        direction,
36
                                         gpointer                 user_data);
37

            
38

            
39
GType              ipuz_clue_sets_get_type               (void);
40
IPuzClueSets      *ipuz_clue_sets_new                    (void);
41
IPuzClueSets      *ipuz_clue_sets_ref                    (IPuzClueSets            *clue_sets);
42
void               ipuz_clue_sets_unref                  (IPuzClueSets            *clue_sets);
43
gboolean           ipuz_clue_sets_equal                  (IPuzClueSets            *a,
44
                                                          IPuzClueSets            *b);
45
void               ipuz_clue_sets_clone                  (IPuzClueSets            *src,
46
                                                          IPuzClueSets            *dest);
47
IPuzClueDirection  ipuz_clue_sets_add_set                (IPuzClueSets            *clue_sets,
48
                                                          IPuzClueDirection        direction,
49
                                                          const gchar             *label);
50
guint              ipuz_clue_sets_get_n_clue_sets        (IPuzClueSets            *clue_sets);
51
void               ipuz_clue_sets_foreach                (IPuzClueSets            *clue_sets,
52
                                                          IPuzClueSetsForeachFunc  func,
53
                                                          gpointer                 user_data);
54
void               ipuz_clue_sets_append_clue            (IPuzClueSets            *clue_sets,
55
                                                          IPuzClueDirection        direction,
56
                                                          IPuzClue                *clue);
57
void               ipuz_clue_sets_remove_clue            (IPuzClueSets            *clue_sets,
58
                                                          IPuzClueDirection        direction,
59
                                                          IPuzClue                *clue,
60
                                                          gboolean                 remove_empty);
61
IPuzClueDirection  ipuz_clue_sets_get_direction          (IPuzClueSets            *clue_sets,
62
                                                          guint                    index);
63
const gchar       *ipuz_clue_sets_get_label              (IPuzClueSets            *clue_sets,
64
                                                          IPuzClueDirection        direction);
65
GArray            *ipuz_clue_sets_get_clues              (IPuzClueSets            *clue_sets,
66
                                                          IPuzClueDirection        direction);
67
IPuzClueDirection  ipuz_clue_sets_get_original_direction (IPuzClueSets            *clue_sets,
68
                                                          IPuzClueDirection        direction);
69
void               ipuz_clue_sets_unlink_direction       (IPuzClueSets            *clue_sets,
70
                                                          IPuzClueDirection        direction);
71

            
72

            
73
4
G_DEFINE_AUTOPTR_CLEANUP_FUNC(IPuzClueSets, ipuz_clue_sets_unref);
74

            
75

            
76
G_END_DECLS