xref: /haiku/src/apps/devices/PropertyList.h (revision 3c6e2dd68577c34d93e17f19711f6245bf6d0915)
1 /*
2  * Copyright 2009 Haiku Inc. All rights reserved.
3  * Distributed under the terms of the MIT license.
4  *
5  * Authors:
6  *		Pieter Panman
7  */
8 #ifndef PROPERTYLIST_H
9 #define PROPERTYLIST_H
10 
11 
12 #include <ColumnListView.h>
13 #include <String.h>
14 
15 #include "Device.h"
16 
17 
18 struct Attribute;
19 
20 enum {
21 	kNameColumn,
22 	kValueColumn
23 };
24 
25 
26 class PropertyRow : public BRow {
27 public:
28 						PropertyRow(const char* name, const char* value);
29 	virtual				~PropertyRow();
30 
31 			const char*	Name() const { return fName.String(); }
32 			const char*	Value() const { return fValue.String(); }
33 			void		SetName(const char* name);
34 			void		SetValue(const char* value);
35 private:
36 	BString		fName;
37 	BString		fValue;
38 };
39 
40 
41 class PropertyList : public BColumnListView {
42 public:
43 					PropertyList(const char* name = "Properties");
44 	virtual			~PropertyList();
45 			void	RemoveAll();
46 			void	AddAttributes(const Attributes& attributes);
47 protected:
48 	virtual	void	SelectionChanged();
49 };
50 
51 #endif /* PROPERTYLIST_H*/
52