EX-Display
EX-Display
Loading...
Searching...
No Matches
MockColourDisplay.h
Go to the documentation of this file.
1/*
2 * © 2025 Peter Cole
3 *
4 * This is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * It is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this code. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef MOCKCOLOURDISPLAY_H
19#define MOCKCOLOURDISPLAY_H
20
21#include "DisplayInterface.h"
22#include "Screen.h"
23#include <gmock/gmock.h>
24
27public:
28 MOCK_METHOD(void, begin, (), (override));
29
30 MOCK_METHOD(void, clearScreen, (), (override));
31
32 MOCK_METHOD(void, displayScreen, (Screen * screen), (override));
33
34 MOCK_METHOD(void, displayStartupInfo, (const char *version), (override));
35
36 void displayRow(int row, const char *text) { formatRow(row, text); }
37
39 (uint8_t row, uint8_t column, RowAttributes attributes, const char *text, bool append), (override));
40
42 MockColourDisplay *newDisplay = new MockColourDisplay();
43 return newDisplay;
44 }
45};
46
47#endif // MOCKCOLOURDISPLAY_H
Class to abstract away all physical display implementation to enable multiple display types.
Definition DisplayInterface.h:36
void formatRow(int row, const char *text)
Static method to enable calling back to a derived class with a formatted row.
Definition DisplayInterface.cpp:58
virtual void displayFormattedRow(uint8_t row, uint8_t column, RowAttributes attributes, const char *text, bool append)=0
Display a row using formatting modifiers.
virtual void displayStartupInfo(const char *version)=0
Display the startup screen with software version.
virtual void clearScreen()=0
Clear the entire screen.
virtual void begin()=0
Perform any initial once off setup or configuration here and call only once.
virtual void displayScreen(Screen *screen)=0
Display the specified Screen on this display.
Mock colour display class for format testing.
Definition MockColourDisplay.h:26
MOCK_METHOD(void, displayStartupInfo,(const char *version),(override))
MOCK_METHOD(void, begin,(),(override))
MOCK_METHOD(void, displayFormattedRow,(uint8_t row, uint8_t column, RowAttributes attributes, const char *text, bool append),(override))
MOCK_METHOD(void, clearScreen,(),(override))
void displayRow(int row, const char *text)
Definition MockColourDisplay.h:36
static MockColourDisplay * create()
Definition MockColourDisplay.h:41
MOCK_METHOD(void, displayScreen,(Screen *screen),(override))
Class for each screen as received from the EXRAIL SCREEN() command Each Screen instance contains a li...
Definition Screen.h:27
Structure for row attributes.
Definition DisplayInterface.h:26