1 /*
2  * ggit-remote-callbacks.h
3  * This file is part of libgit2-glib
4  *
5  * Copyright (C) 2013 - 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 
22 #ifndef __GGIT_REMOTE_CALLBACKS_H__
23 #define __GGIT_REMOTE_CALLBACKS_H__
24 
25 #include <glib-object.h>
26 #include <git2.h>
27 #include <libgit2-glib/ggit-cred.h>
28 
29 G_BEGIN_DECLS
30 
31 #define GGIT_TYPE_REMOTE_CALLBACKS (ggit_remote_callbacks_get_type ())
32 G_DECLARE_DERIVABLE_TYPE (GgitRemoteCallbacks, ggit_remote_callbacks, GGIT, REMOTE_CALLBACKS, GObject)
33 
34 struct _GgitRemoteCallbacksClass
35 {
36 	GObjectClass parent_class;
37 
38 	/* signals */
39 	void (*progress)              (GgitRemoteCallbacks        *callbacks,
40 	                               const gchar                *message);
41 
42 	void (*transfer_progress)     (GgitRemoteCallbacks        *callbacks,
43 	                               GgitTransferProgress       *stats);
44 
45 	void (*update_tips)           (GgitRemoteCallbacks        *callbacks,
46 	                               const gchar                *refname,
47 	                               const GgitOId              *a,
48 	                               const GgitOId              *b);
49 
50 	void (*completion)            (GgitRemoteCallbacks        *callbacks,
51 	                               GgitRemoteCompletionType    type);
52 
53 	/* virtual methods */
54 	GgitCred *(*credentials)      (GgitRemoteCallbacks        *callbacks,
55 	                               const gchar                *url,
56 	                               const gchar                *username_from_url,
57 	                               GgitCredtype                allowed_types,
58 	                               GError                    **error);
59 
60 
61 };
62 
63 git_remote_callbacks *_ggit_remote_callbacks_get_native (GgitRemoteCallbacks *remote_cbs);
64 
65 G_END_DECLS
66 
67 #endif /* __GGIT_REMOTE_CALLBACKS_H__ */
68 
69 /* ex:set ts=8 noet: */
70