1 /* ide-deploy-strategy.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 #if !defined (IDE_FOUNDRY_INSIDE) && !defined (IDE_FOUNDRY_COMPILATION)
24 # error "Only <libide-foundry.h> can be included directly."
25 #endif
26 
27 #include <libide-core.h>
28 #include "ide-foundry-types.h"
29 
30 G_BEGIN_DECLS
31 
32 #define IDE_TYPE_DEPLOY_STRATEGY (ide_deploy_strategy_get_type())
33 
34 IDE_AVAILABLE_IN_3_32
35 G_DECLARE_DERIVABLE_TYPE (IdeDeployStrategy, ide_deploy_strategy, IDE, DEPLOY_STRATEGY, IdeObject)
36 
37 struct _IdeDeployStrategyClass
38 {
39   IdeObjectClass parent;
40 
41   void     (*load_async)    (IdeDeployStrategy     *self,
42                              IdePipeline      *pipeline,
43                              GCancellable          *cancellable,
44                              GAsyncReadyCallback    callback,
45                              gpointer               user_data);
46   gboolean (*load_finish)   (IdeDeployStrategy     *self,
47                              GAsyncResult          *result,
48                              GError               **error);
49   void     (*deploy_async)  (IdeDeployStrategy     *self,
50                              IdePipeline      *pipeline,
51                              GFileProgressCallback  progress,
52                              gpointer               progress_data,
53                              GDestroyNotify         progress_data_destroy,
54                              GCancellable          *cancellable,
55                              GAsyncReadyCallback    callback,
56                              gpointer               user_data);
57   gboolean (*deploy_finish) (IdeDeployStrategy     *self,
58                              GAsyncResult          *result,
59                              GError               **error);
60   void       (*create_runner_async)  (IdeDeployStrategy   *self,
61                                       IdePipeline         *pipeline,
62                                       GCancellable        *cancellable,
63                                       GAsyncReadyCallback  callback,
64                                       gpointer             user_data);
65   IdeRunner *(*create_runner_finish) (IdeDeployStrategy   *self,
66                                       GAsyncResult        *result,
67                                       GError             **error);
68 
69   gpointer _reserved[16];
70 };
71 
72 IDE_AVAILABLE_IN_3_32
73 void     ide_deploy_strategy_load_async    (IdeDeployStrategy      *self,
74                                             IdePipeline       *pipeline,
75                                             GCancellable           *cancellable,
76                                             GAsyncReadyCallback     callback,
77                                             gpointer                user_data);
78 IDE_AVAILABLE_IN_3_32
79 gboolean ide_deploy_strategy_load_finish   (IdeDeployStrategy      *self,
80                                             GAsyncResult           *result,
81                                             GError                **error);
82 IDE_AVAILABLE_IN_3_32
83 void     ide_deploy_strategy_deploy_async  (IdeDeployStrategy      *self,
84                                             IdePipeline       *pipeline,
85                                             GFileProgressCallback   progress,
86                                             gpointer                progress_data,
87                                             GDestroyNotify          progress_data_destroy,
88                                             GCancellable           *cancellable,
89                                             GAsyncReadyCallback     callback,
90                                             gpointer                user_data);
91 IDE_AVAILABLE_IN_3_32
92 gboolean ide_deploy_strategy_deploy_finish (IdeDeployStrategy      *self,
93                                             GAsyncResult           *result,
94                                             GError                **error);
95 IDE_AVAILABLE_IN_41
96 void       ide_deploy_strategy_create_runner_async  (IdeDeployStrategy   *self,
97                                                      IdePipeline         *pipeline,
98                                                      GCancellable        *cancellable,
99                                                      GAsyncReadyCallback  callback,
100                                                      gpointer             user_data);
101 IDE_AVAILABLE_IN_41
102 IdeRunner *ide_deploy_strategy_create_runner_finish (IdeDeployStrategy  *self,
103                                                      GAsyncResult       *result,
104                                                      GError            **error);
105 
106 G_END_DECLS
107