1 /*
2  * ggit-ref.h
3  * This file is part of libgit2-glib
4  *
5  * Copyright (C) 2011 - Ignacio Casal Quinteiro
6  *
7  * libgit2-glib is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * libgit2-glib is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with libgit2-glib. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __GGIT_REF_H__
22 #define __GGIT_REF_H__
23 
24 #include <glib-object.h>
25 #include <git2.h>
26 #include <libgit2-glib/ggit-oid.h>
27 #include <libgit2-glib/ggit-native.h>
28 #include <libgit2-glib/ggit-object.h>
29 
30 G_BEGIN_DECLS
31 
32 #define GGIT_TYPE_REF (ggit_ref_get_type ())
33 G_DECLARE_DERIVABLE_TYPE (GgitRef, ggit_ref, GGIT, REF, GgitNative)
34 
35 /**
36  * GgitRefClass:
37  * @parent_class: The parent class.
38  *
39  * The class structure for #GgitRefClass.
40  */
41 struct _GgitRefClass
42 {
43 	/*< private >*/
44 	GgitNativeClass parent_class;
45 };
46 
47 GgitRef        *_ggit_ref_wrap              (git_reference  *ref,
48                                              gboolean        owned);
49 
50 gboolean        ggit_ref_is_valid_name      (const gchar    *name);
51 
52 GgitOId        *ggit_ref_get_target         (GgitRef        *ref);
53 
54 const gchar    *ggit_ref_get_symbolic_target(GgitRef        *ref);
55 
56 GgitRefType     ggit_ref_get_reference_type (GgitRef        *ref);
57 
58 const gchar    *ggit_ref_get_name           (GgitRef        *ref);
59 const gchar    *ggit_ref_get_shorthand      (GgitRef        *ref);
60 const gchar    *ggit_ref_to_string          (GgitRef        *ref);
61 
62 GgitRef        *ggit_ref_resolve            (GgitRef        *ref,
63                                              GError        **error);
64 
65 GgitRepository *ggit_ref_get_owner          (GgitRef        *ref);
66 
67 GgitRef        *ggit_ref_set_symbolic_target(GgitRef        *ref,
68                                              const gchar    *target,
69                                              const gchar    *log_message,
70                                              GError        **error);
71 
72 GgitRef        *ggit_ref_set_target         (GgitRef        *ref,
73                                              GgitOId        *oid,
74                                              const gchar    *log_message,
75                                              GError        **error);
76 
77 GgitRef        *ggit_ref_rename             (GgitRef        *ref,
78                                              const gchar    *new_name,
79                                              gboolean        force,
80                                              const gchar    *log_message,
81                                              GError        **error);
82 
83 void            ggit_ref_delete             (GgitRef        *ref,
84                                              GError        **error);
85 
86 GgitObject     *ggit_ref_lookup             (GgitRef        *ref,
87                                              GError        **error);
88 
89 gboolean        ggit_ref_has_log            (GgitRef        *ref);
90 
91 GgitReflog     *ggit_ref_get_log            (GgitRef        *ref,
92                                              GError        **error);
93 
94 void            ggit_ref_delete_log         (GgitRef        *ref,
95                                              GError        **error);
96 
97 gboolean        ggit_ref_is_tag             (GgitRef        *ref);
98 gboolean        ggit_ref_is_remote          (GgitRef        *ref);
99 gboolean        ggit_ref_is_branch          (GgitRef        *ref);
100 gboolean        ggit_ref_is_note            (GgitRef        *ref);
101 
102 G_END_DECLS
103 
104 #endif /* __GGIT_REF_H__ */
105 
106 /* ex:set ts=8 noet: */
107