aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-string-parser.h
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2010-03-03 22:31:45 +0800
committerXavier Claessens <xclaesse@gmail.com>2010-03-03 23:18:45 +0800
commitf48b89ce4d61d16843361636ad9f155451fde98d (patch)
treedd614718c641cfb6cf99bc725fc2dd11058b0ad8 /libempathy-gtk/empathy-string-parser.h
parentd6c60c80075fac5b34d23d37ec7826835fd02cd6 (diff)
downloadgsoc2013-empathy-f48b89ce4d61d16843361636ad9f155451fde98d.tar
gsoc2013-empathy-f48b89ce4d61d16843361636ad9f155451fde98d.tar.gz
gsoc2013-empathy-f48b89ce4d61d16843361636ad9f155451fde98d.tar.bz2
gsoc2013-empathy-f48b89ce4d61d16843361636ad9f155451fde98d.tar.lz
gsoc2013-empathy-f48b89ce4d61d16843361636ad9f155451fde98d.tar.xz
gsoc2013-empathy-f48b89ce4d61d16843361636ad9f155451fde98d.tar.zst
gsoc2013-empathy-f48b89ce4d61d16843361636ad9f155451fde98d.zip
Move empathy_string_parser API to its own file
Diffstat (limited to 'libempathy-gtk/empathy-string-parser.h')
-rw-r--r--libempathy-gtk/empathy-string-parser.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-string-parser.h b/libempathy-gtk/empathy-string-parser.h
new file mode 100644
index 000000000..696545b65
--- /dev/null
+++ b/libempathy-gtk/empathy-string-parser.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 Collabora Ltd.
+ *
+ * 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 2.1 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Authors: Xavier Claessens <xclaesse@gmail.com>
+ */
+
+#ifndef __EMPATHY_STRING_PARSER_H__
+#define __EMPATHY_STRING_PARSER_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef struct _EmpathyStringParser EmpathyStringParser;
+
+typedef void (*EmpathyStringReplace) (const gchar *text,
+ gssize len,
+ gpointer match_data,
+ gpointer user_data);
+typedef void (*EmpathyStringMatch) (const gchar *text,
+ gssize len,
+ EmpathyStringReplace replace_func,
+ EmpathyStringParser *sub_parsers,
+ gpointer user_data);
+
+struct _EmpathyStringParser {
+ EmpathyStringMatch match_func;
+ EmpathyStringReplace replace_func;
+};
+
+void
+empathy_string_parser_substr (const gchar *text,
+ gssize len,
+ EmpathyStringParser *parsers,
+ gpointer user_data);
+
+void
+empathy_string_match_link (const gchar *text,
+ gssize len,
+ EmpathyStringReplace replace_func,
+ EmpathyStringParser *sub_parsers,
+ gpointer user_data);
+
+void
+empathy_string_match_smiley (const gchar *text,
+ gssize len,
+ EmpathyStringReplace replace_func,
+ EmpathyStringParser *sub_parsers,
+ gpointer user_data);
+
+void
+empathy_string_match_all (const gchar *text,
+ gssize len,
+ EmpathyStringReplace replace_func,
+ EmpathyStringParser *sub_parsers,
+ gpointer user_data);
+
+G_END_DECLS
+
+#endif /* __EMPATHY_STRING_PARSER_H__ */