RDPAddins.NET/RDPAddins.Common/IUI.cs

99 lines
3.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
namespace RDPAddins.Common
{
/// <summary>
/// Represents UI parts of the IChannel
/// </summary>
public interface IUI
{
/// <summary>
/// Occurs when the balloon tip is clicked.
/// </summary>
event BalloonTipClickedHandler BalloonTipClicked;
/// <summary>
/// Occurs when the hannel is trying create addin's control. If not hooked addin will not have control.
/// </summary>
event ControlCreatingHandler ControlCreating;
/// <summary>
/// Occurs when Channel is trying create addin's menu. If not hooked addin will not have menu.
/// </summary>
event MenuCreatingHandler MenuCreating;
/// <summary>
/// Occurs when Channel is trying create addin's tray menu. If not hooked addin will not have tray menu.
/// </summary>
event MenuCreatingHandler TrayMenuCreating;
/// <summary>
/// Occurs when Channel is trying to get addin's icon. Only appears when addin has control. If not hooked addin and addin has control then addin will have default icon.
/// </summary>
event IconCreatingHandler IconCreating;
/// <summary>
/// Get UI's channel
/// </summary>
IChannel Parent { get; }
/// <summary>
/// Displays the balloon tip in the taskbar.
/// </summary>
/// <param name="timeout">The time period, in milliseconds, the balloon tip should display.</param>
/// <param name="tipTitle">The title to display on the balloon tip.</param>
/// <param name="tipText">The text to display on the balloon tip.</param>
/// <param name="tipIcon">One of the System.Windows.Forms.ToolTipIcon values.</param>
/// <param name="context">This object will sent to BalloonTipClicked event.</param>
void ShowBalloonTip(int timeout, string tipTitle, string tipText, ToolTipIcon tipIcon, object context);
/// <summary>
/// Shows main form and selct tab with addin's control(if exists).
/// </summary>
void ShowControl();
/// <summary>
/// Executes a action on the UI thread. (It calls System.Windows.Forms.Form.Invoke).
/// </summary>
/// <param name="action">The action delegate.</param>
void DoOnUIThread(Action action);
/// <summary>
/// Gets or sets visibility of addin's control(if exists).
/// </summary>
bool Visible { get; set; }
}
/// <summary>
/// Represents the method that will handle the BalloonTipClicked event of a IUI.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="context">Parameter sent by IUI.ShowBalloonTip method.</param>
public delegate void BalloonTipClickedHandler(IUI sender, object context);
/// <summary>
/// Represents the method that will handle the ControlCreating event of a IUI.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <returns>Should returns addin's control if needed.</returns>
public delegate Control ControlCreatingHandler(IUI sender);
/// <summary>
/// Represents the method that will handle the MenuCreating and TrayMenuCreating event of a IUI.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <returns>Should returns addin's menu or tray menu if needed.</returns>
public delegate Menu MenuCreatingHandler(IUI sender);
/// <summary>
/// Represents the method that will handle the IconCreating event of a IUI.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <returns>Should returns addin's icon if needed.</returns>
public delegate Image IconCreatingHandler(IUI sender);
}