|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Text; |
| 4 | + |
| 5 | +using System.Runtime.Versioning; |
| 6 | + |
| 7 | +using LogExpert.Core.EventArguments; |
| 8 | +using LogExpert.Dialogs; |
| 9 | + |
| 10 | +namespace LogExpert.UI.Services; |
| 11 | + |
| 12 | +/// <summary> |
| 13 | +/// Controls menu and toolbar state based on application state. |
| 14 | +/// Thread-safe UI updates via SynchronizationContext. |
| 15 | +/// </summary> |
| 16 | +[SupportedOSPlatform("windows")] |
| 17 | +internal interface IMenuToolbarController : IDisposable |
| 18 | +{ |
| 19 | + /// <summary> |
| 20 | + /// Initializes controller with menu, toolbar, and timestamp control references. |
| 21 | + /// Must be called on UI thread. |
| 22 | + /// </summary> |
| 23 | + void InitializeMenus (MenuStrip mainMenu, ToolStrip buttonToolbar, ToolStrip externalToolsToolStrip, |
| 24 | + DateTimeDragControl dragControlDateTime, CheckBox checkBoxFollowTail); |
| 25 | + |
| 26 | + /// <summary> |
| 27 | + /// Applies localized resource strings and ToolTips to all menu/toolbar items. |
| 28 | + /// </summary> |
| 29 | + void ApplyLocalization (); |
| 30 | + |
| 31 | + /// <summary> |
| 32 | + /// Updates all menus, toolbars, encoding, highlight group, and timestamp control |
| 33 | + /// based on the GUI state event args from a LogWindow. |
| 34 | + /// </summary> |
| 35 | + /// <remarks> |
| 36 | + /// Consumes <see cref="GuiStateEventArgs"/> directly — no intermediate mapping needed. |
| 37 | + /// </remarks> |
| 38 | + void UpdateGuiState (GuiStateEventArgs state, bool timestampControlEnabled); |
| 39 | + |
| 40 | + /// <summary> |
| 41 | + /// Updates encoding menu to show current encoding. |
| 42 | + /// Also updates the ANSI menu item header text. |
| 43 | + /// </summary> |
| 44 | + void UpdateEncodingMenu (Encoding currentEncoding); |
| 45 | + |
| 46 | + /// <summary> |
| 47 | + /// Updates highlight groups combo box. |
| 48 | + /// </summary> |
| 49 | + void UpdateHighlightGroups (IEnumerable<string> groups, string selectedGroup); |
| 50 | + |
| 51 | + /// <summary> |
| 52 | + /// Populates file history menu with recent files. |
| 53 | + /// Includes right-click removal support. |
| 54 | + /// </summary> |
| 55 | + void PopulateFileHistory (IEnumerable<string> fileHistory); |
| 56 | + |
| 57 | + // Events |
| 58 | + event EventHandler<HistoryItemClickedEventArgs> HistoryItemClicked; |
| 59 | + event EventHandler<HistoryItemClickedEventArgs> HistoryItemRemoveRequested; |
| 60 | + event EventHandler<HighlightGroupSelectedEventArgs> HighlightGroupSelected; |
| 61 | +} |
0 commit comments