File indexing completed on 2025-02-09 06:01:30

0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 // SPDX-FileCopyrightText: 2022 Louis Schul <schul9louis@gmail.com>
0003 #pragma once
0004 
0005 #include <QFont>
0006 #include <QJsonObject>
0007 #include <QObject>
0008 #include <QUrl>
0009 
0010 class KleverUtility : public QObject
0011 {
0012     Q_OBJECT
0013 
0014 public:
0015     explicit KleverUtility(QObject *parent = nullptr);
0016 
0017     Q_INVOKABLE QString getName(const QString &path) const;
0018     Q_INVOKABLE QString getPath(const QUrl &url) const;
0019     Q_INVOKABLE bool isEmptyDir(const QString &path) const;
0020     Q_INVOKABLE QString isProperPath(const QString &parentPath, const QString &name) const;
0021     Q_INVOKABLE QString getParentPath(const QString &path) const;
0022     Q_INVOKABLE QString getImageStoragingPath(const QString &noteImagesStoringPath, const QString &wantedName, int iteration = 0) const;
0023     Q_INVOKABLE bool remove(const QString &path) const;
0024     Q_INVOKABLE QJsonObject getCssStylesList() const;
0025     Q_INVOKABLE QJsonObject fontInfo(const QFont &font) const;
0026     static bool create(const QString &path);
0027     static bool exists(const QString &path);
0028 };