1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """Criterion that can be used create policy to accept/discard dragged
17 content."""
18
19
21 """Criterion that can be used create policy to accept/discard dragged
22 content (presented by L{Transferable}).
23
24 The drag and drop mechanism will verify the criteria returned by
25 L{DropHandler.getAcceptCriterion} before calling L{DropHandler.drop}.
26
27 The criteria can be evaluated either on the client (browser - see
28 L{ClientSideCriterion}) or on the server (see L{ServerSideCriterion}).
29 If no constraints are needed, an L{AcceptAll} can be used.
30
31 In addition to accepting or rejecting a possible drop, criteria can provide
32 additional hints for client side painting.
33
34 @see: L{DropHandler}
35 @see: L{ClientSideCriterion}
36 @see: L{ServerSideCriterion}
37 """
38
40 """Returns whether the criteria can be checked on the client or whether
41 a server request is needed to check the criteria.
42
43 This requirement may depend on the state of the criterion (e.g. logical
44 operations between criteria), so this cannot be based on a marker
45 interface.
46 """
47 raise NotImplementedError
48
49
51 raise NotImplementedError
52
53
55 """This needs to be implemented iff criterion does some lazy server
56 side initialization. The UIDL painted in this method will be passed to
57 client side drop handler implementation. Implementation can assume that
58 L{accept} is called before this method.
59 """
60 raise NotImplementedError
61
62
64 """Validates the data in event to be appropriate for the
65 L{DropHandler.drop} method.
66
67 Note that even if your criterion is validated on client side, you
68 should always validate the data on server side too.
69 """
70 raise NotImplementedError
71