summaryrefslogtreecommitdiff
path: root/src/polkit/polkitprivate.h
blob: 9f07063d99f6056293aaedf4b3f7030be327fc11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
 * Copyright (C) 2008 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Author: David Zeuthen <davidz@redhat.com>
 */

#ifndef __POLKIT_PRIVATE_H
#define __POLKIT_PRIVATE_H

#include "polkitimplicitauthorization.h"
#include "polkitactiondescription.h"
#include "polkitsubject.h"
#include "polkitauthorizationresult.h"
#include "polkittemporaryauthorization.h"

/* FIXME: This header file is currently installed among other public header
   files, and the symbols are exported in the shared library.

   For application writers: relying on any function here is strongly
   discouraged.

   For polkit maintainers: This should be made private if a large ABI break
   were necessary in the future.  In the meantime, consider that there is
   non-zero risk that changing these functions might break some applications. */

PolkitActionDescription  *polkit_action_description_new_for_gvariant (GVariant *value);
GVariant *polkit_action_description_to_gvariant (PolkitActionDescription *action_description);

GVariant *polkit_subject_to_gvariant (PolkitSubject *subject);
GVariant *polkit_identity_to_gvariant (PolkitIdentity *identity);

PolkitSubject  *polkit_subject_new_for_gvariant (GVariant *variant, GError **error);
PolkitIdentity *polkit_identity_new_for_gvariant (GVariant *variant, GError **error);

PolkitAuthorizationResult  *polkit_authorization_result_new_for_gvariant (GVariant *value);
GVariant *polkit_authorization_result_to_gvariant (PolkitAuthorizationResult *authorization_result);

PolkitTemporaryAuthorization *polkit_temporary_authorization_new    (const gchar                  *id,
                                                                     const gchar                  *action_id,
                                                                     PolkitSubject                *subject,
                                                                     guint64                       time_obtained,
                                                                     guint64                       time_expires);
PolkitTemporaryAuthorization *polkit_temporary_authorization_new_for_gvariant (GVariant *value,
                                                                               GError   **error);
GVariant *polkit_temporary_authorization_to_gvariant (PolkitTemporaryAuthorization *authorization);

GVariant *polkit_details_to_gvariant (PolkitDetails *details);
PolkitDetails *polkit_details_new_for_gvariant (GVariant *value);

PolkitActionDescription *
polkit_action_description_new (const gchar                 *action_id,
                               const gchar                 *description,
                               const gchar                 *message,
                               const gchar                 *vendor_name,
                               const gchar                 *vendor_url,
                               const gchar                 *icon_name,
                               PolkitImplicitAuthorization  implicit_any,
                               PolkitImplicitAuthorization  implicit_inactive,
                               PolkitImplicitAuthorization  implicit_active,
                               GHashTable                  *annotations);

#endif /* __POLKIT_PRIVATE_H */