xref: /haiku/src/preferences/repositories/RepoRow.h (revision 5bf2b6eb74cbbee276a8050078917e8fbbea11e9)
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 REPO_ROW_H
9 #define REPO_ROW_H
10 
11 
12 #include <ColumnListView.h>
13 #include <String.h>
14 
15 
16 enum {
17 	kEnabledColumn,
18 	kNameColumn,
19 	kUrlColumn
20 };
21 
22 
23 class RepoRow : public BRow {
24 public:
25 								RepoRow(const char* repo_name,
26 									const char* repo_url, bool enabled);
27 
Name()28 			const char*			Name() const { return fName.String(); }
29 			void				SetName(const char* name);
Url()30 			const char*			Url() const { return fUrl.String(); }
31 			void				SetEnabled(bool enabled);
32 			void				RefreshEnabledField();
IsEnabled()33 			bool				IsEnabled() { return fEnabled; }
34 			void				SetTaskState(uint32 state);
TaskState()35 			uint32				TaskState() { return fTaskState; }
SetHasSiblings(bool hasSiblings)36 			void				SetHasSiblings(bool hasSiblings)
37 									{ fHasSiblings = hasSiblings; }
HasSiblings()38 			bool				HasSiblings() { return fHasSiblings; }
39 
40 private:
41 			BString				fName;
42 			BString				fUrl;
43 			bool				fEnabled;
44 			uint32				fTaskState;
45 			bool				fHasSiblings;
46 };
47 
48 
49 #endif
50