1 #ifndef LH_MEDIA_QUERY_H
2 #define LH_MEDIA_QUERY_H
6 struct media_query_expression
8 typedef std::vector
<media_query_expression
> vector
;
14 media_query_expression()
16 check_as_bool
= false;
17 feature
= media_feature_none
;
22 bool check(const media_features
& features
) const;
28 typedef std::shared_ptr
<media_query
> ptr
;
29 typedef std::vector
<media_query::ptr
> vector
;
31 media_query_expression::vector m_expressions
;
33 media_type m_media_type
;
36 media_query(const media_query
& val
);
38 static media_query::ptr
create_from_string(const string
& str
, const std::shared_ptr
<document
>& doc
);
39 bool check(const media_features
& features
) const;
42 class media_query_list
45 typedef std::shared_ptr
<media_query_list
> ptr
;
46 typedef std::vector
<media_query_list::ptr
> vector
;
48 media_query::vector m_queries
;
52 media_query_list(const media_query_list
& val
);
54 static media_query_list::ptr
create_from_string(const string
& str
, const std::shared_ptr
<document
>& doc
);
56 bool apply_media_features(const media_features
& features
); // returns true if the m_is_used changed
59 inline media_query_list::media_query_list(const media_query_list
& val
)
61 m_is_used
= val
.m_is_used
;
62 m_queries
= val
.m_queries
;
65 inline media_query_list::media_query_list()
70 inline bool media_query_list::is_used() const
77 #endif // LH_MEDIA_QUERY_H