include/alp/emoticon_parser.h File Reference


Detailed Description

Alp Emoticon Parser Public header file for the Emoticon Parser API.

#include <glib.h>
#include <alp/bundlemgr.h>

Go to the source code of this file.

Data Structures

struct  _AlpEmoticonRef

Typedefs

typedef _AlpEmoticonRef AlpEmoticonRef

Functions

void alp_emoticon_free (AlpEmoticonRef *ioSelfP)
AlpEmoticonRefalp_emoticon_init (const char *iBundleNameP)
void alp_emoticon_insert_in_textview (const AlpEmoticonRef *iSelfP, GtkTextView *iTextViewP, const gchar *iTextP, const gchar *iTagP)


Typedef Documentation

typedef struct _AlpEmoticonRef AlpEmoticonRef
 

This API allows to display an emoticon image instead of an emoticon shortcut text (":)" for example) in a GtkTextView. The emoticons are stored in a bundle. At the root of the bundle resource directory must lies a description file called "emoticons.ini". This description file contains the base path where are stored all the emoticons. This file also lists the association between the emoticons and their shortcut texts. Example:

 [path]
 base=rsc/images/icons/17x17/emoticons/
 
 [emoticons]
 angel_17x17.png=(A) (a)
 angry_17x17.png=:-@ :@

To use this API, you must first load this description file into memory. this is done with alp_emoticon_init().

Then, you can start adding text that potentially contains emoticons shortcut text as defined in the description file. To add text in to a given GtkTextView, you must use alp_emoticon_insert_in_textview().

When you're done adding text into the GtkTextView, you must free the emoticon parser context with alp_emoticon_free().


Function Documentation

void alp_emoticon_free AlpEmoticonRef ioSelfP  ) 
 

Free the emoticon parser

Parameters:
[in/out] ioSelfP the reference to the emoticon parser

AlpEmoticonRef* alp_emoticon_init const char *  iBundleNameP  ) 
 

Initialize the emoticon parser The returned pointer will have to be freed with alp_emoticon_free()

Parameters:
[in] iBundleNameP name of the bundle where are stored the emoticons to recognize
Returns:
a reference to the emoticon parser

void alp_emoticon_insert_in_textview const AlpEmoticonRef iSelfP,
GtkTextView *  iTextViewP,
const gchar *  iTextP,
const gchar *  iTagP
 

This function inserts a text in the text buffer associated to the given text view. The text is parsed to detect the emoticon shortcut texts and replace them by the proper emoticon icon.

Parameters:
[in] iSelfP the reference to the emoticon parser
[in] iTextViewP the text view
[in] iTextP the text to parse and insert in the text buffer
[in] iTagP an optional tag for the text insert in the text buffer


Generated on Wed Jul 30 07:06:40 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.