ce-polkit-button.h 2.61 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager Connection editor -- Connection editor for NetworkManager
 *
 * Dan Williams <dcbw@redhat.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
20
 * (C) Copyright 2009 - 2012 Red Hat, Inc.
21 22 23 24 25 26 27
 */

#ifndef __CE_POLKIT_BUTTON_H__
#define __CE_POLKIT_BUTTON_H__

#include <gtk/gtk.h>

Dan Williams's avatar
Dan Williams committed
28
#include <nm-client.h>
29 30 31 32 33

#define CE_TYPE_POLKIT_BUTTON            (ce_polkit_button_get_type ())
#define CE_POLKIT_BUTTON(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), CE_TYPE_POLKIT_BUTTON, CEPolkitButton))
#define CE_POKLIT_BUTTON_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), CE_TYPE_POLKIT_BUTTON, CEPolkitButtonClass))
#define CE_IS_POLKIT_BUTTON(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CE_TYPE_POLKIT_BUTTON))
34
#define CE_IS_POLKIT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CE_TYPE_POLKIT_BUTTON))
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
#define CE_POLKIT_BUTTON_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), CE_TYPE_POLKIT_BUTTON, CEPolkitButtonClass))

typedef struct {
	GtkButton parent;
} CEPolkitButton;

typedef struct {
	GtkButtonClass parent;

	/* Signals */
	void (*actionable) (CEPolkitButton *self, gboolean actionable);
	
	void (*authorized) (CEPolkitButton *self, gboolean authorized);
} CEPolkitButtonClass;

GType ce_polkit_button_get_type (void);

GtkWidget *ce_polkit_button_new (const char *label,
                                 const char *tooltip,
                                 const char *auth_label,
                                 const char *auth_tooltip,
                                 const char *stock_icon,
Dan Williams's avatar
Dan Williams committed
57 58
                                 NMClient *client,
                                 NMClientPermission permission);
59 60 61 62 63 64 65 66 67

void ce_polkit_button_set_master_sensitive (CEPolkitButton *button, gboolean sensitive);

gboolean ce_polkit_button_get_actionable (CEPolkitButton *button);

gboolean ce_polkit_button_get_authorized (CEPolkitButton *button);

#endif  /* __CE_POLKIT_BUTTON_H__ */