xref: /haiku/src/apps/haikudepot/model/ScreenshotCoordinate.h (revision dd2a1e350b303b855a50fd64e6cb55618be1ae6a)
1 /*
2  * Copyright 2023, Andrew Lindesay <apl@lindesay.co.nz>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 #ifndef SCREENSHOT_COORDINATE_H
6 #define SCREENSHOT_COORDINATE_H
7 
8 
9 #include <Archivable.h>
10 #include <String.h>
11 
12 
13 /*!	A screenshot coordinate defines a screenshot to obtain. The `code` is
14 	recorded against a screenshot in the HDS system and then the width and
15 	height define the sizing required for that screenshot.
16 */
17 
18 class ScreenshotCoordinate : public BArchivable {
19 public:
20 								ScreenshotCoordinate(const BMessage* from);
21 								ScreenshotCoordinate(BString code, uint16 width, uint16 height);
22 								ScreenshotCoordinate();
23 	virtual						~ScreenshotCoordinate();
24 
25 	const	BString				Code() const;
26 			uint16				Width() const;
27 			uint16				Height() const;
28 
29 			bool				operator==(const ScreenshotCoordinate& other) const;
30 
31 			bool				IsValid() const;
32 	const	BString				Key() const;
33 	const	BString				CacheFilename() const;
34 
35 			status_t			Archive(BMessage* into, bool deep = true) const;
36 
37 private:
38 			BString				fCode;
39 			uint16				fWidth;
40 			uint16				fHeight;
41 };
42 
43 
44 #endif // SCREENSHOT_COORDINATE_H