// SPDX-FileCopyrightText: 2024 Open Mobile Platform LLC <community@omp.ru>
// SPDX-License-Identifier: BSD-3-Clause

#include <auroraapp.h>
#include <QtQuick>
#include <QtDBus/QDBusMetaType>

#include "controllers/mainpagecontroller.h"

#include "callapi/callmanager.h"

int main(int argc, char *argv[])
{
    setenv("NEMO_RESOURCE_DISABLE", "1", true);

    QScopedPointer<QGuiApplication> application(Aurora::Application::application(argc, argv));
    application->setOrganizationName(QStringLiteral("ru.auroraos"));
    application->setApplicationName(QStringLiteral("CallApiOverall"));

    qDBusRegisterMetaType<VariantMapMap>();
    qDBusRegisterMetaType<DBusManagerStruct>();

    qmlRegisterType<MainPageController>("ru.auroraos.CallApiOverall", 1, 0, "MainPageController");
    qmlRegisterType<CallManager>("ru.auroraos.CallApiOverall", 1, 0, "CallManager");

    QScopedPointer<QQuickView> view(Aurora::Application::createView());
    view->setSource(Aurora::Application::pathTo(QStringLiteral("qml/CallApiOverall.qml")));
    view->show();

    return application->exec();
}
