2019-05-03 00:29:04 +02:00
|
|
|
/*++
|
|
|
|
Copyright (c) Microsoft Corporation
|
|
|
|
Licensed under the MIT license.
|
|
|
|
|
|
|
|
Module Name:
|
|
|
|
- CascadiaSettings.hpp
|
|
|
|
|
|
|
|
Abstract:
|
|
|
|
- This class encapsulates all of the settings that are global to the app, and
|
|
|
|
not a part of any particular profile.
|
|
|
|
|
|
|
|
Author(s):
|
|
|
|
- Mike Griese - March 2019
|
|
|
|
|
|
|
|
--*/
|
|
|
|
#pragma once
|
|
|
|
#include "AppKeyBindings.h"
|
|
|
|
#include "ColorScheme.h"
|
|
|
|
|
|
|
|
namespace TerminalApp
|
|
|
|
{
|
|
|
|
class GlobalAppSettings;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TerminalApp::GlobalAppSettings final
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GlobalAppSettings();
|
|
|
|
~GlobalAppSettings();
|
|
|
|
|
|
|
|
const std::vector<ColorScheme>& GetColorSchemes() const noexcept;
|
|
|
|
std::vector<ColorScheme>& GetColorSchemes() noexcept;
|
|
|
|
void SetDefaultProfile(const GUID defaultProfile) noexcept;
|
|
|
|
GUID GetDefaultProfile() const noexcept;
|
|
|
|
|
|
|
|
winrt::TerminalApp::AppKeyBindings GetKeybindings() const noexcept;
|
2019-05-21 16:26:04 +02:00
|
|
|
void SetKeybindings(winrt::TerminalApp::AppKeyBindings newBindings) noexcept;
|
2019-05-03 00:29:04 +02:00
|
|
|
|
|
|
|
bool GetAlwaysShowTabs() const noexcept;
|
|
|
|
void SetAlwaysShowTabs(const bool showTabs) noexcept;
|
|
|
|
|
|
|
|
bool GetShowTitleInTitlebar() const noexcept;
|
|
|
|
void SetShowTitleInTitlebar(const bool showTitleInTitlebar) noexcept;
|
|
|
|
|
2019-05-20 22:54:19 +02:00
|
|
|
void SetRequestedTheme(const winrt::Windows::UI::Xaml::ElementTheme requestedTheme) noexcept;
|
|
|
|
|
2019-05-03 00:29:04 +02:00
|
|
|
bool GetShowTabsInTitlebar() const noexcept;
|
|
|
|
void SetShowTabsInTitlebar(const bool showTabsInTitlebar) noexcept;
|
|
|
|
|
2019-07-12 01:06:18 +02:00
|
|
|
std::wstring GetWordDelimiters() const noexcept;
|
|
|
|
void SetWordDelimiters(const std::wstring wordDelimiters) noexcept;
|
|
|
|
|
2019-05-03 00:29:04 +02:00
|
|
|
winrt::Windows::UI::Xaml::ElementTheme GetRequestedTheme() const noexcept;
|
|
|
|
|
2019-06-04 23:55:27 +02:00
|
|
|
Json::Value ToJson() const;
|
|
|
|
static GlobalAppSettings FromJson(const Json::Value& json);
|
2019-05-03 00:29:04 +02:00
|
|
|
|
|
|
|
void ApplyToSettings(winrt::Microsoft::Terminal::Settings::TerminalSettings& settings) const noexcept;
|
|
|
|
|
|
|
|
private:
|
|
|
|
GUID _defaultProfile;
|
|
|
|
winrt::TerminalApp::AppKeyBindings _keybindings;
|
|
|
|
|
|
|
|
std::vector<ColorScheme> _colorSchemes;
|
|
|
|
|
|
|
|
int32_t _initialRows;
|
|
|
|
int32_t _initialCols;
|
|
|
|
|
|
|
|
bool _showStatusline;
|
|
|
|
bool _alwaysShowTabs;
|
|
|
|
bool _showTitleInTitlebar;
|
|
|
|
|
|
|
|
bool _showTabsInTitlebar;
|
2019-07-12 01:06:18 +02:00
|
|
|
std::wstring _wordDelimiters;
|
2019-05-03 00:29:04 +02:00
|
|
|
winrt::Windows::UI::Xaml::ElementTheme _requestedTheme;
|
|
|
|
|
|
|
|
static winrt::Windows::UI::Xaml::ElementTheme _ParseTheme(const std::wstring& themeString) noexcept;
|
2019-05-22 00:39:26 +02:00
|
|
|
static std::wstring_view _SerializeTheme(const winrt::Windows::UI::Xaml::ElementTheme theme) noexcept;
|
2019-05-03 00:29:04 +02:00
|
|
|
};
|