File indexing completed on 2024-04-28 15:39:42

0001 /* SPDX-FileCopyrightText: 2014 Jesper K. Pedersen <blackie@kde.org>
0002 
0003    SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef REMOTECONTROL_SEARCHINFO_H
0007 #define REMOTECONTROL_SEARCHINFO_H
0008 
0009 #include <QDataStream>
0010 #include <QStack>
0011 #include <QString>
0012 #include <tuple>
0013 
0014 namespace RemoteControl
0015 {
0016 
0017 class SearchInfo
0018 {
0019 public:
0020     void addCategory(const QString &category);
0021     void addValue(const QString &value);
0022     void pop();
0023     void clear();
0024     QString currentCategory() const;
0025     QList<std::tuple<QString, QString>> values() const;
0026 
0027     friend QDataStream &operator<<(QDataStream &stream, const SearchInfo &searchInfo);
0028     friend QDataStream &operator>>(QDataStream &stream, SearchInfo &searchInfo);
0029 
0030 private:
0031     QStack<QString> m_categories;
0032     QStack<QString> m_values;
0033 };
0034 
0035 QDataStream &operator<<(QDataStream &stream, const SearchInfo &searchInfo);
0036 QDataStream &operator>>(QDataStream &stream, SearchInfo &searchInfo);
0037 
0038 } // namespace RemoteControl
0039 
0040 #endif // REMOTECONTROL_SEARCHINFO_H