Orcus
css_types.hpp
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 */
7
8#ifndef INCLUDED_ORCUS_CSS_TYPES_HPP
9#define INCLUDED_ORCUS_CSS_TYPES_HPP
10
11#include "orcus/env.hpp"
12#include <cstdlib>
13#include <inttypes.h>
14#include <string>
15
16namespace orcus { namespace css {
17
18enum class combinator_t
19{
20 descendant,
21 direct_child,
22 next_sibling
23};
24
28enum class property_function_t
29{
30 unknown = 0,
31 hsl,
32 hsla,
33 rgb,
34 rgba,
35 url
36};
37
38enum class property_value_t
39{
40 none = 0,
41 string,
42 hsl,
43 hsla,
44 rgb,
45 rgba,
46 url
47};
48
49typedef uint16_t pseudo_element_t;
50typedef uint64_t pseudo_class_t;
51
52ORCUS_PSR_DLLPUBLIC extern const pseudo_element_t pseudo_element_after;
53ORCUS_PSR_DLLPUBLIC extern const pseudo_element_t pseudo_element_before;
54ORCUS_PSR_DLLPUBLIC extern const pseudo_element_t pseudo_element_first_letter;
55ORCUS_PSR_DLLPUBLIC extern const pseudo_element_t pseudo_element_first_line;
56ORCUS_PSR_DLLPUBLIC extern const pseudo_element_t pseudo_element_selection;
57ORCUS_PSR_DLLPUBLIC extern const pseudo_element_t pseudo_element_backdrop;
58
59ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_active;
60ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_checked;
61ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_default;
62ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_dir;
63ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_disabled;
64ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_empty;
65ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_enabled;
66ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_first;
67ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_first_child;
68ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_first_of_type;
69ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_fullscreen;
70ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_focus;
71ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_hover;
72ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_indeterminate;
73ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_in_range;
74ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_invalid;
75ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_lang;
76ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_last_child;
77ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_last_of_type;
78ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_left;
79ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_link;
80ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_not;
81ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_nth_child;
82ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_nth_last_child;
83ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_nth_last_of_type;
84ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_nth_of_type;
85ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_only_child;
86ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_only_of_type;
87ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_optional;
88ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_out_of_range;
89ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_read_only;
90ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_read_write;
91ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_required;
92ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_right;
93ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_root;
94ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_scope;
95ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_target;
96ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_valid;
97ORCUS_PSR_DLLPUBLIC extern const pseudo_class_t pseudo_class_visited;
98
103ORCUS_PSR_DLLPUBLIC pseudo_element_t to_pseudo_element(const char* p, size_t n);
104
109ORCUS_PSR_DLLPUBLIC pseudo_class_t to_pseudo_class(const char* p, size_t n);
110
111ORCUS_PSR_DLLPUBLIC std::string pseudo_class_to_string(pseudo_class_t val);
112
113ORCUS_PSR_DLLPUBLIC property_function_t to_property_function(const char* p, size_t n);
114
115}}
116
117#endif
118
119/* vim:set shiftwidth=4 softtabstop=4 expandtab: */