///
/// Copyright © 2003-2008 JetBrains s.r.o.
/// You may distribute under the terms of the GNU General Public License, as published by the Free Software Foundation, version 2 (see License.txt in the repository root folder).
///
using System.Drawing;
namespace JetBrains.Omea.OpenAPI
{
///
/// Manage the rules which control switching of tray icon (in the taskbar
/// area) upon some conditions.
///
/// 2.0
public interface ITrayIconManager
{
///
/// Register a rule for an tray icon, which changes an icon whenever
/// its conditions match the context of the application.
///
/// Name of a watcher.
/// A list of resource types valid for a watcher.
/// Conditions necessary to be matched for an icon.
/// Exceptions necessary to be matched for an icon.
/// The Icon graphical object.
IResource RegisterTrayIconRule( string name, string[] resTypes, IResource[] conditions, IResource[] exceptions, Icon icon );
IResource RegisterTrayIconRule( string name, string[] resTypes, IResource[][] conditionGroups, IResource[] exceptions, Icon icon );
///
/// Reregister a rule for an tray icon - do not create new rule resource but rather
/// reset the parameters of the existing one. Required by IFilteringForms API behavior.
///
/// Resource of an existing rule.
/// Name of a watcher.
/// A list of resource types valid for a watcher.
/// Conditions necessary to be matched for an icon.
/// Exceptions necessary to be matched for an icon.
/// The Icon graphical object.
/// 539
IResource ReregisterTrayIconRule( IResource existingRule, string name, string[] resTypes,
IResource[] conditions, IResource[] exceptions, Icon icon );
///
/// Unregister a tray icon watcher.
///
/// Name of a watcher.
void UnregisterTrayIconRule( string name );
///
/// Check whether there exists (registered) a tray icon watcher with the given name.
///
/// Name of a watcher.
/// True if the watcher with the given name is registered already.
bool IsTrayIconRuleRegistered( string name );
///
/// Find a resource corresponding to the tray icon watcher with the given name.
///
/// Name of a watcher.
/// A resource corresponding to the watcher name. Null if there is no such watcher.
IResource FindRule( string name );
///
/// Rename a rule.
///
/// A resource representing a rule (returned by RegisterRule method).
/// New name for a resource.
/// Throws ArgumentException object if the rule with the new name already exists.
void RenameRule( IResource rule, string newName );
///
/// Creates new TrayIcon rule and clones all necessary information into
/// the new destination.
///
/// Resource from which the information will be cloned.
/// Name of a new TrayIcon rule.
/// 501
/// A resource for a new rule.
IResource CloneRule( IResource sourceRule, string newName );
///
/// Switches Tray Icon Rule Manager into mode when a rule's icon is
/// removed when there is no resource matching the rule's condition.
///
void SetStrictMode();
///
/// Switches Tray Icon Rule Manager into mode when a rule's icon is
/// removed when at least one resource matching the rule's condition
/// becomes invalid (e.g. one item becomes read).
///
void SetOutlookMode();
///
/// Gets a value indicating whether the tray icon manager is currently in a mode
/// in which a rule's icon isremoved when at least one resource matching the rule's condition
/// becomes invalid.
///
bool IsOutlookMode { get; }
}
}