|
Packit |
8ea169 |
/*
|
|
Packit |
8ea169 |
Copyright (C) 2015 ABRT team
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
This program is free software; you can redistribute it and/or modify
|
|
Packit |
8ea169 |
it under the terms of the GNU General Public License as published by
|
|
Packit |
8ea169 |
the Free Software Foundation; either version 2 of the License, or
|
|
Packit |
8ea169 |
(at your option) any later version.
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
This program is distributed in the hope that it will be useful,
|
|
Packit |
8ea169 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
8ea169 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
8ea169 |
GNU General Public License for more details.
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
You should have received a copy of the GNU General Public License along
|
|
Packit |
8ea169 |
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
Packit |
8ea169 |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
------------------------------------------------------------------------------
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
Definition of a task for creating a new problem directory.
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
The task checks if user can create a new problem, then saves the problem data
|
|
Packit |
8ea169 |
received over D-Bus and creates a new Problems2.Entry for it. The new entry
|
|
Packit |
8ea169 |
will be held in NEW state until notified to *abrtd*. After that the entry is
|
|
Packit |
8ea169 |
either removed (e.g. the problem was a duplicate of another problem) or its
|
|
Packit |
8ea169 |
state is set to COMPLETE.
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
See abrt_problems2_task.h for more details about Problems2 Tasks.
|
|
Packit |
8ea169 |
*/
|
|
Packit |
8ea169 |
#ifndef ABRT_P2_TASK_NEW_PROBLEM_H
|
|
Packit |
8ea169 |
#define ABRT_P2_TASK_NEW_PROBLEM_H
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
#include "abrt_problems2_task.h"
|
|
Packit |
8ea169 |
#include "abrt_problems2_service.h"
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
#include <glib-object.h>
|
|
Packit |
8ea169 |
#include <gio/gio.h>
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
G_BEGIN_DECLS
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
#define TYPE_ABRT_P2_TASK_NEW_PROBLEM abrt_p2_task_new_problem_get_type ()
|
|
Packit |
8ea169 |
G_DECLARE_FINAL_TYPE(AbrtP2TaskNewProblem, abrt_p2_task_new_problem, ABRT_P2, TASK_NEW_PROBLEM, AbrtP2Task)
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
typedef enum {
|
|
Packit |
8ea169 |
ABRT_P2_TASK_NEW_PROBLEM_ACCEPTED,
|
|
Packit |
8ea169 |
ABRT_P2_TASK_NEW_PROBLEM_FAILED,
|
|
Packit |
8ea169 |
ABRT_P2_TASK_NEW_PROBLEM_DUPLICATE,
|
|
Packit |
8ea169 |
ABRT_P2_TASK_NEW_PROBLEM_DROPPED,
|
|
Packit |
8ea169 |
ABRT_P2_TASK_NEW_PROBLEM_INVALID_DATA,
|
|
Packit |
8ea169 |
} AbrtP2TaskNewProblemCodes;
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
AbrtP2TaskNewProblem *abrt_p2_task_new_problem_new(AbrtP2Service *service,
|
|
Packit |
8ea169 |
GVariant *problem_info,
|
|
Packit |
8ea169 |
uid_t caller_uid,
|
|
Packit |
8ea169 |
GUnixFDList *fd_list);
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
/* The function will run the task and handle all states it can go in.
|
|
Packit |
8ea169 |
*
|
|
Packit |
8ea169 |
* For example, the function will destroyed the task, if it is stopped because
|
|
Packit |
8ea169 |
* on one can resume it.
|
|
Packit |
8ea169 |
*/
|
|
Packit |
8ea169 |
void abrt_p2_task_new_problem_autonomous_run(AbrtP2TaskNewProblem *task);
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
/* The functions stops the task after successfully created a new problem
|
|
Packit |
8ea169 |
* directory and before notifying *abrtd* for running "post-create" scripts.
|
|
Packit |
8ea169 |
*
|
|
Packit |
8ea169 |
* It is useful when you want to pass huge data over D-Bus and you cannot pass
|
|
Packit |
8ea169 |
* them as a file descriptor. You should be able to ask Problems2 service to
|
|
Packit |
8ea169 |
* create new file in the temporary problem directory and pass its file
|
|
Packit |
8ea169 |
* descriptor back to the caller.
|
|
Packit |
8ea169 |
*/
|
|
Packit |
8ea169 |
void abrt_p2_task_new_problem_wait_before_notify(AbrtP2TaskNewProblem *task,
|
|
Packit |
8ea169 |
bool value);
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
G_END_DECLS
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
#endif/*ABRT_P2_TASK_NEW_PROBLEM_H*/
|