ukui-screensaver/BiometricAuth/biometricproxy.h

167 lines
5.0 KiB
C
Raw Normal View History

/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
**/
#ifndef BIOMETRICPROXY_H
#define BIOMETRICPROXY_H
#include <QtDBus>
#include <QDBusAbstractInterface>
#include <QDBusUnixFileDescriptor>
#include "biometricdeviceinfo.h"
/**
* @brief UpdateStauts调用返回的结果
*/
struct StatusReslut
{
int result;
int enable;
int devNum;
int devStatus;
int opsStatus;
int notifyMessageId;
};
/**
* @brief USB设备插拔动作
*/
enum USBDeviceAction
{
ACTION_ATTACHED = 1,
ACTION_DETACHED = -1
};
/**
* @brief DBus代理类DBus接口
*/
class BiometricProxy : public QDBusAbstractInterface
{
Q_OBJECT
public:
explicit BiometricProxy(QObject *parent = nullptr);
public Q_SLOTS:
/**
* @brief 使id的设备进行用户认证
* @param drvid id
* @param uid id
* @param indexStart
* @param indexEnd
* @return <int result, int uid> id)
*/
QDBusPendingCall Identify(int drvid, int uid, int indexStart = 0, int indexEnd = -1);
2023-04-26 20:29:38 +08:00
/**
* @brief 使id的设备进行用户认证
* @param drvid id
* @param type ukey的认证类型2pin认证setExtraInfo设置pin码,3
* @param uid id
* @return <int result, int uid> id)
*/
QDBusPendingCall UkeyIdentify(int drvid, int type, int uid);
/**
* @brief
* @param info_type ukey pincode认证时传 "pincode"
* @param extra_info ukey pincode认证时传PIN码内容
* @return <int result> )
*/
int SetExtraInfo(QString info_type, QString extra_info);
/**
* @brief
* @param drvid id
* @param waiting
* @return
*/
int StopOps(int drvid, int waiting = 3000);
/**
* @brief
* @param uid id
* @param indexStart
* @param indexEnd
* @return
*/
int GetFeatureCount(int uid, int indexStart = 0, int indexEnd = -1);
2023-04-26 20:29:38 +08:00
/**
* @brief
* @param uid id
* @param indexStart
* @param indexEnd
* @return ukey特征
*/
bool GetHasUkeyFeature(int uid, int indexStart = 0, int indexEnd = -1);
/**
* @brief
* @return
*/
DeviceList GetDevList();
/**
* @brief
* @return
*/
int GetDevCount();
/**
* @brief
* @param drvid id
* @return
*/
QString GetDevMesg(int drvid);
/**
* @brief GetNotifyMesg
* @param drvid id
* @return
*/
QString GetNotifyMesg(int drvid);
/**
* @brief GetOpsMesg
* @param drvid id
* @return
*/
QString GetOpsMesg(int drvid);
/**
* @brief UpdateStatus
* @param drvid id
* @return <int result, int enable, int devNum,
* int devStatus, int opsStatus, notifyMessageId, ...>
*/
StatusReslut UpdateStatus(int drvid);
int GetUserDevCount(int uid);
int GetUserDevFeatureCount(int uid,int drvid);
2023-04-26 20:29:38 +08:00
/**
* @brief GetUserFeatures
* @param uid id
* @return
*/
FeatureMap GetUserFeatures(int uid);
Q_SIGNALS:
/**
* @brief
* @param drvid id
* @param status
*/
void StatusChanged(int drvid, int status);
/**
* @brief USB设备热插拔
* @param drvid id
* @param action 1-1
* @param deviceNum
*/
void USBDeviceHotPlug(int drvid, int action, int deviceNum);
void FrameWritten(int drvid);
};
#endif // BIOMETRICPROXY_H