first commit
This commit is contained in:
74
project/fm_viewer/core/rm_usb.h
Normal file
74
project/fm_viewer/core/rm_usb.h
Normal file
@@ -0,0 +1,74 @@
|
||||
#ifndef RM_USB_H
|
||||
#define RM_USB_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QAbstractNativeEventFilter>
|
||||
#include <QMainWindow>
|
||||
#include "../rm_include.h"
|
||||
|
||||
#if (DETECT_SETTING_USB_EJECT || DETECT_USB_CHANGE)
|
||||
class rm_usb : public QObject, public QAbstractNativeEventFilter
|
||||
{
|
||||
friend class RMWindowsDisk;
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit rm_usb(QObject *parent = 0);
|
||||
~rm_usb();
|
||||
virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
|
||||
|
||||
//! \brief 지정된 볼륨의 USB 장치 탐색
|
||||
//! \param volume: 탐색할 볼륨명
|
||||
//! \return 탐색된 USB 폴더명
|
||||
#if (RM_MODEL_EMT_KR)
|
||||
static QString getRemovableDisk();
|
||||
#else // RM_MODEL_EMT_KR
|
||||
static QString getRemovableDisk(QString volume);
|
||||
#endif // RM_MODEL_EMT_KR
|
||||
QString _openDrive; ///!< 현재 사용된 드라이버
|
||||
|
||||
//! \brief 지정된 경로가 USB 디스크인지 확인
|
||||
//! \param volume
|
||||
//! \return true:YES
|
||||
static bool isRemovablePath(QString path);
|
||||
|
||||
//! \brief setopenDriveWithFolder
|
||||
//! 경로의 드라이버가 removeable 일 경우 _openDrive 지정
|
||||
//! \param path: 경로
|
||||
void setOpenDriveWithPath(QString path);
|
||||
|
||||
//! \brief 장치 드라이버인지 확인
|
||||
//! 내부의 폴더, 볼륨명 등으로 확인
|
||||
//! 설정파일도 읽고 검증
|
||||
//! \param path: 경로
|
||||
//! \return 0:success other:CFG_ERROR_CODE
|
||||
static int isDeviceDriver(QString path,bool loadCFG = false);
|
||||
|
||||
private:
|
||||
char _firstDriveFromMask(uint unitmask );
|
||||
char _insertringDrive; // 다중호출 방지, 현재 추가되고 있는 드라이브
|
||||
char _removingDrive; // " 제거되고 있는 드라이브
|
||||
QTimer* _irTimer; ///! 동시 다중호출 방지를 위해 사용하는 _insertringDrive, _removingDrive 초기화
|
||||
|
||||
|
||||
//! \brief 초기화(_insertringDrive,_removingDrive) 타이머 시작
|
||||
void _startIRTimer();
|
||||
|
||||
//! \brief 초기화(_insertringDrive,_removingDrive) 타이머 취소
|
||||
void _cancelIRTimer();
|
||||
|
||||
void* _hDevNotify;
|
||||
signals:
|
||||
void usbChanged(bool inserted, QString& drive); // or removed
|
||||
|
||||
//! \brief 잘못된 SD 카드
|
||||
//! \param code: CFG_ERROR_CODE
|
||||
void wrongSDCard(int code);
|
||||
public slots:
|
||||
void registerEvent(QWidget *window);
|
||||
|
||||
//! \brief _insertringDrive, _removingDrive 초기화
|
||||
void onClearIR();
|
||||
};
|
||||
|
||||
#endif // USE_SD_CARD_DETECT
|
||||
#endif // RM_USB_H
|
||||
Reference in New Issue
Block a user