1 /* 2 * Copyright 2019, Andrew Lindesay <apl@lindesay.co.nz>. 3 * 4 * All rights reserved. Distributed under the terms of the MIT License. 5 */ 6 #ifndef USER_USAGE_CONDITIONS_H 7 #define USER_USAGE_CONDITIONS_H 8 9 10 #include <Archivable.h> 11 #include <String.h> 12 13 14 /*! A user in the HDS system should have agreed to user usage conditions when 15 they created their user on the server. This object represents the user 16 usage conditions that either they have agreed to or that they could agree 17 to. Each set of user usage conditions has a code that uniquely identifies 18 a given set of conditions. 19 */ 20 21 class UserUsageConditions : public BArchivable { 22 public: 23 UserUsageConditions(BMessage* from); 24 UserUsageConditions(); 25 virtual ~UserUsageConditions(); 26 27 const BString& Code() const; 28 const uint8 MinimumAge() const; 29 const BString& CopyMarkdown() const; 30 31 void SetCode(const BString& code); 32 void SetMinimumAge(uint8 age); 33 void SetCopyMarkdown(const BString& copyMarkdown); 34 35 status_t Archive(BMessage* into, bool deep = true) const; 36 private: 37 BString fCode; 38 BString fCopyMarkdown; 39 uint8 fMinimumAge; 40 }; 41 42 43 #endif // USER_USAGE_CONDITIONS_H 44