using System;
using System.Collections.Generic;
namespace Umbraco.Core.Models
{
///
/// Represents a document.
///
///
/// A document can be published, rendered by a template.
///
public interface IContent : IContentBase
{
///
/// Gets or sets the template used to render the content.
///
ITemplate Template { get; set; }
///
/// Gets a value indicating whether the content is published.
///
bool Published { get; }
PublishedState PublishedState { get; }
///
/// Gets a value indicating whether the content has been edited.
///
bool Edited { get; }
///
/// Gets the published version identifier.
///
int PublishedVersionId { get; }
///
/// Gets a value indicating whether the content item is a blueprint.
///
bool Blueprint { get; }
///
/// Gets the template used to render the published version of the content.
///
/// When editing the content, the template can change, but this will not until the content is published.
ITemplate PublishTemplate { get; }
///
/// Gets the name of the published version of the content.
///
/// When editing the content, the name can change, but this will not until the content is published.
string PublishName { get; }
///
/// Gets the identifier of the user who published the content.
///
int? PublisherId { get; }
///
/// Gets the date and time the content was published.
///
DateTime? PublishDate { get; }
///
/// Gets or sets the date and time the content item should be published.
///
DateTime? ReleaseDate { get; set; }
///
/// Gets or sets the date and time the content should be unpublished.
///
DateTime? ExpireDate { get; set; }
///
/// Gets the content type of this content.
///
IContentType ContentType { get; }
///
/// Gets the current status of the content.
///
ContentStatus Status { get; }
///
/// Gets a value indicating whether a given culture is available.
///
///
/// A culture becomes available whenever values for this culture are published,
/// and it becomes unavailable whenever values for this culture are unpublished.
/// fixme - what's setting this?
///
bool IsCultureAvailable(string languageId);
///
/// Gets the name of the published version of the content for a given culture.
///
///
/// When editing the content, the name can change, but this will not until the content is published.
/// When is null, gets the invariant
/// language, which is the value of the property.
/// fixme - what's setting this?
///
string GetPublishName(string languageId);
///
/// Gets the published names of the content.
///
///
/// Because a dictionary key cannot be null this cannot get the invariant
/// name, which must be get via the property.
///
IReadOnlyDictionary PublishNames { get; }
// fixme - these two should move to some kind of service
///
/// Changes the for the current content object
///
/// New ContentType for this content
/// Leaves PropertyTypes intact after change
void ChangeContentType(IContentType contentType);
///
/// Changes the for the current content object and removes PropertyTypes,
/// which are not part of the new ContentType.
///
/// New ContentType for this content
/// Boolean indicating whether to clear PropertyTypes upon change
void ChangeContentType(IContentType contentType, bool clearProperties);
///
/// Creates a deep clone of the current entity with its identity/alias and it's property identities reset
///
///
IContent DeepCloneWithResetIdentities();
///
/// Publishes all values.
///
/// A value indicating whether the values could be published.
///
/// The document must then be published via the content service.
/// Values are not published if they are not valie.
///
bool PublishAllValues();
///
/// Publishes values.
///
/// A value indicating whether the values could be published.
///
/// The document must then be published via the content service.
/// Values are not published if they are not valid.
///
bool PublishValues(int? languageId = null, string segment = null);
///
/// Publishes the culture/any values.
///
/// A value indicating whether the values could be published.
///
/// The document must then be published via the content service.
/// Values are not published if they are not valie.
///
bool PublishCultureValues(int? languageId = null);
///
/// Clears all published values.
///
void ClearAllPublishedValues();
///
/// Clears published values.
///
void ClearPublishedValues(int? languageId = null, string segment = null);
///
/// Clears the culture/any published values.
///
void ClearCulturePublishedValues(int? languageId = null);
///
/// Copies values from another document.
///
void CopyAllValues(IContent other);
///
/// Copies values from another document.
///
void CopyValues(IContent other, int? languageId = null, string segment = null);
///
/// Copies culture/any values from another document.
///
void CopyCultureValues(IContent other, int? languageId = null);
}
}