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 <String.h> 16 #include <TranslationDefs.h> 17 18 19 class TranslatorItem : public BStringItem { 20 public: 21 TranslatorItem(translator_id id, const char* name); 22 virtual ~TranslatorItem(); 23 24 translator_id ID() const { return fID; } 25 const BString& Supertype() const { return fSupertype; } 26 27 private: 28 translator_id fID; 29 BString fSupertype; 30 }; 31 32 33 class TranslatorListView : public BListView { 34 public: 35 TranslatorListView(const char* name, 36 list_view_type type = B_SINGLE_SELECTION_LIST); 37 virtual ~TranslatorListView(); 38 39 TranslatorItem* TranslatorAt(int32 index) const; 40 41 virtual void MessageReceived(BMessage* message); 42 virtual void MouseMoved(BPoint point, uint32 transit, const BMessage* msg); 43 44 void SortItems(); 45 }; 46 47 48 #endif // TRANSLATOR_LIST_VIEW_H 49