PIKApp/libpikabase/pikachoice.h

74 lines
3.0 KiB
C

/* LIBPIKA - The PIKA Library
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* pikachoice.h
* Copyright (C) 2023 Jehan
*
* 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 3 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, see
* <https://www.gnu.org/licenses/>.
*/
#if !defined (__PIKA_BASE_H_INSIDE__) && !defined (PIKA_BASE_COMPILATION)
#error "Only <libpikabase/pikabase.h> can be included directly."
#endif
#ifndef __PIKA_CHOICE_H__
#define __PIKA_CHOICE_H__
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#define PIKA_TYPE_CHOICE (pika_choice_get_type ())
G_DECLARE_FINAL_TYPE (PikaChoice, pika_choice, PIKA, CHOICE, GObject)
PikaChoice * pika_choice_new (void);
PikaChoice * pika_choice_new_with_values (const gchar *nick,
gint id,
const gchar *label,
const gchar *help,
...) G_GNUC_NULL_TERMINATED;
void pika_choice_add (PikaChoice *choice,
const gchar *nick,
gint id,
const gchar *label,
const gchar *help);
gboolean pika_choice_is_valid (PikaChoice *choice,
const gchar *nick);
GList * pika_choice_list_nicks (PikaChoice *choice);
gint pika_choice_get_id (PikaChoice *choice,
const gchar *nick);
const gchar * pika_choice_get_label (PikaChoice *choice,
const gchar *nick);
const gchar * pika_choice_get_help (PikaChoice *choice,
const gchar *nick);
gboolean pika_choice_get_documentation (PikaChoice *choice,
const gchar *nick,
const gchar **label,
const gchar **help);
void pika_choice_set_sensitive (PikaChoice *choice,
const gchar *nick,
gboolean sensitive);
G_END_DECLS
#endif /* __PIKA_CHOICE_H__ */