Phase L2-4: 클립보드 이미지 OCR 텍스트 추출 및 검색 - AxCopilot.csproj: TFM net8.0-windows → net8.0-windows10.0.17763.0 (Windows OCR API 활성화) - ClipboardEntry: OcrText 프로퍼티 추가 (set), Preview → OCR 텍스트 우선 표시 (72자 상한) - SavedClipEntry: OcrText 직렬화 필드 추가, BuildSnapshot/LoadHistory 연동 - ClipboardHistoryService.OnClipboardUpdate: 이미지 저장 후 백그라운드 OCR 트리거 (EnableOcrSearch 설정 체크, capturedEntry.OcrText 비동기 갱신) - ClipboardHistoryService.ImageCache.cs: ExtractOcrTextAsync() 추가 (WinRT BitmapDecoder → SoftwareBitmap → OcrEngine.RecognizeAsync, 5,000자 상한) WinRT 별칭(WinBitmapDecoder, WinSoftwareBitmap 등) 으로 WPF 네임스페이스 충돌 방지 - AppSettings.Models.cs: ClipboardHistorySettings.EnableOcrSearch (default=true) - ClipboardHistoryHandler.GetItemsAsync: OcrText 포함 검색, 'OCR ·' 표시 배지 Phase L2-5: Ctrl+Click 클립보드 항목 다중 선택 - LauncherWindow.Shell.cs: ResultList_PreviewMouseLeftButtonUp에 Ctrl+Click 분기 추가 (IsClipboardMode + Ctrl 조합 시 ToggleMergeItem 호출, 기존 단일 선택 흐름 유지) - LauncherWindow.ShortcutHelp.cs: Ctrl+Click / Shift+↑↓ / 병합 단축키 도움말 추가 빌드: 경고 0, 오류 0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
267 lines
9.4 KiB
C#
267 lines
9.4 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace AxCopilot.Models;
|
|
|
|
// 기타 설정 모델 클래스
|
|
|
|
public class WorkspaceProfile
|
|
{
|
|
[JsonPropertyName("name")]
|
|
public string Name { get; set; } = "";
|
|
|
|
[JsonPropertyName("windows")]
|
|
public List<WindowSnapshot> Windows { get; set; } = new();
|
|
|
|
[JsonPropertyName("createdAt")]
|
|
public DateTime CreatedAt { get; set; } = DateTime.Now;
|
|
}
|
|
|
|
public class WindowSnapshot
|
|
{
|
|
[JsonPropertyName("exe")]
|
|
public string Exe { get; set; } = "";
|
|
|
|
[JsonPropertyName("title")]
|
|
public string Title { get; set; } = "";
|
|
|
|
[JsonPropertyName("rect")]
|
|
public WindowRect Rect { get; set; } = new();
|
|
|
|
[JsonPropertyName("showCmd")]
|
|
public string ShowCmd { get; set; } = "Normal"; // Normal | Minimized | Maximized
|
|
|
|
[JsonPropertyName("monitor")]
|
|
public int Monitor { get; set; } = 0;
|
|
}
|
|
|
|
public class WindowRect
|
|
{
|
|
[JsonPropertyName("x")]
|
|
public int X { get; set; }
|
|
|
|
[JsonPropertyName("y")]
|
|
public int Y { get; set; }
|
|
|
|
[JsonPropertyName("width")]
|
|
public int Width { get; set; }
|
|
|
|
[JsonPropertyName("height")]
|
|
public int Height { get; set; }
|
|
}
|
|
|
|
public class AliasEntry
|
|
{
|
|
[JsonPropertyName("key")]
|
|
public string Key { get; set; } = "";
|
|
|
|
[JsonPropertyName("type")]
|
|
public string Type { get; set; } = "url"; // url | folder | app | batch | api | clipboard
|
|
|
|
[JsonPropertyName("target")]
|
|
public string Target { get; set; } = "";
|
|
|
|
[JsonPropertyName("description")]
|
|
public string? Description { get; set; }
|
|
|
|
[JsonPropertyName("showWindow")]
|
|
public bool ShowWindow { get; set; } = false;
|
|
|
|
[JsonPropertyName("adapter")]
|
|
public string? Adapter { get; set; }
|
|
|
|
[JsonPropertyName("query")]
|
|
public string? Query { get; set; }
|
|
}
|
|
|
|
public class ClipboardTransformer
|
|
{
|
|
[JsonPropertyName("key")]
|
|
public string Key { get; set; } = "";
|
|
|
|
[JsonPropertyName("type")]
|
|
public string Type { get; set; } = "regex"; // regex | script
|
|
|
|
[JsonPropertyName("pattern")]
|
|
public string? Pattern { get; set; }
|
|
|
|
[JsonPropertyName("replace")]
|
|
public string? Replace { get; set; }
|
|
|
|
[JsonPropertyName("command")]
|
|
public string? Command { get; set; }
|
|
|
|
[JsonPropertyName("timeout")]
|
|
public int Timeout { get; set; } = 5000;
|
|
|
|
[JsonPropertyName("description")]
|
|
public string? Description { get; set; }
|
|
}
|
|
|
|
public class ApiAdapter
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public string Id { get; set; } = "";
|
|
|
|
[JsonPropertyName("baseUrl")]
|
|
public string BaseUrl { get; set; } = "";
|
|
|
|
[JsonPropertyName("credentialKey")]
|
|
public string CredentialKey { get; set; } = "";
|
|
}
|
|
|
|
public class PluginEntry
|
|
{
|
|
[JsonPropertyName("path")]
|
|
public string Path { get; set; } = "";
|
|
|
|
[JsonPropertyName("enabled")]
|
|
public bool Enabled { get; set; } = true;
|
|
}
|
|
|
|
// ─── 스니펫 ───────────────────────────────────────────────────────────────────
|
|
|
|
public class SnippetEntry
|
|
{
|
|
[JsonPropertyName("key")]
|
|
public string Key { get; set; } = ""; // 트리거 키워드 (예: addr, sig)
|
|
|
|
[JsonPropertyName("name")]
|
|
public string Name { get; set; } = ""; // 표시 이름
|
|
|
|
[JsonPropertyName("content")]
|
|
public string Content { get; set; } = ""; // 확장될 전체 텍스트
|
|
}
|
|
|
|
// ─── 퀵링크 ──────────────────────────────────────────────────────────────────
|
|
|
|
/// <summary>
|
|
/// 파라미터 퀵링크 항목.
|
|
/// 예: keyword="maps", urlTemplate="https://map.naver.com/p/search/{0}"
|
|
/// 사용: ql maps 강남역 → URL에 "강남역" 치환 후 브라우저 열기
|
|
/// </summary>
|
|
public class QuickLinkEntry
|
|
{
|
|
[JsonPropertyName("keyword")]
|
|
public string Keyword { get; set; } = ""; // 트리거 키워드
|
|
|
|
[JsonPropertyName("name")]
|
|
public string Name { get; set; } = ""; // 표시 이름
|
|
|
|
[JsonPropertyName("urlTemplate")]
|
|
public string UrlTemplate { get; set; } = ""; // {0}, {1} 또는 {query} 플레이스홀더
|
|
|
|
[JsonPropertyName("description")]
|
|
public string Description { get; set; } = ""; // 설명
|
|
}
|
|
|
|
// ─── AI 스니펫 템플릿 ─────────────────────────────────────────────────────────
|
|
|
|
/// <summary>
|
|
/// AI 스니펫 템플릿 항목.
|
|
/// 예: keyword="email", prompt="다음 상황에 맞는 업무 이메일 작성: {0}"
|
|
/// 사용: ai email 프로젝트 일정 변경 안내 → AI가 이메일 초안 생성
|
|
/// </summary>
|
|
public class AiSnippetTemplate
|
|
{
|
|
[JsonPropertyName("keyword")]
|
|
public string Keyword { get; set; } = "";
|
|
|
|
[JsonPropertyName("name")]
|
|
public string Name { get; set; } = "";
|
|
|
|
[JsonPropertyName("prompt")]
|
|
public string Prompt { get; set; } = ""; // {0}, {query} 플레이스홀더 지원
|
|
}
|
|
|
|
// ─── 클립보드 히스토리 ────────────────────────────────────────────────────────
|
|
|
|
public class ClipboardHistorySettings
|
|
{
|
|
[JsonPropertyName("enabled")]
|
|
public bool Enabled { get; set; } = true;
|
|
|
|
[JsonPropertyName("maxItems")]
|
|
public int MaxItems { get; set; } = 50;
|
|
|
|
[JsonPropertyName("excludePatterns")]
|
|
public List<string> ExcludePatterns { get; set; } = new()
|
|
{
|
|
@"^\d{4}[\s\-]?\d{4}[\s\-]?\d{4}[\s\-]?\d{4}$", // 카드번호
|
|
@"^(?:\d{1,3}\.){3}\d{1,3}$" // IP 주소
|
|
};
|
|
|
|
/// <summary>이미지 클립보드 항목에서 OCR 텍스트를 자동 추출하여 검색에 활용 (Windows OCR, 로컬 처리)</summary>
|
|
[JsonPropertyName("enableOcrSearch")]
|
|
public bool EnableOcrSearch { get; set; } = true;
|
|
}
|
|
|
|
// ─── 시스템 명령 ──────────────────────────────────────────────────────────────
|
|
|
|
public class SystemCommandSettings
|
|
{
|
|
[JsonPropertyName("showLock")] public bool ShowLock { get; set; } = true;
|
|
[JsonPropertyName("showSleep")] public bool ShowSleep { get; set; } = true;
|
|
[JsonPropertyName("showRestart")] public bool ShowRestart { get; set; } = true;
|
|
[JsonPropertyName("showShutdown")] public bool ShowShutdown { get; set; } = true;
|
|
[JsonPropertyName("showHibernate")] public bool ShowHibernate { get; set; } = false;
|
|
[JsonPropertyName("showLogout")] public bool ShowLogout { get; set; } = true;
|
|
[JsonPropertyName("showRecycleBin")] public bool ShowRecycleBin { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// 시스템 명령 별칭. key = 기본 명령어(lock/sleep 등), value = 사용자 정의 별칭 목록.
|
|
/// 예: { "lock": ["잠금", "l"] } → /잠금, /l 로도 실행 가능
|
|
/// </summary>
|
|
[JsonPropertyName("commandAliases")]
|
|
public Dictionary<string, List<string>> CommandAliases { get; set; } = new();
|
|
}
|
|
|
|
// ─── 스크린 캡처 설정 ──────────────────────────────────────────────────────────
|
|
|
|
public class ScreenCaptureSettings
|
|
{
|
|
/// <summary>캡처 명령어 프리픽스. 기본값 "cap".</summary>
|
|
[JsonPropertyName("prefix")]
|
|
public string Prefix { get; set; } = "cap";
|
|
|
|
/// <summary>런처를 열지 않고 글로벌 단축키로 캡처하는 기능 활성화 여부.</summary>
|
|
[JsonPropertyName("globalHotkeyEnabled")]
|
|
public bool GlobalHotkeyEnabled { get; set; } = false;
|
|
|
|
/// <summary>글로벌 캡처 단축키 문자열. 기본값 "PrintScreen".</summary>
|
|
[JsonPropertyName("globalHotkey")]
|
|
public string GlobalHotkey { get; set; } = "PrintScreen";
|
|
|
|
/// <summary>글로벌 캡처 단축키 실행 모드. screen|window|region.</summary>
|
|
[JsonPropertyName("globalHotkeyMode")]
|
|
public string GlobalHotkeyMode { get; set; } = "screen";
|
|
|
|
/// <summary>스크롤 캡처 프레임 간 대기 시간(ms). 기본값 120.</summary>
|
|
[JsonPropertyName("scrollDelayMs")]
|
|
public int ScrollDelayMs { get; set; } = 120;
|
|
}
|
|
|
|
// ─── 잠금 해제 알림 설정 ───────────────────────────────────────────────────────
|
|
|
|
public class ReminderSettings
|
|
{
|
|
/// <summary>기능 활성화 여부. 기본값 false.</summary>
|
|
[JsonPropertyName("enabled")]
|
|
public bool Enabled { get; set; } = false;
|
|
|
|
/// <summary>팝업 표시 위치. top-left | top-right | bottom-left | bottom-right</summary>
|
|
[JsonPropertyName("corner")]
|
|
public string Corner { get; set; } = "bottom-right";
|
|
|
|
/// <summary>알림 간격(분). 30 | 60 | 120 | 180 | 240</summary>
|
|
[JsonPropertyName("intervalMinutes")]
|
|
public int IntervalMinutes { get; set; } = 60;
|
|
|
|
/// <summary>팝업 자동 닫힘 시간(초). 기본값 15. (5/10/15/20/30/60/120/180)</summary>
|
|
[JsonPropertyName("displaySeconds")]
|
|
public int DisplaySeconds { get; set; } = 15;
|
|
|
|
/// <summary>알림 콘텐츠 카테고리 활성화 목록.</summary>
|
|
[JsonPropertyName("enabledCategories")]
|
|
public List<string> EnabledCategories { get; set; } = new() { "motivational" };
|
|
}
|