cr-om-parser.h 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
  2. /*
  3. * This file is part of The Croco Library
  4. *
  5. * Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of version 2.1 of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation.
  10. *
  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.
  15. *
  16. * You should have received a copy of the
  17. * GNU Lesser General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  20. * USA
  21. */
  22. /*
  23. *$Id$
  24. */
  25. #ifndef __CR_OM_PARSER_H__
  26. #define __CR_OM_PARSER_H__
  27. #include "cr-parser.h"
  28. #include "cr-cascade.h"
  29. /**
  30. *@file
  31. *The definition of the CSS Object Model Parser.
  32. *This parser uses (and sits) the SAC api of libcroco defined
  33. *in cr-parser.h and cr-doc-handler.h
  34. */
  35. G_BEGIN_DECLS
  36. typedef struct _CROMParser CROMParser ;
  37. typedef struct _CROMParserPriv CROMParserPriv ;
  38. /**
  39. *The Object model parser.
  40. *Can parse a css file and build a css object model.
  41. *This parser uses an instance of #CRParser and defines
  42. *a set of SAC callbacks to build the Object Model.
  43. */
  44. struct _CROMParser
  45. {
  46. CROMParserPriv *priv ;
  47. } ;
  48. CROMParser * cr_om_parser_new (CRInput *a_input) ;
  49. enum CRStatus cr_om_parser_simply_parse_file (const guchar *a_file_path,
  50. enum CREncoding a_enc,
  51. CRStyleSheet **a_result) ;
  52. enum CRStatus cr_om_parser_parse_file (CROMParser *a_this,
  53. const guchar *a_file_uri,
  54. enum CREncoding a_enc,
  55. CRStyleSheet **a_result) ;
  56. enum CRStatus cr_om_parser_simply_parse_buf (const guchar *a_buf,
  57. gulong a_len,
  58. enum CREncoding a_enc,
  59. CRStyleSheet **a_result) ;
  60. enum CRStatus cr_om_parser_parse_buf (CROMParser *a_this,
  61. const guchar *a_buf,
  62. gulong a_len,
  63. enum CREncoding a_enc,
  64. CRStyleSheet **a_result) ;
  65. enum CRStatus cr_om_parser_parse_paths_to_cascade (CROMParser *a_this,
  66. const guchar *a_author_path,
  67. const guchar *a_user_path,
  68. const guchar *a_ua_path,
  69. enum CREncoding a_encoding,
  70. CRCascade ** a_result) ;
  71. enum CRStatus cr_om_parser_simply_parse_paths_to_cascade (const guchar *a_author_path,
  72. const guchar *a_user_path,
  73. const guchar *a_ua_path,
  74. enum CREncoding a_encoding,
  75. CRCascade ** a_result) ;
  76. void cr_om_parser_destroy (CROMParser *a_this) ;
  77. G_END_DECLS
  78. #endif /*__CR_OM_PARSER_H__*/