File indexing completed on 2024-05-19 05:11:51

0001 /*
0002   SPDX-FileCopyrightText: 2014-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "search_debug_export.h"
0010 #include <QComboBox>
0011 namespace Akonadi
0012 {
0013 namespace Search
0014 {
0015 /**
0016  * @brief The AkonadiSearchDebugSearchPathComboBox class
0017  * @author Laurent Montel <montel@kde.org>
0018  */
0019 class AKONADI_SEARCH_DEBUG_EXPORT AkonadiSearchDebugSearchPathComboBox : public QComboBox
0020 {
0021     Q_OBJECT
0022 public:
0023     explicit AkonadiSearchDebugSearchPathComboBox(QWidget *parent = nullptr);
0024     enum SearchType {
0025         Contacts = 0,
0026         ContactCompleter,
0027         Emails,
0028         Notes,
0029         Calendars,
0030     };
0031     ~AkonadiSearchDebugSearchPathComboBox() override;
0032 
0033     [[nodiscard]] QString searchPath() const;
0034 
0035     [[nodiscard]] QString pathFromEnum(SearchType type) const;
0036     void setSearchType(SearchType type);
0037 
0038 private:
0039     AKONADI_SEARCH_DEBUG_NO_EXPORT const QString defaultLocations(const QString &dbname) const;
0040     AKONADI_SEARCH_DEBUG_NO_EXPORT void initialize();
0041 };
0042 }
0043 }