1 /* 2 * Copyright 2019, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Author: 6 * Preetpal Kaur <preetpalok123@gmail.com> 7 */ 8 9 10 #ifndef _INPUT_DEVICE_VIEW_H 11 #define _INPUT_DEVICE_VIEW_H 12 13 #include <ListItem.h> 14 #include <String.h> 15 #include <View.h> 16 17 18 #define ITEM_SELECTED 'I1s' 19 20 #define kITEM_MARGIN 1 21 22 23 class InputIcons; 24 25 enum input_type { 26 MOUSE_TYPE, 27 TOUCHPAD_TYPE, 28 KEYBOARD_TYPE 29 }; 30 31 class DeviceListItemView : public BListItem { 32 public: 33 DeviceListItemView(BString title, input_type type); 34 35 void Update(BView* owner, const BFont* font); 36 void DrawItem(BView* owner, BRect frame, 37 bool complete = false); 38 Label()39 const char* Label() { return fTitle.String();} 40 41 Icons()42 static InputIcons* Icons() { return sIcons; } SetIcons(InputIcons * icons)43 static void SetIcons(InputIcons* icons) { sIcons = icons; } 44 45 protected: 46 struct Renderer; 47 48 void SetRenderParameters(Renderer& renderer); 49 50 private: 51 static InputIcons* sIcons; 52 BString fTitle; 53 input_type fInputType; 54 }; 55 56 57 #endif // _INPUT_DEVICE_VIEW_H */ 58