xref: /haiku/src/preferences/datatranslations/TranslatorListView.h (revision e0ef64750f3169cd634bb2f7a001e22488b05231)
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 class TranslatorListView : public BListView {
30 	public:
31 		TranslatorListView(const char *name,
32 			list_view_type type = B_SINGLE_SELECTION_LIST);
33 		virtual ~TranslatorListView();
34 
35 		TranslatorItem* TranslatorAt(int32 index) const;
36 
37 		virtual void MessageReceived(BMessage *message);
38 		virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *msg);
39 
40 		void SortItems();
41 };
42 
43 #endif	// TRANSLATOR_LIST_VIEW_H
44