File indexing completed on 2024-06-02 05:43:53

0001 #pragma once
0002 
0003 /*
0004  * SPDX-FileCopyrightText: 2003-2009 Craig Drummond <craig@kde.org>
0005  * SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 #include "Family.h"
0009 #include <QEventLoop>
0010 #include <QObject>
0011 
0012 class OrgKdeFontinstInterface;
0013 
0014 namespace KFI
0015 {
0016 class FontInstInterface : public QObject
0017 {
0018     Q_OBJECT
0019 
0020 public:
0021     FontInstInterface();
0022     ~FontInstInterface() override;
0023 
0024     int install(const QString &file, bool toSystem);
0025     int uninstall(const QString &name, bool fromSystem);
0026     int reconfigure();
0027     Families list(bool system);
0028     Family statFont(const QString &file, bool system);
0029     QString folderName(bool sys);
0030 
0031 private:
0032     int waitForResponse();
0033 
0034 private Q_SLOTS:
0035 
0036     void dbusServiceOwnerChanged(const QString &name, const QString &from, const QString &to);
0037     void status(int pid, int value);
0038     void fontList(int pid, const QList<KFI::Families> &families);
0039     void fontStat(int pid, const KFI::Family &font);
0040 
0041 private:
0042     OrgKdeFontinstInterface *m_interface;
0043     bool m_active;
0044     int m_status;
0045     Families m_families;
0046     QEventLoop m_eventLoop;
0047 };
0048 
0049 }