|
1 # |
|
2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net> |
|
3 # All Rights Reserved. |
|
4 # |
|
5 # This software is subject to the provisions of the Zope Public License, |
|
6 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. |
|
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
|
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
|
10 # FOR A PARTICULAR PURPOSE. |
|
11 # |
|
12 |
|
13 __docformat__ = 'restructuredtext' |
|
14 |
|
15 # import standard library |
|
16 |
|
17 # import interfaces |
|
18 from zope.container.interfaces import IContainer |
|
19 |
|
20 # import packages |
|
21 from zope.interface import Interface |
|
22 |
|
23 |
|
24 # |
|
25 # Containers interfaces |
|
26 # |
|
27 |
|
28 class IOrderedContainerOrder(Interface): |
|
29 """Ordered containers interface""" |
|
30 |
|
31 def updateOrder(self, order): |
|
32 """Reset items in given order |
|
33 |
|
34 @order: new ordered list of container's items keys |
|
35 """ |
|
36 |
|
37 def moveFirst(self, key): |
|
38 """Move item with given key to first position""" |
|
39 |
|
40 def moveUp(self, key): |
|
41 """Move item with given key one position up""" |
|
42 |
|
43 def moveDown(self, key): |
|
44 """Move item with given key one position down""" |
|
45 |
|
46 def moveLast(self, key): |
|
47 """Move item with given key to last position""" |
|
48 |
|
49 |
|
50 class IOrderedContainer(IContainer, IOrderedContainerOrder): |
|
51 """Marker interface for ordered containers""" |