xref: /haiku/src/apps/haikudepot/HaikuDepotConstants.h (revision d12bb8b14803d030b4a8fba91131e4bb96c4f406)
1 /*
2  * Copyright 2018-2020, 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_MAIN_WINDOW_CLOSED					= 'mwcl',
10 	MSG_PACKAGE_SELECTED					= 'pkgs',
11 	MSG_PACKAGE_WORKER_BUSY					= 'pkwb',
12 	MSG_PACKAGE_WORKER_IDLE					= 'pkwi',
13 	MSG_ADD_VISIBLE_PACKAGES				= 'avpk',
14 	MSG_UPDATE_SELECTED_PACKAGE				= 'uspk',
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 };
28 
29 
30 #define RATING_MISSING					-1.0f
31 #define RATING_MIN						0.0f
32 
33 
34 #define RGB_COLOR_WHITE						(rgb_color) { 255, 255, 255, 255 }
35 
36 
37 #define HD_ERROR_BASE					(B_ERRORS_END + 1)
38 #define HD_NETWORK_INACCESSIBLE			(HD_ERROR_BASE + 1)
39 #define HD_CLIENT_TOO_OLD				(HD_ERROR_BASE + 2)
40 #define HD_ERR_NOT_MODIFIED				(HD_ERROR_BASE + 3)
41 #define HD_ERR_NO_DATA					(HD_ERROR_BASE + 4)
42 
43 
44 #define REPOSITORY_NAME_SYSTEM			"system"
45 #define REPOSITORY_NAME_INSTALLED		"installed"
46 
47 
48 #define KEY_ALERT_TEXT					"alert_text"
49 #define KEY_ALERT_TITLE					"alert_title"
50 #define KEY_WORK_STATUS_TEXT			"work_status_text"
51 #define KEY_WORK_STATUS_PROGRESS		"work_status_progress"
52 #define KEY_WINDOW_SETTINGS				"window_settings"
53 #define KEY_MAIN_SETTINGS				"main_settings"
54 
55 
56 // These constants reference resources in 'HaikuDepot.ref'
57 enum {
58 	RSRC_STAR_BLUE		= 510,
59 	RSRC_STAR_GREY		= 520,
60 	RSRC_INSTALLED		= 530,
61 	RSRC_ARROW_LEFT		= 540,
62 	RSRC_ARROW_RIGHT	= 550,
63 };
64 
65 
66 enum UserUsageConditionsSelectionMode {
67 	LATEST		= 1,
68 	USER		= 2,
69 	FIXED		= 3
70 		// means that the user usage conditions are supplied to the window.
71 };
72 
73 #define LANGUAGE_DEFAULT_CODE "en"
74 #define LANGUAGE_DEFAULT Language(LANGUAGE_DEFAULT_CODE, "English", true)
75 
76 
77 #define PACKAGE_INFO_MAX_USER_RATINGS 250
78 
79 #define STR_MDASH "\xE2\x80\x94"
80 
81 #define ALERT_MSG_LOGS_USER_GUIDE "\nInformation about how to view the logs is " \
82 	"available in the HaikuDepot section of the user guide."
83 
84 #define CACHE_DIRECTORY_APP "HaikuDepot"
85 
86 #endif // HAIKU_DEPOT_CONSTANTS_H