b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | #include "CellularTechIcon.h" |
| 2 | |
| 3 | namespace MGUI |
| 4 | { |
| 5 | |
| 6 | CellularTechIcon::CellularTechIcon(ilixi::Widget* parent) |
| 7 | : SimpleIcon(parent), |
| 8 | _cellularTechState(CellularTechUnknown) |
| 9 | { |
| 10 | setCellularTechState(CellularTechUnknown); |
| 11 | } |
| 12 | |
| 13 | CellularTechIcon::~CellularTechIcon() |
| 14 | { |
| 15 | } |
| 16 | |
| 17 | CellularTechState |
| 18 | CellularTechIcon::getCellularTechState() const |
| 19 | { |
| 20 | return _cellularTechState; |
| 21 | } |
| 22 | |
| 23 | void |
| 24 | CellularTechIcon::setCellularTechState(CellularTechState cellularTechState) |
| 25 | { |
| 26 | if (_cellularTechState != cellularTechState) |
| 27 | { |
| 28 | _cellularTechState = cellularTechState; |
| 29 | switch (_cellularTechState) |
| 30 | { |
| 31 | case CellularTechUnknown: |
| 32 | setImage("cellular_tech_unknown"); |
| 33 | break; |
| 34 | case CellularTechHSDPAP: |
| 35 | setImage("cellular_tech_hsdpa+"); |
| 36 | break; |
| 37 | case CellularTechHSDPA: |
| 38 | setImage("cellular_tech_hsdpa"); |
| 39 | break; |
| 40 | case CellularTechEdge: |
| 41 | setImage("cellular_tech_edge"); |
| 42 | break; |
| 43 | case CellularTechG: |
| 44 | setImage("cellular_tech_g"); |
| 45 | break; |
| 46 | case CellularTech2G: |
| 47 | setImage("cellular_tech_2g"); |
| 48 | break; |
| 49 | case CellularTech3G: |
| 50 | setImage("cellular_tech_3g"); |
| 51 | break; |
| 52 | case CellularTech4G: |
| 53 | setImage("cellular_tech_4g"); |
| 54 | break; |
| 55 | default: |
| 56 | break; |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | } /* namespace MGUI */ |