1 /* ide-context-addin.h
2  *
3  * Copyright 2018-2019 Christian Hergert <chergert@redhat.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  * SPDX-License-Identifier: GPL-3.0-or-later
19  */
20 
21 #pragma once
22 
23 #include "ide-context.h"
24 #include "ide-version-macros.h"
25 
26 G_BEGIN_DECLS
27 
28 #define IDE_TYPE_CONTEXT_ADDIN (ide_context_addin_get_type())
29 
30 IDE_AVAILABLE_IN_3_32
31 G_DECLARE_INTERFACE (IdeContextAddin, ide_context_addin, IDE, CONTEXT_ADDIN, GObject)
32 
33 struct _IdeContextAddinInterface
34 {
35   GTypeInterface parent_iface;
36 
37   void     (*load)                (IdeContextAddin      *self,
38                                    IdeContext           *context);
39   void     (*unload)              (IdeContextAddin      *self,
40                                    IdeContext           *context);
41   void     (*load_project_async)  (IdeContextAddin      *self,
42                                    IdeContext           *context,
43                                    GCancellable         *cancellable,
44                                    GAsyncReadyCallback   callback,
45                                    gpointer              user_data);
46   gboolean (*load_project_finish) (IdeContextAddin      *self,
47                                    GAsyncResult         *result,
48                                    GError              **error);
49   void     (*project_loaded)      (IdeContextAddin      *self,
50                                    IdeContext           *context);
51 };
52 
53 IDE_AVAILABLE_IN_3_40
54 IdeContextAddin *ide_context_addin_find_by_module_name (IdeContext  *context,
55                                                         const gchar *module_name);
56 IDE_AVAILABLE_IN_3_32
57 void             ide_context_addin_load_project_async  (IdeContextAddin      *self,
58                                                         IdeContext           *context,
59                                                         GCancellable         *cancellable,
60                                                         GAsyncReadyCallback   callback,
61                                                         gpointer              user_data);
62 IDE_AVAILABLE_IN_3_32
63 gboolean         ide_context_addin_load_project_finish (IdeContextAddin      *self,
64                                                         GAsyncResult         *result,
65                                                         GError              **error);
66 IDE_AVAILABLE_IN_3_32
67 void             ide_context_addin_load                (IdeContextAddin      *self,
68                                                         IdeContext           *context);
69 IDE_AVAILABLE_IN_3_32
70 void             ide_context_addin_unload              (IdeContextAddin      *self,
71                                                         IdeContext           *context);
72 IDE_AVAILABLE_IN_3_32
73 void             ide_context_addin_project_loaded      (IdeContextAddin      *self,
74                                                         IdeContext           *context);
75 
76 G_END_DECLS
77