1: <?php
2: /**
3: * PHP version 5
4: * @package generalDriver
5: * @author Christian Schiffler <c.schiffler@cyberspectrum.de>
6: * @author Stefan Heimes <stefan_heimes@hotmail.com>
7: * @author Tristan Lins <tristan.lins@bit3.de>
8: * @copyright The MetaModels team.
9: * @license LGPL.
10: * @filesource
11: */
12:
13: namespace DcGeneral\Clipboard;
14:
15: /**
16: * Interface ClipboardInterface.
17: *
18: * This interface describes the internal clipboard of DcGeneral.
19: * The implementing class will store the values persistent to the input provider stored in the environment.
20: *
21: * @package DcGeneral\Clipboard
22: */
23: interface ClipboardInterface
24: {
25: /**
26: * Clipboard is in copy mode.
27: */
28: const MODE_COPY = 'copy';
29:
30: /**
31: * Clipboard is in cut mode.
32: */
33: const MODE_CUT = 'cut';
34:
35: /**
36: * Clipboard is in create mode.
37: */
38: const MODE_CREATE = 'create';
39:
40: /**
41: * Load the content of the clipboard from the input provider stored in the environment.
42: *
43: * @param \DcGeneral\EnvironmentInterface $objEnvironment The environment where the input provider will retrieve the
44: * values from.
45: *
46: * @return mixed
47: */
48: public function loadFrom($objEnvironment);
49:
50: /**
51: * Save the content of the clipboard to the input provider stored in the environment.
52: *
53: * @param \DcGeneral\EnvironmentInterface $objEnvironment The environment where the input provider will store the
54: * values to.
55: *
56: * @return mixed
57: */
58: public function saveTo($objEnvironment);
59:
60: /**
61: * Clear the content of the clipboard.
62: *
63: * @return ClipboardInterface
64: */
65: public function clear();
66:
67: /**
68: * Determine if the clipboard is empty.
69: *
70: * @return bool
71: */
72: public function isEmpty();
73:
74: /**
75: * Determine if the clipboard is not empty.
76: *
77: * @return bool
78: */
79: public function isNotEmpty();
80:
81: /**
82: * Determine if the content in the clipboard shall be cut.
83: *
84: * @return bool
85: */
86: public function isCut();
87:
88: /**
89: * Determine if the content in the clipboard shall be copied.
90: *
91: * @return bool
92: */
93: public function isCopy();
94:
95: /**
96: * Determine if the content in the clipboard is a new item to be created.
97: *
98: * @return bool
99: */
100: public function isCreate();
101:
102: /**
103: * Set the clipboard to copy mode and copy the given ids.
104: *
105: * @param array|mixed $ids The id or ids to be copied.
106: *
107: * @return ClipboardInterface
108: */
109: public function copy($ids);
110:
111: /**
112: * Set the clipboard to cut mode and cut the given ids.
113: *
114: * @param array|mixed $ids The id or ids to be cut.
115: *
116: * @return ClipboardInterface
117: */
118: public function cut($ids);
119:
120: /**
121: * Set the clipboard to create mode for a child of the given parent data set.
122: *
123: * @param mixed $parentId The id of the parent data set.
124: *
125: * @return ClipboardInterface
126: */
127: public function create($parentId);
128:
129: /**
130: * Set the ids contained in the clipboard.
131: *
132: * @param array $arrIds The list of ids.
133: *
134: * @return ClipboardInterface
135: */
136: public function setContainedIds($arrIds);
137:
138: /**
139: * Retrieve the ids contained in the clipboard.
140: *
141: * @return array
142: */
143: public function getContainedIds();
144:
145: /**
146: * Set the ids ignored in the clipboard as they would create a circular reference when pasting.
147: *
148: * @param array $arrIds The list of ids.
149: *
150: * @return ClipboardInterface
151: */
152: public function setCircularIds($arrIds);
153:
154: /**
155: * Retrieve the ids ignored in the clipboard as they would create a circular reference when pasting.
156: *
157: * @return array
158: */
159: public function getCircularIds();
160:
161: /**
162: * Retrieve the current mode of the clipboard.
163: *
164: * @return string Either cut|paste|mode
165: */
166: public function getMode();
167: }
168: