Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkenneth.skovhede@gmail.com <kenneth.skovhede@gmail.com@59da171f-624f-0410-aa54-27559c288bec>2010-06-20 01:08:21 +0400
committerkenneth.skovhede@gmail.com <kenneth.skovhede@gmail.com@59da171f-624f-0410-aa54-27559c288bec>2010-06-20 01:08:21 +0400
commita40f6acf378d4ceeae9fcdda1e759160d96a9d37 (patch)
tree01ede0260a9416c16e6678cd6bf9a20cd2373acb /Duplicati/Library/Interface/IGUIControl.cs
parent8296404414aefa870971d847f73b091a9c25245f (diff)
A fairly large refactoring of the code.
This was based on the idea that the interfaces should remain static. I hope this change is enough to ensure stable interfaces until release 1.2. Overview of changes: Moved all interfaces into the same dll. Encryption and compression is now plugable modules, just as the backends. Encryption/compression can now register an UI. Encryption now uses AESCrypt as a default. GPG does not default to using the --armor option. Added support for generic modules, but none are written yet. Added support for plugable settings pages in the "Options" dialog. Fixed issue #148. Duplicati now uses AESCrypt as the default encryption format. Fixed issue #199. GPG now supports custom commandline options. Fixed issue #207. Encryption modules are now plugable. Fixed issue #118. S3 credentials are now stored. Fixed issue #151. Backends can now register system wide options. git-svn-id: https://duplicati.googlecode.com/svn/trunk@427 59da171f-624f-0410-aa54-27559c288bec
Diffstat (limited to 'Duplicati/Library/Interface/IGUIControl.cs')
-rw-r--r--Duplicati/Library/Interface/IGUIControl.cs68
1 files changed, 68 insertions, 0 deletions
diff --git a/Duplicati/Library/Interface/IGUIControl.cs b/Duplicati/Library/Interface/IGUIControl.cs
new file mode 100644
index 000000000..5b791ba77
--- /dev/null
+++ b/Duplicati/Library/Interface/IGUIControl.cs
@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+
+namespace Duplicati.Library.Interface
+{
+ /// <summary>
+ /// The interface that defines a GUI for a plugable component, such as a backend or encryption module.
+ /// All options are stored in a dictionary, which is persisted to the database.
+ /// When creating a backup, the option dictionary will be empty, when editing, it will contain the contents from the last edit.
+ /// The options in the dictionary are free form, and should contain the state of the userinterface.
+ /// When the backup is invoked, the <see cref="GetConfiguration"/> method is invoked with the options dictionary.
+ /// At this point the control should setup the Duplicati options, based on the saved userinterface state.
+ /// This enables the user interface to be decoupled from the actual options.
+ /// </summary>
+ public interface IGUIControl
+ {
+ /// <summary>
+ /// The title of the page, shown as the wizard title or the tab caption
+ /// </summary>
+ string PageTitle { get; }
+
+ /// <summary>
+ /// The page description, shown as a helptext in the wizard or as a tooltip on a tab
+ /// </summary>
+ string PageDescription { get; }
+
+ /// <summary>
+ /// A method to retrieve a user interface control.
+ /// The method should keep a reference to the dictionary.
+ /// The control will be resized to fit in the container.
+ /// </summary>
+ /// <param name="applicationSettings">The set of settings defined by the calling application</param>
+ /// <param name="options">A set of options, either empty or previously stored by the control</param>
+ /// <returns>The control that represents the user interface</returns>
+ Control GetControl(IDictionary<string, string> applicationSettings, IDictionary<string, string> options);
+
+ /// <summary>
+ /// Method that is called when the user leaves the form.
+ /// This method can be used to store data from the interface in the dictionary,
+ /// so the user interface can be reconstructed later.
+ /// Do not throw exceptions to interrupt this method as that will remove the "back" option in the wizard,
+ /// return false in the <see cref="Validate"/> method instead.
+ /// </summary>
+ /// <param name="control">The UI object created by the GetControl call</param>
+ void Leave(Control control);
+
+ /// <summary>
+ /// A method that is called when the form should be validated.
+ /// The method should inform the user if the validation fails.
+ /// </summary>
+ /// <param name="control">The UI object created by the GetControl call</param>
+ /// <returns>True if the data is valid, false otherwise</returns>
+ bool Validate(Control control);
+
+ /// <summary>
+ /// This method sets up the Duplicati options, based on a previous setup.
+ /// The method should read the saved setup from <paramref name="guiOptions"/>, and set the appropriate <paramref name="commandlineOptions"/>.
+ /// If the UI represents a backend, the function should return the backend URL, otherwise the return value is ignored.
+ /// </summary>
+ /// <param name="applicationSettings">The set of settings defined by the calling application</param>
+ /// <param name="guiOptions">A set of previously saved options for the control</param>
+ /// <param name="commandlineOptions">A set of commandline options passed to Duplicati</param>
+ /// <returns>The destination path if the control is for a backend, otherwise null</returns>
+ string GetConfiguration(IDictionary<string, string> applicationSettings, IDictionary<string, string> guiOptions, IDictionary<string, string> commandlineOptions);
+ }
+}