summaryrefslogtreecommitdiff
path: root/libpeas-gtk/peas-gtk-plugin-manager-store.h
blob: 729ff070334de1745f24d7105adda1acf6f5942f (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
 * peas-plugin-manager-store.h
 * This file is part of libpeas
 *
 * Copyright (C) 2002 Paolo Maggi and James Willcox
 * Copyright (C) 2003-2006 Paolo Maggi, Paolo Borelli
 * Copyright (C) 2007-2009 Paolo Maggi, Paolo Borelli, Steve Frécinaux
 * Copyright (C) 2010 Garrett Regier
 *
 * libpeas 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.1 of the License, or (at your option) any later version.
 *
 * libpeas 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 */

#ifndef __PEAS_GTK_PLUGIN_MANAGER_STORE_H__
#define __PEAS_GTK_PLUGIN_MANAGER_STORE_H__

#include <gtk/gtk.h>
#include <libpeas/peas-engine.h>
#include <libpeas/peas-plugin-info.h>

G_BEGIN_DECLS

typedef enum {
  PEAS_GTK_PLUGIN_MANAGER_STORE_ENABLED_COLUMN = 0,
  PEAS_GTK_PLUGIN_MANAGER_STORE_CAN_ENABLE_COLUMN,
  PEAS_GTK_PLUGIN_MANAGER_STORE_ICON_GICON_COLUMN,
  PEAS_GTK_PLUGIN_MANAGER_STORE_ICON_STOCK_ID_COLUMN,
  PEAS_GTK_PLUGIN_MANAGER_STORE_ICON_VISIBLE_COLUMN,
  PEAS_GTK_PLUGIN_MANAGER_STORE_INFO_COLUMN,
  PEAS_GTK_PLUGIN_MANAGER_STORE_INFO_SENSITIVE_COLUMN,
  PEAS_GTK_PLUGIN_MANAGER_STORE_PLUGIN_COLUMN,
  PEAS_GTK_PLUGIN_MANAGER_STORE_N_COLUMNS
} PeasGtkPluginManagerStoreColumns;

/*
 * Type checking and casting macros
 */
#define PEAS_GTK_TYPE_PLUGIN_MANAGER_STORE            (peas_gtk_plugin_manager_store_get_type())
#define PEAS_GTK_PLUGIN_MANAGER_STORE(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), PEAS_GTK_TYPE_PLUGIN_MANAGER_STORE, PeasGtkPluginManagerStore))
#define PEAS_GTK_PLUGIN_MANAGER_STORE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), PEAS_GTK_TYPE_PLUGIN_MANAGER_STORE, PeasGtkPluginManagerStoreClass))
#define PEAS_GTK_IS_PLUGIN_MANAGER_STORE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), PEAS_GTK_TYPE_PLUGIN_MANAGER_STORE))
#define PEAS_GTK_IS_PLUGIN_MANAGER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PEAS_GTK_TYPE_PLUGIN_MANAGER_STORE))
#define PEAS_GTK_PLUGIN_MANAGER_STORE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), PEAS_GTK_TYPE_PLUGIN_MANAGER_STORE, PeasGtkPluginManagerStoreClass))

typedef struct _PeasGtkPluginManagerStore         PeasGtkPluginManagerStore;
typedef struct _PeasGtkPluginManagerStoreClass    PeasGtkPluginManagerStoreClass;

struct _PeasGtkPluginManagerStore {
  GtkListStore parent;
};

struct _PeasGtkPluginManagerStoreClass {
  GtkListStoreClass parent_class;
};

GType                       peas_gtk_plugin_manager_store_get_type              (void) G_GNUC_CONST;
PeasGtkPluginManagerStore  *peas_gtk_plugin_manager_store_new                   (PeasEngine                *engine);

void                        peas_gtk_plugin_manager_store_reload                (PeasGtkPluginManagerStore *store);

void                        peas_gtk_plugin_manager_store_set_enabled           (PeasGtkPluginManagerStore *store,
                                                                                 GtkTreeIter               *iter,
                                                                                 gboolean                   enabled);
gboolean                    peas_gtk_plugin_manager_store_get_enabled           (PeasGtkPluginManagerStore *store,
                                                                                 GtkTreeIter               *iter);
void                        peas_gtk_plugin_manager_store_set_all_enabled       (PeasGtkPluginManagerStore *store,
                                                                                 gboolean                  enabled);
void                        peas_gtk_plugin_manager_store_toggle_enabled        (PeasGtkPluginManagerStore *store,
                                                                                 GtkTreeIter               *iter);

gboolean                    peas_gtk_plugin_manager_store_can_enable            (PeasGtkPluginManagerStore *store,
                                                                                 GtkTreeIter               *iter);

PeasPluginInfo             *peas_gtk_plugin_manager_store_get_plugin            (PeasGtkPluginManagerStore *store,
                                                                                 GtkTreeIter               *iter);

gboolean                    peas_gtk_plugin_manager_store_get_iter_from_plugin  (PeasGtkPluginManagerStore *store,
                                                                                 GtkTreeIter               *iter,
                                                                                 const PeasPluginInfo      *info);
G_END_DECLS

#endif /* __PEAS_GTK_PLUGIN_MANAGER_STORE_H__  */