using Google.Apis.Auth.OAuth2;
using Google.Apis.Drive.v3;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PDF_Office.Model.CloudDrive
{
    public class Cloud
    {
        public static ObservableCollection<UserBaseItem> CloudLists = new ObservableCollection<UserBaseItem>();

        public static List<CloudBoxItem> InitCloudBoxs()
        {
            List<CloudBoxItem> CloudeDrives = new List<CloudBoxItem>();

            var cloudDriveItem = new CloudBoxItem(CloudType.Box);
            CloudeDrives.Add(cloudDriveItem);

            cloudDriveItem = new CloudBoxItem(CloudType.DropBox);
            CloudeDrives.Add(cloudDriveItem);

            cloudDriveItem = new CloudBoxItem(CloudType.GoogleDrive);
            CloudeDrives.Add(cloudDriveItem);

            cloudDriveItem = new CloudBoxItem(CloudType.OneDrive);
            CloudeDrives.Add(cloudDriveItem);

            return CloudeDrives;
        }
    }

    #region 云盘基类

    /// <summary>
    /// 用户信息
    /// </summary>
    public class UserInfo
    {

        public string Name { get; set; }
        public int Id { get; set; }

        public string UserAccount { get; set; }
    }

    public class FolderBaseItem
    {
        public FileOperation Operation { get; set; }
        public int Level { get; set; }
        public string FolderName { get; set; }
    }

    /// <summary>
    /// 用户云盘
    /// </summary>
    public class UserBaseItem
    {
        public UserInfo userInfo { get; set; }
        public CloudType cloudType { get; set; }
    }

    public class FilesBaseItem
    {
        public string Id { get; set; }
        public bool IsFolder { get; set; }
        public int Level { get; set; }
        public string Name { get; set; }
        public string MimeType { get; set; }
        public long? Size { get; set; }
        public DateTime? CreatedTime { get; set; }
    }

    #endregion

    #region GooglrDrive
    //文件夹
    public class GoogleDriveFolder: FolderBaseItem
    {
     
        
    }


    /// <summary>
    /// 谷歌云盘的文件
    /// </summary>
    public class GoogleDriveFiles: FilesBaseItem
    {
        public long? Version { get; set; }
    }

    #endregion


    #region DropbBox

    /// <summary>
    /// 谷歌云盘的文件
    /// </summary>
    public class DropbBoxFiles : FilesBaseItem
    {
        public string PathDisplay { get; set; }
    }
    public class DropbBoxFolder : FolderBaseItem
    {


    }

    /// <summary>
    /// 指定某云盘某用户，对文件的操作
    /// </summary>
    public class FileOperation
    {
        public string SourceFileName { get; set; }
        public string SourceFile { get; set; }
        public UserBaseItem User { get; set; }
        public FilesBaseItem DoFile { get; set; }
        public FileOperation(UserBaseItem user, FilesBaseItem doFile)
        {
            User = user;
            DoFile = doFile;
        }
    }

    #endregion


}
