File indexing completed on 2024-11-24 05:00:24

0001 /*
0002     SPDX-FileCopyrightText: 2014 Weng Xuetian <wengxt@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 #pragma once
0007 
0008 #include <QSet>
0009 #include <QString>
0010 #include <ibus.h>
0011 
0012 class XkbLayoutManager
0013 {
0014 public:
0015     XkbLayoutManager();
0016     void setUseXkbModmap(bool use);
0017     void setLayout(IBusEngineDesc *desc);
0018     void setLatinLayouts(const gchar **variants, gsize length);
0019     void getLayout();
0020     const QString &defaultLayout()
0021     {
0022         return m_defaultLayout;
0023     }
0024     const QString &defaultVariant()
0025     {
0026         return m_defaultVariant;
0027     }
0028 
0029 private:
0030     QSet<QString> m_latinLayouts;
0031     QString m_defaultLayout;
0032     QString m_defaultVariant;
0033     QString m_defaultOption;
0034     bool m_useXkbModmap;
0035     void runXmodmap();
0036 };