Skip to content

Commit b32ff0e

Browse files
author
BRUNER Patrick
committed
first iteration
1 parent 72f83ce commit b32ff0e

4 files changed

Lines changed: 613 additions & 0 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace LogExpert.UI.Services;
6+
7+
/// <summary>Event args for highlight group combo box selection.</summary>
8+
internal class HighlightGroupSelectedEventArgs (string groupName) : EventArgs
9+
{
10+
public string GroupName { get; } = groupName;
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace LogExpert.UI.Services;
6+
7+
/// <summary>Event args for file history item interactions.</summary>
8+
internal class HistoryItemClickedEventArgs (string fileName) : EventArgs
9+
{
10+
public string FileName { get; } = fileName;
11+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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

Comments
 (0)