|
1 ### -*- coding: utf-8 -*- #################################################### |
|
2 ############################################################################## |
|
3 # |
|
4 # Copyright (c) 2008-2013 Thierry Florac <tflorac AT ulthar.net> |
|
5 # All Rights Reserved. |
|
6 # |
|
7 # This software is subject to the provisions of the Zope Public License, |
|
8 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. |
|
9 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
|
10 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
11 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
|
12 # FOR A PARTICULAR PURPOSE. |
|
13 # |
|
14 ############################################################################## |
|
15 |
|
16 __docformat__ = "restructuredtext" |
|
17 |
|
18 # import standard packages |
|
19 |
|
20 # import Zope3 interfaces |
|
21 |
|
22 # import local interfaces |
|
23 |
|
24 # import Zope3 packages |
|
25 from zope.interface import Interface, Attribute |
|
26 from zope.schema import List, Object |
|
27 |
|
28 # import local packages |
|
29 |
|
30 from ztfy.baseskin import _ |
|
31 |
|
32 |
|
33 class IBaseMeta(Interface): |
|
34 """Base meta header interface""" |
|
35 |
|
36 def render(self): |
|
37 """Render given meta header""" |
|
38 |
|
39 |
|
40 class IHTTPEquivMetaHeader(IBaseMeta): |
|
41 """HTTP-Equiv meta header interface""" |
|
42 |
|
43 http_equiv = Attribute(_("HTTP equiv header")) |
|
44 |
|
45 value = Attribute(_("Meta content value")) |
|
46 |
|
47 |
|
48 class IContentMetaHeader(IBaseMeta): |
|
49 """Content meta header interface""" |
|
50 |
|
51 name = Attribute(_("Meta name")) |
|
52 |
|
53 value = Attribute(_("Meta content value")) |
|
54 |
|
55 |
|
56 class IPropertyMetaHeader(IBaseMeta): |
|
57 """Property meta header interface""" |
|
58 |
|
59 property = Attribute(_("Meta property")) |
|
60 |
|
61 value = Attribute(_("Meta content value")) |
|
62 |
|
63 |
|
64 class ILinkMetaHeader(IBaseMeta): |
|
65 """Link meta header interface""" |
|
66 |
|
67 rel = Attribute(_("Meta rel attribute")) |
|
68 |
|
69 type = Attribute(_("Meta type attribute")) |
|
70 |
|
71 href = Attribute(_("Meta link target")) |
|
72 |
|
73 |
|
74 class IContentMetasHeaders(Interface): |
|
75 """Content metas headers interface""" |
|
76 |
|
77 metas = List(title=_("Metas list"), |
|
78 description=_("Full list of metas associated with this content"), |
|
79 value_type=Object(schema=IContentMetaHeader)) |
|
80 |
|
81 |
|
82 class IPageMetasHeaders(Interface): |
|
83 """Full list of metas headers for given content""" |
|
84 |
|
85 metas = List(title=_("Metas list"), |
|
86 description=_("Full list of metas associated with this content"), |
|
87 value_type=Object(schema=IContentMetaHeader)) |