using System;
using System.Collections.Generic;
using JetBrains.Annotations;
using Unity.Cloud.Collaborate.Models.Structures;
namespace Unity.Cloud.Collaborate.Models
{
internal interface IHistoryModel : IModel
{
///
/// Event triggered when the history list has been updated.
///
event Action HistoryListUpdated;
///
/// Event triggered when the requested page of revisions is received.
///
event Action> HistoryListReceived;
///
/// Event triggered when the requested revision is received.
///
event Action SelectedRevisionReceived;
///
/// Event triggered when the busy status changes.
///
event Action BusyStatusUpdated;
///
/// Event triggered when the requested entry count is received.
///
event Action EntryCountUpdated;
///
/// Whether or not the model is busy with a request.
///
bool Busy { get; }
///
/// Current page number.
///
int PageNumber { get; set; }
///
/// Currently selected revision id.
///
[NotNull]
string SelectedRevisionId { get; }
///
/// Revision saved before domain reload.
///
[NotNull]
string SavedRevisionId { get; }
///
/// True if a revision is currently selected.
///
bool IsRevisionSelected { get; }
///
/// Request the current page of given size. Result returns via the HistoryListReceived event.
///
///
void RequestPageOfRevisions(int pageSize);
///
/// Request the revision with the given id. Result returned via the SelectedRevisionReceived event.
///
///
void RequestSingleRevision([NotNull] string revisionId);
///
/// Request the count of entries. Result returned via the EntryCountUpdated event.
///
void RequestEntryNumber();
///
/// Request to update the state of the project to a new provided revision.
///
/// New revision id of the project to go to.
void RequestUpdateTo([NotNull] string revisionId);
///
/// Request to take the state of the project back to the given (and current) revision.
///
/// Current revision id of the project to go back to.
void RequestRestoreTo([NotNull] string revisionId);
///
/// Request to take the state of the project back to the given revision, but do not change the current revision or history.
///
/// Revision id to go back to.
void RequestGoBackTo([NotNull] string revisionId);
///
/// Returns true if revert is supported.
///
bool SupportsRevert { get; }
///
/// Request to revert the specified files to the given revision.
///
/// Revision to revert the files back to.
/// Files to revert back.
void RequestRevert([NotNull] string revisionId, [NotNull] IReadOnlyList files);
}
}