|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
4 <html><head> |
|
5 <title>Plugin_Time_Tracker.TimeTracker.TimeTrackEntry</title> |
|
6 <style> |
|
7 body { |
|
8 background: #EDECE6; |
|
9 margin: 0em 1em 10em 1em; |
|
10 color: black; |
|
11 } |
|
12 |
|
13 h1 { color: white; background: #85774A; } |
|
14 h2 { color: white; background: #85774A; } |
|
15 h3 { color: white; background: #9D936E; } |
|
16 h4 { color: white; background: #9D936E; } |
|
17 |
|
18 a { color: #BA6D36; } |
|
19 |
|
20 </style> |
|
21 </head> |
|
22 <body><a NAME="top" ID="top"></a> |
|
23 <h1>Plugin_Time_Tracker.TimeTracker.TimeTrackEntry</h1> |
|
24 <p> |
|
25 Module implementing the time track entry class. |
|
26 </p> |
|
27 <h3>Global Attributes</h3> |
|
28 <table> |
|
29 <tr><td>None</td></tr> |
|
30 </table> |
|
31 <h3>Classes</h3> |
|
32 <table> |
|
33 <tr> |
|
34 <td><a href="#TimeTrackEntry">TimeTrackEntry</a></td> |
|
35 <td>Class implementing the time track entry.</td> |
|
36 </tr> |
|
37 </table> |
|
38 <h3>Functions</h3> |
|
39 <table> |
|
40 <tr><td>None</td></tr> |
|
41 </table> |
|
42 <hr /><hr /> |
|
43 <a NAME="TimeTrackEntry" ID="TimeTrackEntry"></a> |
|
44 <h2>TimeTrackEntry</h2> |
|
45 <p> |
|
46 Class implementing the time track entry. |
|
47 </p> |
|
48 <h3>Derived from</h3> |
|
49 object |
|
50 <h3>Class Attributes</h3> |
|
51 <table> |
|
52 <tr><td>LineMarker</td></tr><tr><td>Separator</td></tr> |
|
53 </table> |
|
54 <h3>Class Methods</h3> |
|
55 <table> |
|
56 <tr><td>None</td></tr> |
|
57 </table> |
|
58 <h3>Methods</h3> |
|
59 <table> |
|
60 <tr> |
|
61 <td><a href="#TimeTrackEntry.__init__">TimeTrackEntry</a></td> |
|
62 <td>Constructor</td> |
|
63 </tr><tr> |
|
64 <td><a href="#TimeTrackEntry.__calculateDuration">__calculateDuration</a></td> |
|
65 <td>Private method to calculate the duration in minutes.</td> |
|
66 </tr><tr> |
|
67 <td><a href="#TimeTrackEntry.__currentDateTime">__currentDateTime</a></td> |
|
68 <td>Private method to get the current date and time without milliseconds.</td> |
|
69 </tr><tr> |
|
70 <td><a href="#TimeTrackEntry.__lt__">__lt__</a></td> |
|
71 <td>Special method implementing the less than function.</td> |
|
72 </tr><tr> |
|
73 <td><a href="#TimeTrackEntry.addDuration">addDuration</a></td> |
|
74 <td>Public method to add a duration.</td> |
|
75 </tr><tr> |
|
76 <td><a href="#TimeTrackEntry.continue_">continue_</a></td> |
|
77 <td>Public method to continue the entry.</td> |
|
78 </tr><tr> |
|
79 <td><a href="#TimeTrackEntry.fromString">fromString</a></td> |
|
80 <td>Public method to populate the entry from the given string.</td> |
|
81 </tr><tr> |
|
82 <td><a href="#TimeTrackEntry.getComment">getComment</a></td> |
|
83 <td>Public method to get the comment.</td> |
|
84 </tr><tr> |
|
85 <td><a href="#TimeTrackEntry.getDuration">getDuration</a></td> |
|
86 <td>Public slot to get the duration.</td> |
|
87 </tr><tr> |
|
88 <td><a href="#TimeTrackEntry.getEntryData">getEntryData</a></td> |
|
89 <td>Public method to get the entry data.</td> |
|
90 </tr><tr> |
|
91 <td><a href="#TimeTrackEntry.getID">getID</a></td> |
|
92 <td>Public method to get the ID of the entry.</td> |
|
93 </tr><tr> |
|
94 <td><a href="#TimeTrackEntry.getStartDateTime">getStartDateTime</a></td> |
|
95 <td>Public method to get the start date and time.</td> |
|
96 </tr><tr> |
|
97 <td><a href="#TimeTrackEntry.getTask">getTask</a></td> |
|
98 <td>Public method to get the task description.</td> |
|
99 </tr><tr> |
|
100 <td><a href="#TimeTrackEntry.isPaused">isPaused</a></td> |
|
101 <td>Public method to check for a paused state.</td> |
|
102 </tr><tr> |
|
103 <td><a href="#TimeTrackEntry.isValid">isValid</a></td> |
|
104 <td>Public method to check the validity of the entry.</td> |
|
105 </tr><tr> |
|
106 <td><a href="#TimeTrackEntry.pause">pause</a></td> |
|
107 <td>Public method to pause the entry.</td> |
|
108 </tr><tr> |
|
109 <td><a href="#TimeTrackEntry.setComment">setComment</a></td> |
|
110 <td>Public method to set a comment.</td> |
|
111 </tr><tr> |
|
112 <td><a href="#TimeTrackEntry.setDuration">setDuration</a></td> |
|
113 <td>Public method to set the duration.</td> |
|
114 </tr><tr> |
|
115 <td><a href="#TimeTrackEntry.setID">setID</a></td> |
|
116 <td>Public method to assign an ID to the entry.</td> |
|
117 </tr><tr> |
|
118 <td><a href="#TimeTrackEntry.setStartDateTime">setStartDateTime</a></td> |
|
119 <td>Public method to set the start date and time.</td> |
|
120 </tr><tr> |
|
121 <td><a href="#TimeTrackEntry.setTask">setTask</a></td> |
|
122 <td>Public method to set the task description.</td> |
|
123 </tr><tr> |
|
124 <td><a href="#TimeTrackEntry.start">start</a></td> |
|
125 <td>Public method to set the start time of this entry.</td> |
|
126 </tr><tr> |
|
127 <td><a href="#TimeTrackEntry.stop">stop</a></td> |
|
128 <td>Public method to stop this entry.</td> |
|
129 </tr><tr> |
|
130 <td><a href="#TimeTrackEntry.toString">toString</a></td> |
|
131 <td>Public method to get a string representation of the entry.</td> |
|
132 </tr> |
|
133 </table> |
|
134 <h3>Static Methods</h3> |
|
135 <table> |
|
136 <tr><td>None</td></tr> |
|
137 </table> |
|
138 <a NAME="TimeTrackEntry.__init__" ID="TimeTrackEntry.__init__"></a> |
|
139 <h4>TimeTrackEntry (Constructor)</h4> |
|
140 <b>TimeTrackEntry</b>(<i>plugin</i>) |
|
141 <p> |
|
142 Constructor |
|
143 </p><dl> |
|
144 <dt><i>plugin</i></dt> |
|
145 <dd> |
|
146 reference to the plugin object (TimeTrackerPlugin) |
|
147 </dd> |
|
148 </dl><a NAME="TimeTrackEntry.__calculateDuration" ID="TimeTrackEntry.__calculateDuration"></a> |
|
149 <h4>TimeTrackEntry.__calculateDuration</h4> |
|
150 <b>__calculateDuration</b>(<i>start, stop</i>) |
|
151 <p> |
|
152 Private method to calculate the duration in minutes. |
|
153 </p><dl> |
|
154 <dt><i>start</i></dt> |
|
155 <dd> |
|
156 start date and time (QDateTime) |
|
157 </dd><dt><i>stop</i></dt> |
|
158 <dd> |
|
159 end date and time (QDateTime) |
|
160 </dd> |
|
161 </dl><dl> |
|
162 <dt>Returns:</dt> |
|
163 <dd> |
|
164 duration in minutes (int) |
|
165 </dd> |
|
166 </dl><a NAME="TimeTrackEntry.__currentDateTime" ID="TimeTrackEntry.__currentDateTime"></a> |
|
167 <h4>TimeTrackEntry.__currentDateTime</h4> |
|
168 <b>__currentDateTime</b>(<i></i>) |
|
169 <p> |
|
170 Private method to get the current date and time without milliseconds. |
|
171 </p><dl> |
|
172 <dt>Returns:</dt> |
|
173 <dd> |
|
174 current date and time (QDateTime) |
|
175 </dd> |
|
176 </dl><a NAME="TimeTrackEntry.__lt__" ID="TimeTrackEntry.__lt__"></a> |
|
177 <h4>TimeTrackEntry.__lt__</h4> |
|
178 <b>__lt__</b>(<i>other</i>) |
|
179 <p> |
|
180 Special method implementing the less than function. |
|
181 </p><dl> |
|
182 <dt><i>other</i></dt> |
|
183 <dd> |
|
184 reference to the other object (TimeTrackEntry) |
|
185 </dd> |
|
186 </dl><a NAME="TimeTrackEntry.addDuration" ID="TimeTrackEntry.addDuration"></a> |
|
187 <h4>TimeTrackEntry.addDuration</h4> |
|
188 <b>addDuration</b>(<i>duration</i>) |
|
189 <p> |
|
190 Public method to add a duration. |
|
191 </p><dl> |
|
192 <dt><i>duration</i></dt> |
|
193 <dd> |
|
194 duration to be added in minutes (integer). Negative values |
|
195 are ignored. |
|
196 </dd> |
|
197 </dl><a NAME="TimeTrackEntry.continue_" ID="TimeTrackEntry.continue_"></a> |
|
198 <h4>TimeTrackEntry.continue_</h4> |
|
199 <b>continue_</b>(<i></i>) |
|
200 <p> |
|
201 Public method to continue the entry. |
|
202 </p><a NAME="TimeTrackEntry.fromString" ID="TimeTrackEntry.fromString"></a> |
|
203 <h4>TimeTrackEntry.fromString</h4> |
|
204 <b>fromString</b>(<i>line</i>) |
|
205 <p> |
|
206 Public method to populate the entry from the given string. |
|
207 </p><dl> |
|
208 <dt><i>line</i></dt> |
|
209 <dd> |
|
210 stringified entry data as generated by toString() (string) |
|
211 </dd> |
|
212 </dl><dl> |
|
213 <dt>Returns:</dt> |
|
214 <dd> |
|
215 ID of the tracker entry; -1 indicates an error (integer) |
|
216 </dd> |
|
217 </dl><a NAME="TimeTrackEntry.getComment" ID="TimeTrackEntry.getComment"></a> |
|
218 <h4>TimeTrackEntry.getComment</h4> |
|
219 <b>getComment</b>(<i></i>) |
|
220 <p> |
|
221 Public method to get the comment. |
|
222 </p><dl> |
|
223 <dt>Returns:</dt> |
|
224 <dd> |
|
225 comment (string) |
|
226 </dd> |
|
227 </dl><a NAME="TimeTrackEntry.getDuration" ID="TimeTrackEntry.getDuration"></a> |
|
228 <h4>TimeTrackEntry.getDuration</h4> |
|
229 <b>getDuration</b>(<i></i>) |
|
230 <p> |
|
231 Public slot to get the duration. |
|
232 </p><dl> |
|
233 <dt>Returns:</dt> |
|
234 <dd> |
|
235 duration (integer) |
|
236 </dd> |
|
237 </dl><a NAME="TimeTrackEntry.getEntryData" ID="TimeTrackEntry.getEntryData"></a> |
|
238 <h4>TimeTrackEntry.getEntryData</h4> |
|
239 <b>getEntryData</b>(<i></i>) |
|
240 <p> |
|
241 Public method to get the entry data. |
|
242 </p><dl> |
|
243 <dt>Returns:</dt> |
|
244 <dd> |
|
245 entry data as a tuple of start date (string), start time (string), |
|
246 duration (integer), task (string), comment (string) and flag indicating |
|
247 a paused state (boolean) |
|
248 </dd> |
|
249 </dl><a NAME="TimeTrackEntry.getID" ID="TimeTrackEntry.getID"></a> |
|
250 <h4>TimeTrackEntry.getID</h4> |
|
251 <b>getID</b>(<i></i>) |
|
252 <p> |
|
253 Public method to get the ID of the entry. |
|
254 </p><dl> |
|
255 <dt>Returns:</dt> |
|
256 <dd> |
|
257 ID of the entry (integer) |
|
258 </dd> |
|
259 </dl><a NAME="TimeTrackEntry.getStartDateTime" ID="TimeTrackEntry.getStartDateTime"></a> |
|
260 <h4>TimeTrackEntry.getStartDateTime</h4> |
|
261 <b>getStartDateTime</b>(<i></i>) |
|
262 <p> |
|
263 Public method to get the start date and time. |
|
264 </p><dl> |
|
265 <dt>Returns:</dt> |
|
266 <dd> |
|
267 start date and time (QDateTime) |
|
268 </dd> |
|
269 </dl><a NAME="TimeTrackEntry.getTask" ID="TimeTrackEntry.getTask"></a> |
|
270 <h4>TimeTrackEntry.getTask</h4> |
|
271 <b>getTask</b>(<i></i>) |
|
272 <p> |
|
273 Public method to get the task description. |
|
274 </p><dl> |
|
275 <dt>Returns:</dt> |
|
276 <dd> |
|
277 task description (string) |
|
278 </dd> |
|
279 </dl><a NAME="TimeTrackEntry.isPaused" ID="TimeTrackEntry.isPaused"></a> |
|
280 <h4>TimeTrackEntry.isPaused</h4> |
|
281 <b>isPaused</b>(<i></i>) |
|
282 <p> |
|
283 Public method to check for a paused state. |
|
284 </p><dl> |
|
285 <dt>Returns:</dt> |
|
286 <dd> |
|
287 flag indicating a paused state (boolean) |
|
288 </dd> |
|
289 </dl><a NAME="TimeTrackEntry.isValid" ID="TimeTrackEntry.isValid"></a> |
|
290 <h4>TimeTrackEntry.isValid</h4> |
|
291 <b>isValid</b>(<i></i>) |
|
292 <p> |
|
293 Public method to check the validity of the entry. |
|
294 </p><dl> |
|
295 <dt>Returns:</dt> |
|
296 <dd> |
|
297 validity of the entry (boolean) |
|
298 </dd> |
|
299 </dl><a NAME="TimeTrackEntry.pause" ID="TimeTrackEntry.pause"></a> |
|
300 <h4>TimeTrackEntry.pause</h4> |
|
301 <b>pause</b>(<i></i>) |
|
302 <p> |
|
303 Public method to pause the entry. |
|
304 </p><a NAME="TimeTrackEntry.setComment" ID="TimeTrackEntry.setComment"></a> |
|
305 <h4>TimeTrackEntry.setComment</h4> |
|
306 <b>setComment</b>(<i>comment</i>) |
|
307 <p> |
|
308 Public method to set a comment. |
|
309 </p><dl> |
|
310 <dt><i>comment</i></dt> |
|
311 <dd> |
|
312 comment to set (string) |
|
313 </dd> |
|
314 </dl><a NAME="TimeTrackEntry.setDuration" ID="TimeTrackEntry.setDuration"></a> |
|
315 <h4>TimeTrackEntry.setDuration</h4> |
|
316 <b>setDuration</b>(<i>duration</i>) |
|
317 <p> |
|
318 Public method to set the duration. |
|
319 </p><dl> |
|
320 <dt><i>duration</i></dt> |
|
321 <dd> |
|
322 duration in minutes (integer) |
|
323 </dd> |
|
324 </dl><a NAME="TimeTrackEntry.setID" ID="TimeTrackEntry.setID"></a> |
|
325 <h4>TimeTrackEntry.setID</h4> |
|
326 <b>setID</b>(<i>eid</i>) |
|
327 <p> |
|
328 Public method to assign an ID to the entry. |
|
329 </p><dl> |
|
330 <dt><i>eid</i></dt> |
|
331 <dd> |
|
332 ID for the entry (integer) |
|
333 </dd> |
|
334 </dl><a NAME="TimeTrackEntry.setStartDateTime" ID="TimeTrackEntry.setStartDateTime"></a> |
|
335 <h4>TimeTrackEntry.setStartDateTime</h4> |
|
336 <b>setStartDateTime</b>(<i>startDateTime</i>) |
|
337 <p> |
|
338 Public method to set the start date and time. |
|
339 </p><dl> |
|
340 <dt><i>startDateTime</i></dt> |
|
341 <dd> |
|
342 start date and time (QDateTime) |
|
343 </dd> |
|
344 </dl><a NAME="TimeTrackEntry.setTask" ID="TimeTrackEntry.setTask"></a> |
|
345 <h4>TimeTrackEntry.setTask</h4> |
|
346 <b>setTask</b>(<i>description</i>) |
|
347 <p> |
|
348 Public method to set the task description. |
|
349 </p><dl> |
|
350 <dt><i>description</i></dt> |
|
351 <dd> |
|
352 task description (string) |
|
353 </dd> |
|
354 </dl><a NAME="TimeTrackEntry.start" ID="TimeTrackEntry.start"></a> |
|
355 <h4>TimeTrackEntry.start</h4> |
|
356 <b>start</b>(<i></i>) |
|
357 <p> |
|
358 Public method to set the start time of this entry. |
|
359 </p><a NAME="TimeTrackEntry.stop" ID="TimeTrackEntry.stop"></a> |
|
360 <h4>TimeTrackEntry.stop</h4> |
|
361 <b>stop</b>(<i></i>) |
|
362 <p> |
|
363 Public method to stop this entry. |
|
364 </p><a NAME="TimeTrackEntry.toString" ID="TimeTrackEntry.toString"></a> |
|
365 <h4>TimeTrackEntry.toString</h4> |
|
366 <b>toString</b>(<i></i>) |
|
367 <p> |
|
368 Public method to get a string representation of the entry. |
|
369 </p><dl> |
|
370 <dt>Returns:</dt> |
|
371 <dd> |
|
372 string representation of the entry (string) |
|
373 </dd> |
|
374 </dl> |
|
375 <div align="right"><a href="#top">Up</a></div> |
|
376 <hr /> |
|
377 </body></html> |