/*=============================================================================
Project: SharpImage
Module: siIApplication.cs
Language: C#
Author: Dan Mueller
Date: $Date: 2007-07-06 10:57:00 +1000 (Fri, 06 Jul 2007) $
Revision: $Revision: 2 $
Copyright (c) Queensland University of Technology (QUT) 2007.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=============================================================================*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using SharpImage.Rendering;
using SharpImage.Script;
using SharpImage.Forms;
namespace SharpImage.Main
{
public interface IApplication
{
#region Properties
//=====================================================================
///
/// Gets the name-value pair Metadata variables of the Application.
///
Dictionary Metadata
{
get;
}
///
/// Gets the console to display script feedback/info.
///
siFormScriptConsole ScriptConsole
{
get;
}
///
/// Gets the current RendererBase selected in the Application.
///
siRenderer CurrentRenderer
{
get;
}
///
/// Gets the list of RendererBase objects.
///
List Renderers
{
get;
}
//=====================================================================
#endregion
#region Methods
//=====================================================================
// Invoke methods
// NOTE: IronPython can not use the params method, so explicit declarations are exposed.
bool InvokeRequired { get; }
object Invoke(Delegate method);
object Invoke(Delegate method, params object[] args);
object InvokeArg0(Delegate method);
object InvokeArg1(Delegate method, object arg1);
object InvokeArg2(Delegate method, object arg1, object arg2);
object InvokeArg3(Delegate method, object arg1, object arg2, object arg3);
object InvokeArg4(Delegate method, object arg1, object arg2, object arg3, object arg4);
// Thread-safe MessageBox.Show methods
void ShowMessageBox(string text);
void ShowMessageBox(string text, string caption);
void ShowMessageBox(string text, string caption, MessageBoxButtons buttons);
void ShowMessageBox(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon);
///
/// Refresh the application
///
void Refresh();
///
/// Shows a Renderer in the Application.
///
///
/// This method is thread-safe.
///
///
void ShowRenderer(siRenderer renderer);
///
/// Shows the given image in a new siGdiSliceRenderer.
///
///
/// This method is thread-safe.
///
///
void ShowImageInNewRenderer(itk.itkImageBase image);
///
/// Adds a FormToolBase to the Application. This method allows the
/// Application to control the addition of forms for different
/// tools.
///
///
/// This method is thread-safe.
///
///
void AddTool(siFormTool form);
///
/// Sets the Application as working (make cursor hourglass, etc.).
///
///
/// This method is thread-safe.
///
void SetApplicationAsWorking();
///
/// Sets the total or partial progress of the script.
///
///
/// This method is thread-safe.
///
/// The progress percentage in the range [0-100].
void SetApplicationProgress(int progress);
///
/// Sets the status label of the Application.
///
///
/// This method is thread-safe.
///
/// The new value to display in the status box.
void SetApplicationStatusLabel(string status);
///
/// Sets the application as ready and clears any status messages
/// after waiting for the given pause (in milliseconds).
///
///
/// This method is thread-safe.
///
/// The amount of time to wait before clearing the
/// status label. If negative, then set immediately
void SetApplicationAsReady(int pause);
///
/// Show the open image dialog with the given title.
/// The image is read and returned on success.
///
/// True and the image is displayed in a default renderer, otherwise the image is not displayed.
/// The title of the dialog. If the title is null or empty, the default title is used.
/// The opened image or null on cancel/failure.
itk.itkImageBase OpenImage(bool display, string title);
///
/// Show the open image dialog with the given title, pixeltype and dimension.
/// The image is read and returned on success.
///
/// True and the image is displayed in a default renderer, otherwise the image is not displayed.
/// The title of the dialog. If the title is null or empty, the default title is used.
/// The pixel type of the image to open. The pixel type combobox is NOT displayed.
/// The dimension of the image to open. The dimension combobox is NOT displayed.
///
itk.itkImageBase OpenImage(bool display, string title, itk.itkPixelType pixelType, int dim);
///
/// Show the open image dialog with the given title, pixeltype and dimension.
/// The image is read and returned on success.
///
/// True and the image is displayed in a default renderer, otherwise the image is not displayed.
/// The title of the dialog. If the title is null or empty, the default title is used.
/// The type of the image to open.
///
itk.itkImageBase OpenImage(bool display, string title, itk.itkImageBase image);
///
/// Open an image in a new renderer from a given path and type string.
/// For example: "C:/Temp/test1.png#F2"
///
/// The path and type of the image to open.
///
itk.itkImageBase OpenImage(string pathAndTypeString);
///
/// Saves the first input of the current renderer.
///
void SaveImage();
///
/// Saves the first input of the current renderer to the given path.
///
///
void SaveImageAs(string fullpath);
//=====================================================================
#endregion
}
}