xref: /haiku/src/apps/haikudepot/util/PackageUtils.h (revision 344ded80d400028c8f561b4b876257b94c12db4a)
1 /*
2  * Copyright 2024, Andrew Lindesay <apl@lindesay.co.nz>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 #ifndef PACKAGE_UTILS_H
6 #define PACKAGE_UTILS_H
7 
8 
9 #include "PackageInfo.h"
10 
11 
12 class PackageUtils {
13 public:
14 	static	void			TitleOrName(const PackageInfoRef& package, BString& title);
15 	static	void			Title(const PackageInfoRef& package, BString& title);
16 	static	void			Summary(const PackageInfoRef& package, BString& summary);
17 
18 	static	bool			IsNativeDesktop(const PackageInfoRef& package);
19 
20 	static PackageLocalizedTextRef
21 							NewLocalizedText(const PackageInfoRef& package);
22 
23 	static	bool			Viewed(const PackageInfoRef& package);
24 	static	PackageState	State(const PackageInfoRef& package);
25 	static	float			DownloadProgress(const PackageInfoRef& package);
26 	static	bool			IsActivatedOrLocalFile(const PackageInfoRef& package);
27 	static	off_t			Size(const PackageInfoRef& package);
28 	static	int32			Flags(const PackageInfoRef& package);
29 
30 	static	PackageLocalInfoRef
31 							NewLocalInfo(const PackageInfoRef& package);
32 
33 	static	const char*		StateToString(PackageState state);
34 
35 };
36 
37 #endif // PACKAGE_UTILS_H
38