#ifndef H_EventManager #define H_EventManager #include #include #include #include #include #include #include #include #include #include /// This class manages the keyboard events and triggers actions. class EventManager { public: EventManager(Display & display_, TreeNodeDiskUsage & rootNode_); ~EventManager(); /// Starts the main event loop. void MainEventLoop(); // Callback functions that are triggered when the corresponding key is pressed. void CallbackArrowUp(); void CallbackArrowDown(); void CallbackArrowLeft(); void CallbackArrowRight(); void CallbackEnter(); void CallbackBackspace(); void CallbackHome(); void CallbackHelp(); void CallbackSort(); void CallbackUnits(); /// Computes the visibility of the selected line and scrolls the element list if needed. void ScrollList(); /// Sorts the elements of the current node according to the sorting method currently selected. void SortNodeElements(); /// Updates the screen based on the current state. void UpdateScreen(); void DebugPrintState(); protected: Display & display; TreeNodeDiskUsage & rootNode; int topLine; // displayedNodes; // size descending, 1 -> name ascending bool SI_units; //