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