// D:\Dev\Mosis\MosisService\src\main\kernel\include\service_interface.h
#pragma once

#include <memory>
#include <functional>
#include <string>

namespace mosis {

// Abstract listener interface - mirrors IMosisListener.aidl
class IServiceListener {
public:
    virtual ~IServiceListener() = default;
    virtual void OnServiceInitialized(bool success) = 0;
    virtual void OnBufferAvailable() = 0;  // Simplified - no HardwareBuffer on desktop
    virtual void OnFrameAvailable() = 0;
};

// Kernel interface - the main service API
class IKernel {
public:
    virtual ~IKernel() = default;

    // Listener management
    virtual void AddListener(std::shared_ptr<IServiceListener> listener) = 0;
    virtual void RemoveListener(std::shared_ptr<IServiceListener> listener) = 0;

    // Touch input (normalized 0.0-1.0 coordinates)
    virtual void OnTouchDown(float x, float y) = 0;
    virtual void OnTouchMove(float x, float y) = 0;
    virtual void OnTouchUp(float x, float y) = 0;

    // Hardware button simulation
    virtual void OnBackButton() = 0;
    virtual void OnHomeButton() = 0;
    virtual void OnRecentsButton() = 0;

    // Hot-reload support
    virtual void RequestReload() = 0;

    // Navigation
    virtual void NavigateTo(const std::string& screen) = 0;

    // Lifecycle
    virtual void Start() = 0;
    virtual void Stop() = 0;
    virtual bool IsRunning() const = 0;
};

// Factory for creating kernel implementation
std::unique_ptr<IKernel> CreateKernel();

} // namespace mosis
