ukui-search/libsearch/index/file-indexer-config.h

99 lines
2.7 KiB
C
Raw Permalink Normal View History

2022-10-26 18:01:40 +08:00
/*
* Copyright (C) 2022, KylinSoft 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 of the License, 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 <https://www.gnu.org/licenses/>.
*
* Authors: iaom <zhangpengfei@kylinos.cn>
*
*/
#ifndef FILEINDEXERCONFIG_H
#define FILEINDEXERCONFIG_H
#include <QObject>
#include <QSettings>
#include <QGSettings>
#include <QAtomicInt>
#include "dir-watcher.h"
class FileIndexerConfig : public QObject
{
Q_OBJECT
public:
static FileIndexerConfig* getInstance();
/**
* @brief currentIndexableDir
* @return
*/
QStringList currentIndexableDir();
/**
* @brief currentBlackListOfIndex
* @return
*/
QStringList currentBlackListOfIndex();
/**
* @brief isFileIndexEnable
* @return
*/
bool isFileIndexEnable();
/**
* @brief isContentIndexEnable
* @return
*/
bool isContentIndexEnable();
/**
* @brief isFuzzySearchEnable
* @return
*/
bool isFuzzySearchEnable();
2022-10-26 18:01:40 +08:00
/**
* @brief isOCREnable
* @return OCR功能
*/
bool isOCREnable();
/**
* @brief isMetaDataIndexEnable
* @return
*/
bool isMetaDataIndexEnable();
Q_SIGNALS:
/**
* @brief appendIndexDir
*
*/
void appendIndexDir(const QString&, const QStringList&);
/**
* @brief removeIndexDir
*
*/
void removeIndexDir(const QString&);
/**
* @brief fileIndexEnableStatusChanged
*
*/
void fileIndexEnableStatusChanged(bool);
private:
explicit FileIndexerConfig(QObject *parent = nullptr);
~FileIndexerConfig();
DirWatcher *m_dirWatcher = nullptr;
QGSettings *m_gsettings = nullptr;
QSettings *m_settings = nullptr;
QAtomicInt m_stop;
};
#endif // FILEINDEXERCONFIG_H