// OpenTween - Client of Twitter
// Copyright (c) 2014 kim_upsilon (@kim_upsilon)
// All rights reserved.
//
// This file is part of OpenTween.
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 3 of the License, or (at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program. If not, see , or write to
// the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
// Boston, MA 02110-1301, USA.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenTween.Api.DataModel;
namespace OpenTween.Connection
{
///
/// Twitterでの画像の共有に使用できるサービスを表すインタフェース
///
public interface IMediaUploadService
{
///
/// アップロード可能なメディアの最大枚数
///
int MaxMediaCount { get; }
///
/// アップロード可能なファイルの種類を表す文字列 (OpenFileDialog.Filter に使用)
///
string SupportedFormatsStrForDialog { get; }
///
/// ファイルの拡張子からアップロード可能なフォーマットであるかを判定します
///
/// アップロードするファイルの拡張子 (ピリオドを含む)
bool CheckFileExtension(string fileExtension);
///
/// ファイルサイズがアップロード可能な範囲内であるかを判定します
///
/// アップロードするファイルの拡張子 (ピリオドを含む)
/// アップロードするファイルのサイズ (バイト単位)
bool CheckFileSize(string fileExtension, long fileSize);
///
/// アップロード可能なファイルサイズの上限を返します
///
/// アップロードするファイルの拡張子 (ピリオドを含む)
/// ファイルサイズの上限 (バイト単位, nullの場合は上限なし)
long? GetMaxFileSize(string fileExtension);
///
/// メディアのアップロードとツイートの投稿を行います
///
///
Task PostStatusAsync(string text, long? inReplyToStatusId, IMediaItem[] mediaItems);
///
/// 画像URLのために確保する必要のある文字数を返します
///
/// アップロードするメディアの個数
int GetReservedTextLength(int mediaCount);
///
/// IMediaUploadService で使用する /help/configuration.json の値を更新します
///
void UpdateTwitterConfiguration(TwitterConfiguration config);
}
}