xref: /haiku/src/preferences/datatranslations/TranslatorListView.h (revision fce4895d1884da5ae6fb299d23c735c598e690b1)
1 /*
2  * Copyright 2002-2006, Haiku, Inc.
3  * Distributed under the terms of the MIT license.
4  *
5  * Authors:
6  *		Oliver Siebenmarck
7  *		Andrew McCall, mccall@digitalparadise.co.uk
8  *		Michael Wilber
9  */
10 #ifndef TRANSLATOR_LIST_VIEW_H
11 #define TRANSLATOR_LIST_VIEW_H
12 
13 
14 #include <ListView.h>
15 #include <TranslationDefs.h>
16 
17 
18 class TranslatorItem : public BStringItem {
19 public:
20 							TranslatorItem(translator_id id, const char* name);
21 	virtual					~TranslatorItem();
22 
23 			translator_id	ID() const { return fID; }
24 
25 private:
26 			translator_id	fID;
27 };
28 
29 
30 class TranslatorListView : public BListView {
31 public:
32 							TranslatorListView(const char* name,
33 								list_view_type type = B_SINGLE_SELECTION_LIST);
34 	virtual					~TranslatorListView();
35 
36 			TranslatorItem*	TranslatorAt(int32 index) const;
37 
38 	virtual	void			MessageReceived(BMessage* message);
39 	virtual	void			MouseMoved(BPoint point, uint32 transit, const BMessage* msg);
40 
41 			void			SortItems();
42 };
43 
44 
45 #endif	// TRANSLATOR_LIST_VIEW_H
46