Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

cr-doc-handler.c File Reference

The definition of the CRDocHandler class. More...

#include <string.h>
#include "cr-doc-handler.h"
#include "cr-parser.h"

Go to the source code of this file.

Data Structures

struct  _CRDocHandlerPriv

Defines

#define PRIVATE(obj)   (obj)->priv

Functions

CRDocHandlercr_doc_handler_new (void)
 Constructor of CRDocHandler.
enum CRStatus cr_doc_handler_get_ctxt (CRDocHandler *a_this, gpointer *a_ctxt)
 Returns the private parsing context.
enum CRStatus cr_doc_handler_set_ctxt (CRDocHandler *a_this, gpointer a_ctxt)
 Sets the private parsing context.
enum CRStatus cr_doc_handler_get_result (CRDocHandler *a_this, gpointer *a_result)
 Returns the private parsing result.
enum CRStatus cr_doc_handler_set_result (CRDocHandler *a_this, gpointer a_result)
 Sets the private parsing context.
enum CRStatus cr_doc_handler_set_default_sac_handler (CRDocHandler *a_this)
 Sets the sac handlers contained in the current instance of DocHandler to the default handlers.
void cr_doc_handler_ref (CRDocHandler *a_this)
 Increases the reference count of the doc handler.
gboolean cr_doc_handler_unref (CRDocHandler *a_this)
 Decreases the ref count of the current instance of CRDocHandler.
void cr_doc_handler_destroy (CRDocHandler *a_this)
 The destructor of the CRDocHandler class.
void cr_doc_handler_associate_a_parser (CRDocHandler *a_this, gpointer a_parser)
 Associates a parser to the current document handler.


Detailed Description

The definition of the CRDocHandler class.

Contains methods to instantiate, destroy, and initialyze instances of CRDocHandler to custom values.

Definition in file cr-doc-handler.c.


Define Documentation

#define PRIVATE obj   )     (obj)->priv
 

Definition at line 35 of file cr-doc-handler.c.


Function Documentation

void cr_doc_handler_associate_a_parser CRDocHandler a_this,
gpointer  a_parser
 

Associates a parser to the current document handler.

Parameters:
a_this the current instance of document handler.
a_parser the parser to associate.

Definition at line 245 of file cr-doc-handler.c.

References _CRDocHandlerPriv::parser, and PRIVATE.

void cr_doc_handler_destroy CRDocHandler a_this  ) 
 

The destructor of the CRDocHandler class.

Parameters:
a_this the instance of CRDocHandler to destroy.

Definition at line 228 of file cr-doc-handler.c.

Referenced by cr_doc_handler_unref(), and cr_parser_set_default_sac_handler().

enum CRStatus cr_doc_handler_get_ctxt CRDocHandler a_this,
gpointer *  a_ctxt
 

Returns the private parsing context.

The private parsing context is used by libcroco only.

Parameters:
a_this the current instance of CRDocHandler.
a_ctxt out parameter. The new parsing context.
Returns:
CR_OK upon successfull completion, an error code otherwise.

the parsing context, or NULL if an error occured.

Definition at line 97 of file cr-doc-handler.c.

References _CRDocHandlerPriv::context, and CR_BAD_PARAM_ERROR.

enum CRStatus cr_doc_handler_get_result CRDocHandler a_this,
gpointer *  a_result
 

Returns the private parsing result.

The private parsing result is used by libcroco only.

Parameters:
a_this the current instance of CRDocHandler
a_result out parameter. The returned result.
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 129 of file cr-doc-handler.c.

References CR_BAD_PARAM_ERROR, and _CRDocHandlerPriv::result.

Referenced by cr_om_parser_parse_buf(), cr_om_parser_parse_file(), cr_statement_at_media_rule_parse_from_buf(), cr_statement_at_page_rule_parse_from_buf(), cr_statement_font_face_rule_parse_from_buf(), and cr_statement_ruleset_parse_from_buf().

CRDocHandler* cr_doc_handler_new void   ) 
 

Constructor of CRDocHandler.

Returns:
the newly built instance of CRDocHandler

Definition at line 66 of file cr-doc-handler.c.

References cr_doc_handler_set_default_sac_handler(), cr_utils_trace_info, CRDocHandler, CRDocHandlerPriv, and _CRDocHandler::priv.

Referenced by cr_parser_set_default_sac_handler(), cr_statement_at_media_rule_parse_from_buf(), cr_statement_at_page_rule_parse_from_buf(), cr_statement_font_face_rule_parse_from_buf(), and cr_statement_ruleset_parse_from_buf().

void cr_doc_handler_ref CRDocHandler a_this  ) 
 

Increases the reference count of the doc handler.

Parameters:
a_this the current instance of CRDocHandler.

Definition at line 193 of file cr-doc-handler.c.

Referenced by cr_parser_set_sac_handler().

enum CRStatus cr_doc_handler_set_ctxt CRDocHandler a_this,
gpointer  a_ctxt
 

Sets the private parsing context.

This is used by libcroco only.

Parameters:
a_this the current instance of CRDocHandler
a_ctxt a pointer to the parsing context.
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 114 of file cr-doc-handler.c.

References _CRDocHandlerPriv::context, and CR_BAD_PARAM_ERROR.

enum CRStatus cr_doc_handler_set_default_sac_handler CRDocHandler a_this  ) 
 

Sets the sac handlers contained in the current instance of DocHandler to the default handlers.

For the time being the default handlers are test handlers. This is expected to change in a near future, when the libcroco gets a bit debugged.

Parameters:
a_this a pointer to the current instance of CRDocHandler.
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 164 of file cr-doc-handler.c.

References CR_BAD_PARAM_ERROR.

Referenced by cr_doc_handler_new(), and cr_parser_set_default_sac_handler().

enum CRStatus cr_doc_handler_set_result CRDocHandler a_this,
gpointer  a_result
 

Sets the private parsing context.

This is used by libcroco only.

Parameters:
a_this the current instance of CRDocHandler
a_result the new result.
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 146 of file cr-doc-handler.c.

References CR_BAD_PARAM_ERROR, and _CRDocHandlerPriv::result.

gboolean cr_doc_handler_unref CRDocHandler a_this  ) 
 

Decreases the ref count of the current instance of CRDocHandler.

If the ref count reaches '0' then, destroys the instance.

Parameters:
a_this the currrent instance of CRDocHandler.
Returns:
TRUE if the instance as been destroyed, FALSE otherwise.

Definition at line 207 of file cr-doc-handler.c.

References cr_doc_handler_destroy().

Referenced by cr_parser_destroy(), cr_parser_set_sac_handler(), cr_statement_at_media_rule_parse_from_buf(), cr_statement_at_page_rule_parse_from_buf(), cr_statement_font_face_rule_parse_from_buf(), and cr_statement_ruleset_parse_from_buf().


Generated on Fri Oct 29 08:29:13 2004 for Libcroco by  doxygen 1.3.9.1