1/*
2 * Copyright 2017 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Brian Hill
7 */
8#ifndef REPOSITORIES_CONSTANTS_H
9#define REPOSITORIES_CONSTANTS_H
10
11
12#include <Catalog.h>
13#include <String.h>
14
15#undef B_TRANSLATION_CONTEXT
16#define B_TRANSLATION_CONTEXT "Constants"
17
18static const float kAddWindowOffset = 10.0;
19static const int16 kTimerAlertOffset = 15;
20static const int16 kTimerTimeoutSeconds = 10;
21static const int16 kTimerRetrySeconds = 20;
22
23static const BString kOKLabel = B_TRANSLATE_COMMENT("OK", "Button label");
24static const BString kCancelLabel = B_TRANSLATE_COMMENT("Cancel",
25	"Button label");
26static const BString kRemoveLabel = B_TRANSLATE_COMMENT("Remove",
27	"Button label");
28static const BString kNewRepoDefaultName = B_TRANSLATE_COMMENT("Unknown",
29	"Unknown repository name");
30
31
32typedef struct {
33	const char* name;
34	const char* url;
35} Repository;
36
37
38// Message keys
39#define key_frame "frame"
40#define key_name "repo_name"
41#define key_url "repo_url"
42#define key_text "text"
43#define key_details "details"
44#define key_rowptr "row_ptr"
45#define key_taskptr "task_ptr"
46#define key_count "count"
47#define key_ID "ID"
48
49
50// Messages
51enum {
52	ADD_REPO_WINDOW = 'BHRa',
53	ADD_BUTTON_PRESSED,
54	CANCEL_BUTTON_PRESSED,
55	ADD_REPO_URL,
56	ADD_WINDOW_CLOSED,
57	REMOVE_REPOS,
58	LIST_SELECTION_CHANGED,
59	ENABLE_BUTTON_PRESSED,
60	DISABLE_BUTTON_PRESSED,
61	ITEM_INVOKED,
62	DELETE_KEY_PRESSED,
63	DO_TASK,
64	STATUS_VIEW_COMPLETED_TIMEOUT,
65	TASK_STARTED,
66	TASK_COMPLETED,
67	TASK_COMPLETED_WITH_ERRORS,
68	TASK_CANCELED,
69	UPDATE_LIST,
70	NO_TASKS,
71	ENABLE_REPO,
72	DISABLE_REPO,
73	TASK_TIMEOUT,
74	TIMEOUT_ALERT_BUTTON_SELECTION,
75	TASK_KILL_REQUEST
76};
77
78
79// Repo row task state
80enum {
81	STATE_NOT_IN_QUEUE = 0,
82	STATE_IN_QUEUE_WAITING,
83	STATE_IN_QUEUE_RUNNING
84};
85
86
87#endif
88