using System;
namespace LibGit2Sharp.Handlers
{
///
/// Delegate definition to handle Progress callback.
/// Returns the text as reported by the server. The text
/// in the serverProgressOutput parameter is not delivered
/// in any particular units (i.e. not necessarily delivered
/// as whole lines) and is likely to be chunked as partial lines.
///
/// text reported by the server.
/// Text can be chunked at arbitrary increments (i.e. can be composed
/// of a partial line of text).
/// True to continue, false to cancel.
public delegate bool ProgressHandler(string serverProgressOutput);
///
/// Delegate definition to handle UpdateTips callback.
///
/// Name of the updated reference.
/// Old ID of the reference.
/// New ID of the reference.
/// True to continue, false to cancel.
public delegate bool UpdateTipsHandler(string referenceName, ObjectId oldId, ObjectId newId);
///
/// Delegate definition for the credentials retrieval callback
///
/// The url
/// Username which was extracted from the url, if any
/// Credential types which the server accepts
public delegate Credentials CredentialsHandler(string url, string usernameFromUrl, SupportedCredentialTypes types);
///
/// Delegate definition for transfer progress callback.
///
/// The object containing progress information.
/// True to continue, false to cancel.
public delegate bool TransferProgressHandler(TransferProgress progress);
///
/// Delegate definition to indicate that a repository is about to be operated on.
/// (In the context of a recursive operation).
///
/// Context on the repository that is being operated on.
/// true to continue, false to cancel.
public delegate bool RepositoryOperationStarting(RepositoryOperationContext context);
///
/// Delegate definition to indicate that an operation is done in a repository.
/// (In the context of a recursive operation).
///
/// Context on the repository that is being operated on.
public delegate void RepositoryOperationCompleted(RepositoryOperationContext context);
///
/// Delegate definition for callback reporting push network progress.
///
/// The current number of objects sent to server.
/// The total number of objects to send to the server.
/// The number of bytes sent to the server.
/// True to continue, false to cancel.
public delegate bool PushTransferProgressHandler(int current, int total, long bytes);
///
/// Delegate definition for callback reporting pack builder progress.
///
/// The current stage progress is being reported for.
/// The current number of objects processed in this this stage.
/// The total number of objects to process for the current stage.
/// True to continue, false to cancel.
public delegate bool PackBuilderProgressHandler(PackBuilderStage stage, int current, int total);
///
/// Delegate definition to handle reporting errors when updating references on the remote.
///
/// The reference name and error from the server.
public delegate void PushStatusErrorHandler(PushStatusError pushStatusErrors);
///
/// Delegate definition for checkout progress callback.
///
/// Path of the updated file.
/// Number of completed steps.
/// Total number of steps.
public delegate void CheckoutProgressHandler(string path, int completedSteps, int totalSteps);
///
/// Delegate definition for checkout notification callback.
///
/// The path the callback corresponds to.
/// The checkout notification type.
/// True to continue checkout operation; false to cancel checkout operation.
public delegate bool CheckoutNotifyHandler(string path, CheckoutNotifyFlags notifyFlags);
///
/// Delegate definition for unmatched path callback.
///
/// This callback will be called to notify the caller of unmatched path.
///
///
/// The unmatched path.
public delegate void UnmatchedPathHandler(string unmatchedPath);
///
/// Delegate definition for remote rename failure callback.
///
/// This callback will be called to notify the caller of fetch refspecs
/// that haven't been automatically updated and need potential manual tweaking.
///
///
/// The refspec which didn't match the default.
public delegate void RemoteRenameFailureHandler(string problematicRefspec);
///
/// The stages of pack building.
///
public enum PackBuilderStage
{
///
/// Counting stage.
///
Counting,
///
/// Deltafying stage.
///
Deltafying
}
///
/// Delegate definition for logging. This callback will be used to
/// write logging messages in libgit2 and LibGit2Sharp.
///
/// The level of the log message.
/// The log message.
public delegate void LogHandler(LogLevel level, string message);
}