/* Encoding stuff */

/*
 * Copyright © 2002 Red Hat, Inc.
 *
 * 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 3 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, see <http://www.gnu.org/licenses/>.
 */

#ifndef TERMINAL_ENCODING_H
#define TERMINAL_ENCODING_H

#include <gtk/gtk.h>

#define TERMINAL_TYPE_ENCODING (terminal_encoding_get_type ())

typedef struct
{
  int   refcount;
  const char *charset; /* interned */
  char *name;
  guint valid            : 1;
  guint validity_checked : 1;
  guint is_custom        : 1;
  guint is_active        : 1;
} TerminalEncoding;

GType terminal_encoding_get_type (void);

TerminalEncoding *terminal_encoding_new (const char *charset,
                                         const char *display_name,
                                         gboolean is_custom,
                                         gboolean force_valid);

TerminalEncoding *terminal_encoding_ref (TerminalEncoding *encoding);

void terminal_encoding_unref (TerminalEncoding *encoding);

gboolean terminal_encoding_is_valid (TerminalEncoding *encoding);

const char *terminal_encoding_get_charset (TerminalEncoding *encoding);

GHashTable *terminal_encodings_get_builtins (void);

#endif /* TERMINAL_ENCODING_H */
