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, uint32 width, uint32 height); 22 ScreenshotCoordinate(); 23 virtual ~ScreenshotCoordinate(); 24 25 const BString Code() const; 26 uint32 Width() const; 27 uint32 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 uint32 fWidth; 40 uint32 fHeight; 41 }; 42 43 44 #endif // SCREENSHOT_COORDINATE_H