using System;
using System.Collections.Generic;
using JetBrains.Annotations;
using Unity.Cloud.Collaborate.Models.Enums;
using Unity.Cloud.Collaborate.Models.Structures;
namespace Unity.Cloud.Collaborate.Models.Api
{
internal interface ISourceControlProvider
{
///
/// Event called whenever the change list is updated.
///
event Action UpdatedChangeList;
///
/// Event called whenever the selected change list is updated.
///
event Action> UpdatedSelectedChangeList;
///
/// Event called whenever the list of historical revisions is updated.
///
event Action UpdatedHistoryEntries;
///
/// Event called whenever a long operation (with progress) has completed / started.
///
event Action UpdatedOperationStatus;
///
/// Event called whenever a long operation progress has changed.
///
event Action UpdatedOperationProgress;
///
/// Event called whenever an error has occurred.
///
event Action ErrorOccurred;
///
/// Event called whenever an error has cleared.
///
event Action ErrorCleared;
///
/// Event called whenever the conflict state changes.
///
event Action UpdatedConflictState;
///
/// Event called whenever the availability of remote revisions changes.
///
event Action UpdatedRemoteRevisionsAvailability;
///
/// Event that is triggered when the project status changes.
///
event Action UpdatedProjectStatus;
///
/// Get whether there are available revisions to fetch.
///
/// True if there are revisions available
bool GetRemoteRevisionAvailability();
///
/// Get whether there is a conflict or not.
///
/// True if there is a conflict.
bool GetConflictedState();
///
/// Get the current progress state.
///
/// The current progress state. Null if no operation ongoing.
[CanBeNull]
IProgressInfo GetProgressState();
///
/// Get the current error state.
///
/// The current error state. Null if no errors presently.
[CanBeNull]
IErrorInfo GetErrorState();
///
/// Returns the current project status.
///
/// Current project status.
ProjectStatus GetProjectStatus();
///
/// Request the current change list.
///
/// Callback for the result.
void RequestChangeList([NotNull] Action> callback);
///
/// Publish files to Collaborate.
///
/// Message to commit with.
/// Changes to publish. Pass null to publish all.
void RequestPublish([NotNull] string message, [CanBeNull] IReadOnlyList changes = null);
///
/// Request a single historical revision.
///
/// Id of the revision to request.
/// Callback for the result.
void RequestHistoryEntry([NotNull] string revisionId, [NotNull] Action callback);
///
/// Request a page of historical revisions.
///
/// Where to start the page from.
/// Number of entries in the page.
/// Callback for the result.
void RequestHistoryPage(int offset, int pageSize, [NotNull] Action> callback);
///
/// Request the total number of historical revisions.
///
/// Callback for the result.
void RequestHistoryCount([NotNull] Action callback);
///
/// Revert the specified file to the state of the current revision.
/// of the source control system, or delete it if it's a new file.
///
/// Entry to discard.
void RequestDiscard([NotNull] IChangeEntry entry);
///
/// Revert the specified files to the state of the current revision.
/// of the source control system.
///
/// List of entries to discard.
void RequestBulkDiscard([NotNull] IReadOnlyList entries);
///
/// Diff the changes for the file at the given path.
///
/// Path of the file to diff.
void RequestDiffChanges([NotNull] string path);
///
/// Returns true if the provider supports revert.
///
bool SupportsRevert { get; }
///
/// Request 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);
///
/// 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);
///
/// Clears the error state.
///
void ClearError();
///
/// Show the difference between both version of a conlicted file.
///
/// Path of the file to show.
void RequestShowConflictedDifferences([NotNull] string path);
///
/// Request to choose merge for the provided conflict.
///
/// Path of the file to choose merge for.
void RequestChooseMerge([NotNull] string path);
///
/// Request to choose mine for the provided conflict.
///
/// Paths of the files to choose mine for.
void RequestChooseMine([NotNull] string[] paths);
///
/// Request to choose remote for the provided conflict.
///
/// Paths of the files to choose remote for.
void RequestChooseRemote([NotNull] string[] paths);
///
/// Request sync to latest revision.
///
void RequestSync();
///
/// Request cancel current job.
///
void RequestCancelJob();
///
/// Request to turn on the service.
///
///
void RequestTurnOnService();
///
/// Show the service page.
///
void ShowServicePage();
///
/// Show login page.
///
void ShowLoginPage();
///
/// Show no seat page.
///
void ShowNoSeatPage();
}
}