2 * Copyright 2013 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 * Alberto Ruiz <alberto.ruiz@canonical.com>
18 * Renato Araujo Oliveira Filho <renato@canonical.com>
21#ifndef __SECRET_AGENT_H__
22#define __SECRET_AGENT_H__
25#include <glib-object.h>
26#include <nm-secret-agent.h>
29 * This class is a basic implementation of the NetworkManager SecretAgent base class.
31 * The purpose of this class is to handle credential requests from the network,
32 * for example, from a WiFi hotspot or a VPN network.
34 * It queues requests objects (SecretRequest) on a GQueue in the private struct
35 * of the class. And notifies the consumer of the class through the "secret-request"
36 * and the "request-cancelled" signals with the following callback prototypes:
38 * void (*secret_requested) (UnitySettingsSecretAgent *self,
40 * NMConnection *connection,
41 * const char *setting_name,
43 * NMSecretAgentGetSecretsFlags flags,
44 * gpointer user_data);
46 * void (*request_cancelled) (UnitySettingsSecretAgent *self,
48 * gpointer user_data);
56#define UNITY_SETTINGS_TYPE_SECRET_AGENT (unity_settings_secret_agent_get_type ())
57#define UNITY_SETTINGS_SECRET_AGENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_SETTINGS_TYPE_SECRET_AGENT, UnitySettingsSecretAgent))
58#define UNITY_SETTINGS_SECRET_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_SETTINGS_TYPE_SECRET_AGENT, UnitySettingsSecretAgentClass))
59#define UNITY_SETTINGS_IS_SECRET_AGENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_SETTINGS_TYPE_SECRET_AGENT))
60#define UNITY_SETTINGS_IS_SECRET_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_SETTINGS_TYPE_SECRET_AGENT))
61#define UNITY_SETTINGS_SECRET_AGENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_SETTINGS_TYPE_SECRET_AGENT, UnitySettingsSecretAgentClass))
63#define UNITY_SETTINGS_SECRET_AGENT_SECRET_REQUESTED "secret-requested"
64#define UNITY_SETTINGS_SECRET_AGENT_REQUEST_CANCELLED "request-cancelled"
66typedef struct _UnitySettingsSecretAgent UnitySettingsSecretAgent;
67typedef struct _UnitySettingsSecretAgentClass UnitySettingsSecretAgentClass;
68typedef struct _UnitySettingsSecretAgentPrivate UnitySettingsSecretAgentPrivate;
70struct _UnitySettingsSecretAgent {
71 NMSecretAgent parent_instance;
72 UnitySettingsSecretAgentPrivate * priv;
75struct _UnitySettingsSecretAgentClass {
76 NMSecretAgentClass parent_class;
78 void (*secret_requested) (UnitySettingsSecretAgent *self,
80 NMConnection *connection,
81 const char *setting_name,
83 NMSecretAgentGetSecretsFlags flags);
85 void (*request_cancelled) (UnitySettingsSecretAgent *self,
90GType unity_settings_secret_agent_get_type (void) G_GNUC_CONST;
91UnitySettingsSecretAgent* unity_settings_secret_agent_new (void);
92UnitySettingsSecretAgent* unity_settings_secret_agent_construct (GType object_type);
94void unity_settings_secret_agent_provide_secret (UnitySettingsSecretAgent *agent,
97void unity_settings_secret_agent_cancel_request (UnitySettingsSecretAgent *agent,
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list