using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using EQNetwork.Objects;
using EQNetwork.Interfaces;
using EQNetwork.Utility;

namespace EQNetwork.Services
{
    public partial class ContentFileService : IContentFileService
    {
        private EQProcess _eq;
        public ContentFileService(EQProcess eq)
        {
            _eq = eq;
        }

        private IEQApiService _api { get { return _eq.EQApiService; } }

        public ContentFile Get(int contentFileId) { return _api.ContentFile_Get(contentFileId); }
        public ContentFile Get(string filename) { return _api.ContentFile_Get(filename); }

        public void Create(ref ContentFile contentFile) { _api.ContentFile_Create(ref contentFile); }
        public void CreateFromUrl(ref ContentFile contentFile, string url) { _api.ContentFile_CreateFromUrl(ref contentFile, url); }

        public void Update(ref ContentFile contentFile) { _api.ContentFile_Update(ref contentFile); }
        public void UpdateSortBy(int contentFileId, float? sortBy) { _api.ContentFile_UpdateSortBy(contentFileId, sortBy); }

        public void Delete(ContentFile contentFile) { _api.ContentFile_Delete(contentFile); }
        public void Delete(int contentFileId) { _api.ContentFile_Delete(contentFileId); }

        public void ChangeCollection(int contentFileId, int old_CollectionId, int new_CollectionId) { _api.ContentFile_ChangeCollection(contentFileId, old_CollectionId, new_CollectionId); }
        public void FlagAsInappropriate(int contentFileId) { _api.ContentFile_FlagAsInappropriate(contentFileId); }

        public List<Post> ListPosts(string filename, PagingParameters pagingParameters) { return _api.ContentFile_ListPosts(filename, pagingParameters); }

        public void SocialAdd(int contentFileId, string action, Db.SocialService? exclude, bool? force) { _api.ContentFile_SocialAdd(contentFileId, action, exclude, force); }
        public void SocialRemove(int contentFileId, string action, bool? force) { _api.ContentFile_SocialRemove(contentFileId, action, force); }

        public void MarkAsViewed(int contentFileId) { _api.ContentFile_Viewed(contentFileId); }
    }
}
