using System;
using System.Collections.Generic;
namespace Umbraco.Core.Models.PublishedContent
{
///
///
/// Represents a published content item.
///
///
/// Can be a published document, media or member.
///
public interface IPublishedContent : IPublishedElement
{
#region Content
// todo - IPublishedContent properties colliding with models
// we need to find a way to remove as much clutter as possible from IPublishedContent,
// since this is preventing someone from creating a property named 'Path' and have it
// in a model, for instance. we could move them all under one unique property eg
// Infos, so we would do .Infos.SortOrder - just an idea - not going to do it in v8
///
/// Gets the unique identifier of the content item.
///
int Id { get; }
///
/// Gets the name of the content item.
///
///
/// The value of this property is contextual. When the content type is multi-lingual,
/// this is the name for the 'current' culture. Otherwise, it is the invariant name.
///
string Name { get; }
///
/// Gets the url segment of the content item.
///
///
/// The value of this property is contextual. When the content type is multi-lingual,
/// this is the name for the 'current' culture. Otherwise, it is the invariant url segment.
///
string UrlSegment { get; }
///
/// Gets the sort order of the content item.
///
int SortOrder { get; }
///
/// Gets the tree level of the content item.
///
int Level { get; }
///
/// Gets the tree path of the content item.
///
string Path { get; }
///
/// Gets the identifier of the template to use to render the content item.
///
int TemplateId { get; }
///
/// Gets the identifier of the user who created the content item.
///
int CreatorId { get; }
///
/// Gets the name of the user who created the content item.
///
string CreatorName { get; }
///
/// Gets the date the content item was created.
///
DateTime CreateDate { get; }
///
/// Gets the identifier of the user who last updated the content item.
///
int WriterId { get; }
///
/// Gets the name of the user who last updated the content item.
///
string WriterName { get; }
///
/// Gets the date the content item was last updated.
///
///
/// For published content items, this is also the date the item was published.
/// This date is always global to the content item, see GetCulture().Date for the
/// date each culture was published.
///
DateTime UpdateDate { get; }
///
/// Gets the url of the content item.
///
///
/// The value of this property is contextual. It depends on the 'current' request uri,
/// if any. In addition, when the content type is multi-lingual, this is the url for the
/// 'current' culture. Otherwise, it is the invariant url.
///
string Url { get; }
///
/// Gets the url of the content item.
///
///
/// The value of this property is contextual. It depends on the 'current' request uri,
/// if any. In addition, when the content type is multi-lingual, this is the url for the
/// specified culture. Otherwise, it is the invariant url.
///
string GetUrl(string culture = ".");
///
/// Gets culture infos for a culture.
///
PublishedCultureInfos GetCulture(string culture = ".");
///
/// Gets culture infos.
///
///
/// Contains only those culture that are available. For a published content, these are
/// the cultures that are published. For a draft content, those that are 'available' ie
/// have a non-empty content name.
///
IReadOnlyDictionary Cultures { get; }
///
/// Gets the type of the content item (document, media...).
///
PublishedItemType ItemType { get; }
///
/// Gets a value indicating whether the content is draft.
///
/// A content is draft when it is the unpublished version of a content, which may
/// have a published version, or not.
bool IsDraft { get; }
#endregion
#region Tree
///
/// Gets the parent of the content item.
///
/// The parent of root content is null.
IPublishedContent Parent { get; }
///
/// Gets the children of the content item.
///
/// Children are sorted by their sortOrder.
IEnumerable Children { get; }
#endregion
#region Properties
///
/// Gets a property identified by its alias.
///
/// The property alias.
/// A value indicating whether to navigate the tree upwards until a property with a value is found.
/// The property identified by the alias.
///
/// Navigate the tree upwards and look for a property with that alias and with a value (ie HasValue is true).
/// If found, return the property. If no property with that alias is found, having a value or not, return null. Otherwise
/// return the first property that was found with the alias but had no value (ie HasValue is false).
/// The alias is case-insensitive.
///
IPublishedProperty GetProperty(string alias, bool recurse);
#endregion
}
}