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

#ifndef MAINPAGECONTROLLER_H
#define MAINPAGECONTROLLER_H

#include <QObject>

#include "callapi/callmanager.h"

class MainPageController : public QObject
{
    Q_OBJECT
    Q_PROPERTY(CallManager *callManager READ callManager WRITE setCallManager NOTIFY
                       callManagerChanged)

public:
    explicit MainPageController(QObject *parent = nullptr);

    // Getters
    CallManager *callManager();

    // Setters
    void setCallManager(CallManager *callManager);

    // CallManager methods
    Q_INVOKABLE void registerCallManager();
    Q_INVOKABLE void startIncomingCall();
    Q_INVOKABLE void startOutgoingCall();

private:
    CallManager *m_callManager;

signals:
    void callManagerChanged();
    void callManagerErrorReceived(const QString &errorMessage);
};

#endif // MAINPAGECONTROLLER_H
