60 lines
1.1 KiB
C
60 lines
1.1 KiB
C
#ifndef VIEWMODELS_H
|
|
#define VIEWMODELS_H
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <QDate>
|
|
|
|
#include <QSharedPointer>
|
|
#include "SysPara.h"
|
|
#include <QMap>
|
|
|
|
enum InkType {
|
|
INK_TYPE_BLACK,
|
|
INK_TYPE_WHITE,
|
|
};
|
|
|
|
/**
|
|
* @brief 计数器类型
|
|
*
|
|
*/
|
|
enum COUNTER_TYPE {
|
|
COUNTER_TYPE_1 = 7,
|
|
COUNTER_TYPE_2 = 8,
|
|
};
|
|
|
|
/**
|
|
* @brief 计数器设置界面所用的视图模型
|
|
*
|
|
*/
|
|
struct CounterViewModel {
|
|
int counterType = COUNTER_TYPE_1; // 实际类型为 COUNTER_TYPE
|
|
int digitalNum = 2;
|
|
int letterSpace = 2;
|
|
int charWidth = 0; // 字符宽度,仅在 enbCustomCharWidth == true 时有意义
|
|
bool enbCustomCharWidth = false;
|
|
};
|
|
|
|
Q_DECLARE_METATYPE(CounterViewModel);
|
|
|
|
/**
|
|
* @brief 日期设置界面所用的视图模型
|
|
*
|
|
*/
|
|
struct DateItemModel {
|
|
QString datetimePattern;
|
|
int monthsOffset = 0;
|
|
int daysOffset = 0;
|
|
QStringList dataMap; // unused
|
|
QStringList daysMap;
|
|
QStringList monthsMap;
|
|
QMap<int, QString> yearsMap;
|
|
QStringList weeksMap;
|
|
QStringList hoursMap;
|
|
|
|
static DateItemModel createDefaultReplaceModel();
|
|
};
|
|
|
|
Q_DECLARE_METATYPE(DateItemModel);
|
|
|
|
#endif // VIEWMODELS_H
|