xref: /haiku/src/apps/haikudepot/HaikuDepotConstants.h (revision 6afa94a0896259ded7b5b5fc27180f44196c2eca)
1 /*
2  * Copyright 2018-2024, Andrew Lindesay <apl@lindesay.co.nz>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 #ifndef HAIKU_DEPOT_CONSTANTS_H
6 #define HAIKU_DEPOT_CONSTANTS_H
7 
8 enum {
9 	MSG_PACKAGE_ACTION_DONE					= 'mpad',
10 	MSG_BULK_LOAD_DONE						= 'mmwd',
11 	MSG_MAIN_WINDOW_CLOSED					= 'mwcl',
12 	MSG_PACKAGE_SELECTED					= 'pkgs',
13 	MSG_PACKAGE_WORKER_BUSY					= 'pkwb',
14 	MSG_PACKAGE_WORKER_IDLE					= 'pkwi',
15 	MSG_CLIENT_TOO_OLD						= 'oldc',
16 	MSG_NETWORK_TRANSPORT_ERROR				= 'nett',
17 	MSG_SERVER_ERROR						= 'svre',
18 	MSG_SERVER_DATA_CHANGED					= 'svdc',
19 	MSG_ALERT_SIMPLE_ERROR					= 'nser',
20 	MSG_DID_ADD_USER_RATING					= 'adur',
21 	MSG_DID_UPDATE_USER_RATING				= 'upur',
22 	MSG_LANGUAGE_SELECTED					= 'lngs',
23 	MSG_VIEW_LATEST_USER_USAGE_CONDITIONS	= 'vluc',
24 	MSG_VIEW_USERS_USER_USAGE_CONDITIONS	= 'vuuc',
25 	MSG_USER_USAGE_CONDITIONS_DATA			= 'uucd',
26 	MSG_USER_USAGE_CONDITIONS_ERROR			= 'uuce',
27 	MSG_USER_USAGE_CONDITIONS_NOT_LATEST	= 'uucl',
28 	MSG_LOG_OUT								= 'lgot',
29 	MSG_PKG_INSTALL							= 'pkgi',
30 	MSG_PKG_UNINSTALL						= 'pkgu',
31 	MSG_PKG_OPEN							= 'pkgo'
32 };
33 
34 enum BitmapSize {
35 	BITMAP_SIZE_16							= 0,
36 	BITMAP_SIZE_22							= 1,
37 	BITMAP_SIZE_32							= 2,
38 	BITMAP_SIZE_64							= 3,
39 	BITMAP_SIZE_ANY							= 4
40 };
41 
42 
43 #define RATING_MISSING						-1.0f
44 #define RATING_MISSING_STAR					-1
45 #define RATING_MIN							0.0f
46 
47 
48 #define kProgressIndeterminate				-1.0f
49 
50 #define MAX_IMAGE_SIZE						1000
51 
52 #define RGB_COLOR_WHITE						(rgb_color) { 255, 255, 255, 255 }
53 
54 
55 #define HD_ERROR_BASE						(B_ERRORS_END + 1)
56 #define HD_NETWORK_INACCESSIBLE				(HD_ERROR_BASE + 1)
57 #define HD_CLIENT_TOO_OLD					(HD_ERROR_BASE + 2)
58 #define HD_ERR_NOT_MODIFIED					(HD_ERROR_BASE + 3)
59 #define HD_ERR_NO_DATA						(HD_ERROR_BASE + 4)
60 
61 
62 #define REPOSITORY_NAME_SYSTEM				"system"
63 #define REPOSITORY_NAME_INSTALLED			"installed"
64 
65 
66 #define KEY_ALERT_TEXT						"alert_text"
67 #define KEY_ALERT_TITLE						"alert_title"
68 #define KEY_ALERT_TYPE						"alert_type"
69 #define KEY_WORK_STATUS_TEXT				"work_status_text"
70 #define KEY_WORK_STATUS_PROGRESS			"work_status_progress"
71 #define KEY_WINDOW_SETTINGS					"window_settings"
72 #define KEY_MAIN_SETTINGS					"main_settings"
73 #define KEY_PACKAGE_NAME					"package_name"
74 #define KEY_TITLE							"title"
75 #define KEY_DESKBAR_LINK					"deskbar_link"
76 
77 
78 #define SETTING_SHOW_AVAILABLE_PACKAGES			"show available packages"
79 #define SETTING_SHOW_INSTALLED_PACKAGES			"show installed packages"
80 #define SETTING_SHOW_DEVELOP_PACKAGES			"show develop packages"
81 #define SETTING_SHOW_SOURCE_PACKAGES			"show source packages"
82 #define SETTING_CAN_SHARE_ANONYMOUS_USER_DATA	"can share anonymous usage data"
83 #define SETTING_PACKAGE_LIST_VIEW_MODE			"packageListViewMode"
84 	// unfortunately historical difference in casing.
85 
86 
87 // These constants reference resources in 'HaikuDepot.ref'
88 enum {
89 	RSRC_STAR_BLUE							= 510,
90 	RSRC_STAR_GREY							= 520,
91 	RSRC_INSTALLED							= 530,
92 	RSRC_ARROW_LEFT							= 540,
93 	RSRC_ARROW_RIGHT						= 550,
94 	RSRC_NATIVE								= 560,
95 };
96 
97 
98 enum UserUsageConditionsSelectionMode {
99 	LATEST									= 1,
100 	USER									= 2,
101 	FIXED									= 3
102 		// means that the user usage conditions are supplied to the window.
103 };
104 
105 
106 #define LANGUAGE_DEFAULT_ID "en"
107 
108 #define PACKAGE_INFO_MAX_USER_RATINGS 250
109 
110 #define STR_MDASH "\xE2\x80\x94"
111 
112 #define ALERT_MSG_LOGS_USER_GUIDE "\nInformation about how to view the logs " \
113 	"is available in the HaikuDepot section of the Haiku User Guide."
114 
115 #define CACHE_DIRECTORY_APP "HaikuDepot"
116 
117 #define PROMINANCE_ORDERING_PROMINENT_MAX	200
118 	// any prominence ordering value greater than this is not prominent.
119 #define PROMINANCE_ORDERING_MAX				1000
120 	// this is the highest prominence value possible.
121 
122 #endif // HAIKU_DEPOT_CONSTANTS_H
123