Merge pull request #3196 from techee/anon_rename_fix2
[geany-mirror.git] / src / encodingsprivate.h
blob7baf5d9b9eae2d80f623743b6b6d35603365fd7c
1 /*
2 * encodingsprivate.h - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2005 The Geany contributors
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef ENCODINGSPRIVATE_H
22 #define ENCODINGSPRIVATE_H
24 #include "encodings.h"
26 /* Groups of encodings */
27 typedef enum
29 NONE = 0,
30 WESTEUROPEAN,
31 EASTEUROPEAN,
32 EASTASIAN,
33 ASIAN,
34 MIDDLEEASTERN,
35 UNICODE,
37 GEANY_ENCODING_GROUPS_MAX
39 GeanyEncodingGroup;
41 /* Structure to represent an encoding to be used in Geany. */
42 typedef struct GeanyEncoding
44 GeanyEncodingIndex idx; /* The index of the encoding inside globa encodes array.*/
45 gint order; /* Internally used member for grouping */
46 GeanyEncodingGroup group; /* Internally used member for grouping */
47 const gchar *charset; /* String representation of the encoding, e.g. "ISO-8859-3" */
48 const gchar *name; /* Translatable and descriptive name of the encoding, e.g. "South European" */
50 GeanyEncoding;
52 const GeanyEncoding* encodings_get_from_charset(const gchar *charset);
53 const GeanyEncoding* encodings_get_from_index(gint idx);
55 gchar* encodings_to_string(const GeanyEncoding* enc);
56 const gchar* encodings_get_charset(const GeanyEncoding* enc);
58 void encodings_select_radio_item(const gchar *charset);
60 void encodings_init(void);
61 void encodings_finalize(void);
63 GtkTreeStore *encodings_encoding_store_new(gboolean has_detect);
65 gint encodings_encoding_store_get_encoding(GtkTreeStore *store, GtkTreeIter *iter);
67 gboolean encodings_encoding_store_get_iter(GtkTreeStore *store, GtkTreeIter *iter, gint enc);
69 void encodings_encoding_store_cell_data_func(GtkCellLayout *cell_layout, GtkCellRenderer *cell,
70 GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data);
72 gboolean encodings_is_unicode_charset(const gchar *string);
74 gboolean encodings_convert_to_utf8_auto(gchar **buf, gsize *size, const gchar *forced_enc,
75 gchar **used_encoding, gboolean *has_bom, gboolean *partial);
77 GeanyEncodingIndex encodings_scan_unicode_bom(const gchar *string, gsize len, guint *bom_len);
79 GeanyEncodingIndex encodings_get_idx_from_charset(const gchar *charset);
81 extern GeanyEncoding encodings[GEANY_ENCODINGS_MAX];
83 #endif /* ENCODINGSPRIVATE_H */