package com.meeting.demo.delegate;

import android.app.Application;

import com.huawei.cloudlink.openapi.OpenSDKConfig;
import com.meeting.demo.delegate.mobile.MobileFeatureDelegate;
import com.meeting.demo.delegate.mobile.MobileSettingDelegate;
import com.meeting.demo.delegate.mobile.MobileUiDelegate;
import com.meeting.demo.vision.delegate.VisionFeatureDelegate;
import com.meeting.demo.vision.delegate.VisionSettingDelegate;
import com.meeting.demo.vision.delegate.VisionUiDelegate;
import com.huawei.hwmlogger.HCLog;

public class DelegateFactory {

    private static final String TAG = "DelegateFactory";

    public static IHwmUiDelegate createHwmUiDelegate(Application application, OpenSDKConfig sdkConfig) {
        IHwmUiDelegate uiDelegate;
        if (sdkConfig.isRoomsMode()) {
            uiDelegate = new VisionUiDelegate(application);
        } else {
            uiDelegate = new MobileUiDelegate(application);
        }
        HCLog.i(TAG, " createHwmUiDelegate : " + uiDelegate);
        return uiDelegate;
    }

    public static IHwmSettingDelegate createHwmSettingDelegate(Application application, OpenSDKConfig sdkConfig) {
        IHwmSettingDelegate settingDelegate;
        if (sdkConfig.isRoomsMode()) {
            settingDelegate = new VisionSettingDelegate(application);
        } else {
            settingDelegate = new MobileSettingDelegate(application);
        }
        HCLog.i(TAG, " createHwmSettingDelegate : " + settingDelegate);
        return settingDelegate;
    }

    public static IHwmFeatureDelegate createHwmFeatureDelegate(Application application, OpenSDKConfig sdkConfig) {
        IHwmFeatureDelegate featureDelegate;
        if (sdkConfig.isRoomsMode()) {
            featureDelegate = new VisionFeatureDelegate(application);
        } else {
            featureDelegate = new MobileFeatureDelegate(application);
        }
        HCLog.i(TAG, " createHwmFeatureDelegate : " + featureDelegate);
        return featureDelegate;
    }
}
