/// /// 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.GUIControls.CommandBar { /// /// The child command bar interface that provides for docking a command bar within a parent container, adjusting its size, dragging, etc. /// public interface ICommandBar { /// /// Assigns the (parent) command bar site that hosts this command bar and that can be requested of position or size change. /// /// Command bar site object. Must not be Null. /// This member is mandatory. void SetSite( ICommandBarSite site ); /// /// Provides the minimum size of the control. /// /// /// Tells the callee that the control can not be resized to the size below this value. /// Both components must be defined and be non-negative. /// Note that this value dictates the layouter just a SHOULD, not a MUST, and the control must be prepared to being set to an unfit size. /// This member is mandatory. /// Size MinSize { get; } /// /// Provides the maximum size of the control. /// /// /// Tells the callee that the control can not be resized to the size above this value, for example, there's no meaningful info to fill in the excessive space. /// Use for the appropriate component if you do not wish to limit its size. /// Both components must be defined and be non-negative. /// Note that this value dictates the layouter just a SHOULD, not a MUST, and the control must be prepared to being set to an unfit size. /// This member is mandatory. /// Size MaxSize { get; } /// /// Provides the optimal size of the control. /// /// /// Tells the callee that the control should be granted this size if there is such a possibility and are no constraints. /// Both components must be defined and be non-negative. /// Note that this value dictates the layouter just a SHOULD, not a MUST, and the control must be prepared to being set to an unfit size. /// This member is mandatory. /// Size OptimalSize { get; } /// /// Step for changing the size in either direction. /// /// This value means that the horizontal and vertical size of the control can be changed by the and steps only. Size Integral { get; } } /// /// Interface for the site that hosts one or more command bars. /// /// Interface for the layouter which controls the command bars placement. public interface ICommandBarSite { /// /// A command bar requests its site to move it (for example, due to being dragged by a grip). /// /// The command bar that is sending the request. /// The desired horizontal and vertical offset from the current position. /// Whether the move request was fulfilled or not. /// Note that the move request may be fulfilled partially only, for example, just horizontal not vertical move, or only a partial move up to some limit. bool RequestMove( ICommandBar sender, Size offset ); /// /// A command bar requests its site to resize it (for example, due to being resized by user). /// /// The command bar that is sending the request. /// The desired horizontal and vertical change in size, relative to the current value. /// Whether the sizing request was fulfilled or not. /// Note that the sizing request may be fulfilled partially only, for example, just horizontal not vertical sizing, or only a partial resizing up to some limit. bool RequestSize( ICommandBar sender, Size difference ); /// /// Requests the layout to be performed on the command bar site when either /// , , or /// changes and the control should be resized or repositioned accordingly. /// /// A command bar that requests the layouting. /// Whether the layouting request was accepted (True) or rejected (False). bool PerformLayout(ICommandBar sender); } }