Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:54

0001 /*
0002  * Copyright © 2010 Codethink Limited
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-or-later
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Lesser General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2.1 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Lesser General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Lesser General
0017  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0018  *
0019  * Authors: Ryan Lortie <desrt@desrt.ca>
0020  */
0021 
0022 #ifndef __G_ACTION_GROUP_H__
0023 #define __G_ACTION_GROUP_H__
0024 
0025 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0026 #error "Only <gio/gio.h> can be included directly."
0027 #endif
0028 
0029 #include <gio/giotypes.h>
0030 
0031 G_BEGIN_DECLS
0032 
0033 
0034 #define G_TYPE_ACTION_GROUP                                 (g_action_group_get_type ())
0035 #define G_ACTION_GROUP(inst)                                (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
0036                                                              G_TYPE_ACTION_GROUP, GActionGroup))
0037 #define G_IS_ACTION_GROUP(inst)                             (G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
0038                                                              G_TYPE_ACTION_GROUP))
0039 #define G_ACTION_GROUP_GET_IFACE(inst)                      (G_TYPE_INSTANCE_GET_INTERFACE ((inst),                  \
0040                                                              G_TYPE_ACTION_GROUP, GActionGroupInterface))
0041 
0042 typedef struct _GActionGroupInterface                       GActionGroupInterface;
0043 
0044 struct _GActionGroupInterface
0045 {
0046   GTypeInterface g_iface;
0047 
0048   /* virtual functions */
0049   gboolean              (* has_action)                 (GActionGroup  *action_group,
0050                                                         const gchar   *action_name);
0051 
0052   gchar **              (* list_actions)               (GActionGroup  *action_group);
0053 
0054   gboolean              (* get_action_enabled)         (GActionGroup  *action_group,
0055                                                         const gchar   *action_name);
0056 
0057   const GVariantType *  (* get_action_parameter_type)  (GActionGroup  *action_group,
0058                                                         const gchar   *action_name);
0059 
0060   const GVariantType *  (* get_action_state_type)      (GActionGroup  *action_group,
0061                                                         const gchar   *action_name);
0062 
0063   GVariant *            (* get_action_state_hint)      (GActionGroup  *action_group,
0064                                                         const gchar   *action_name);
0065 
0066   GVariant *            (* get_action_state)           (GActionGroup  *action_group,
0067                                                         const gchar   *action_name);
0068 
0069   void                  (* change_action_state)        (GActionGroup  *action_group,
0070                                                         const gchar   *action_name,
0071                                                         GVariant      *value);
0072 
0073   void                  (* activate_action)            (GActionGroup  *action_group,
0074                                                         const gchar   *action_name,
0075                                                         GVariant      *parameter);
0076 
0077   /* signals */
0078   void                  (* action_added)               (GActionGroup  *action_group,
0079                                                         const gchar   *action_name);
0080   void                  (* action_removed)             (GActionGroup  *action_group,
0081                                                         const gchar   *action_name);
0082   void                  (* action_enabled_changed)     (GActionGroup  *action_group,
0083                                                         const gchar   *action_name,
0084                                                         gboolean       enabled);
0085   void                  (* action_state_changed)       (GActionGroup   *action_group,
0086                                                         const gchar    *action_name,
0087                                                         GVariant       *state);
0088 
0089   /* more virtual functions */
0090   gboolean              (* query_action)               (GActionGroup        *action_group,
0091                                                         const gchar         *action_name,
0092                                                         gboolean            *enabled,
0093                                                         const GVariantType **parameter_type,
0094                                                         const GVariantType **state_type,
0095                                                         GVariant           **state_hint,
0096                                                         GVariant           **state);
0097 };
0098 
0099 GIO_AVAILABLE_IN_ALL
0100 GType                   g_action_group_get_type                         (void) G_GNUC_CONST;
0101 
0102 GIO_AVAILABLE_IN_ALL
0103 gboolean                g_action_group_has_action                       (GActionGroup *action_group,
0104                                                                          const gchar  *action_name);
0105 GIO_AVAILABLE_IN_ALL
0106 gchar **                g_action_group_list_actions                     (GActionGroup *action_group);
0107 
0108 GIO_AVAILABLE_IN_ALL
0109 const GVariantType *    g_action_group_get_action_parameter_type        (GActionGroup *action_group,
0110                                                                          const gchar  *action_name);
0111 GIO_AVAILABLE_IN_ALL
0112 const GVariantType *    g_action_group_get_action_state_type            (GActionGroup *action_group,
0113                                                                          const gchar  *action_name);
0114 GIO_AVAILABLE_IN_ALL
0115 GVariant *              g_action_group_get_action_state_hint            (GActionGroup *action_group,
0116                                                                          const gchar  *action_name);
0117 
0118 GIO_AVAILABLE_IN_ALL
0119 gboolean                g_action_group_get_action_enabled               (GActionGroup *action_group,
0120                                                                          const gchar  *action_name);
0121 
0122 GIO_AVAILABLE_IN_ALL
0123 GVariant *              g_action_group_get_action_state                 (GActionGroup *action_group,
0124                                                                          const gchar  *action_name);
0125 GIO_AVAILABLE_IN_ALL
0126 void                    g_action_group_change_action_state              (GActionGroup *action_group,
0127                                                                          const gchar  *action_name,
0128                                                                          GVariant     *value);
0129 
0130 GIO_AVAILABLE_IN_ALL
0131 void                    g_action_group_activate_action                  (GActionGroup *action_group,
0132                                                                          const gchar  *action_name,
0133                                                                          GVariant     *parameter);
0134 
0135 /* signals */
0136 GIO_AVAILABLE_IN_ALL
0137 void                    g_action_group_action_added                     (GActionGroup *action_group,
0138                                                                          const gchar  *action_name);
0139 GIO_AVAILABLE_IN_ALL
0140 void                    g_action_group_action_removed                   (GActionGroup *action_group,
0141                                                                          const gchar  *action_name);
0142 GIO_AVAILABLE_IN_ALL
0143 void                    g_action_group_action_enabled_changed           (GActionGroup *action_group,
0144                                                                          const gchar  *action_name,
0145                                                                          gboolean      enabled);
0146 
0147 GIO_AVAILABLE_IN_ALL
0148 void                    g_action_group_action_state_changed             (GActionGroup *action_group,
0149                                                                          const gchar  *action_name,
0150                                                                          GVariant     *state);
0151 
0152 GIO_AVAILABLE_IN_2_32
0153 gboolean                g_action_group_query_action                     (GActionGroup        *action_group,
0154                                                                          const gchar         *action_name,
0155                                                                          gboolean            *enabled,
0156                                                                          const GVariantType **parameter_type,
0157                                                                          const GVariantType **state_type,
0158                                                                          GVariant           **state_hint,
0159                                                                          GVariant           **state) G_GNUC_WARN_UNUSED_RESULT;
0160 
0161 G_END_DECLS
0162 
0163 #endif /* __G_ACTION_GROUP_H__ */