using System;
using System.Collections.Generic;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Entities;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.Querying;
using Umbraco.Core.Services;
namespace Umbraco.Core.Persistence.Repositories
{
///
/// Defines the base implementation of a repository for content items.
///
public interface IContentRepository : IReadWriteQueryRepository
where TEntity : IUmbracoEntity
{
///
/// Gets versions.
///
/// Current version is first, and then versions are ordered with most recent first.
IEnumerable GetAllVersions(int nodeId);
///
/// Gets versions.
///
/// Current version is first, and then versions are ordered with most recent first.
IEnumerable GetAllVersionsSlim(int nodeId, int skip, int take);
///
/// Gets version identifiers.
///
/// Current version is first, and then versions are ordered with most recent first.
IEnumerable GetVersionIds(int id, int topRows);
///
/// Gets a version.
///
TEntity GetVersion(int versionId);
///
/// Deletes a version.
///
void DeleteVersion(int versionId);
///
/// Deletes all versions older than a date.
///
void DeleteVersions(int nodeId, DateTime versionDate);
///
/// Gets the recycle bin identifier.
///
int RecycleBinId { get; }
///
/// Gets the recycle bin content.
///
IEnumerable GetRecycleBin();
///
/// Gets the count of content items of a given content type.
///
int Count(string contentTypeAlias = null);
///
/// Gets the count of child content items of a given parent content, of a given content type.
///
int CountChildren(int parentId, string contentTypeAlias = null);
///
/// Gets the count of descendant content items of a given parent content, of a given content type.
///
int CountDescendants(int parentId, string contentTypeAlias = null);
///
/// Gets paged content items.
///
/// Here, can be null but cannot.
IEnumerable GetPage(IQuery query, long pageIndex, int pageSize, out long totalRecords,
IQuery filter, Ordering ordering);
ContentDataIntegrityReport CheckDataIntegrity(ContentDataIntegrityReportOptions options);
}
}