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
17struct Attribute;
18
19enum {
20	kNameColumn,
21	kValueColumn
22};
23
24
25class PropertyRow : public BRow {
26public:
27						PropertyRow(const char* name, const char* value);
28	virtual				~PropertyRow();
29
30			const char*	Name() const { return fName.String(); }
31			const char*	Value() const { return fValue.String(); }
32			void		SetName(const char* name);
33			void		SetValue(const char* value);
34private:
35	BString		fName;
36	BString		fValue;
37};
38
39
40class PropertyList : public BColumnListView {
41public:
42					PropertyList(const char* name);
43	virtual			~PropertyList();
44			void	RemoveAll();
45			void	AddAttributes(const Attributes& attributes);
46
47			void	MessageReceived(BMessage* msg);
48protected:
49	virtual	void	SelectionChanged();
50};
51
52#endif /* PROPERTYLIST_H*/
53
54