API — ICoreSDK/ICoreStudio/StudioObjects/Panels/ICorePreferences
The public contract of 3 header(s) under src/ICoreSDK/ICoreStudio/StudioObjects/Panels/ICorePreferences — 5 class/struct definition(s), 98 declaration(s). Each section shows the header's banner and its public (and protected-virtual) surface exactly as the file writes it.
| Header | Defines | Declarations | Bases |
|---|---|---|---|
ICoreProjectPreferences.h | ICoreProjectPreferencesNotifier, ICoreProjectPreferences | 8 | — |
ICoreUserPreferences.h | ICoreUserPreferencesNotifier, ICoreUserPreferences | 87 | — |
ICoreUserPreferencesPanel.h | ICoreUserPreferencesPanel | 3 | public ICoreMenuChooserPanel |
ICoreProjectPreferences.h#
src/ICoreSDK/ICoreStudio/StudioObjects/Panels/ICorePreferences/ICoreProjectPreferences.h
ICoreProjectPreferencesNotifier#
ICoreProjectPreferences.h:43 · class · final · 1 declaration(s)
ICoreProjectPreferences Preferences that belong to the PROJECT rather than to the user or to the model.
class ICoreProjectPreferencesNotifier final {
public:
// ICoreProjectPreferences is a static facade with no instance of its own, so
// it asks the notifier to raise the signal rather than emitting it across
// the object boundary.
void notifyChanged();
ICoreSignal<> onProjectPreferencesChanged;
};
};
ICoreProjectPreferences#
ICoreProjectPreferences.h:55 · class · 7 declaration(s)
class ICoreProjectPreferences {
public:
// The change-signal source -- see the header comment.
static ICoreProjectPreferencesNotifier& notifier();
// ================== Subsystem Navigator
// Which order the Subsystem Navigator's "Sort by" combo box is showing, as
// one of the four SORT_BY_* strings below. An unrecognised value is ignored
// and logged, so a hand-edited or newer-version sidecar cannot wedge the
// navigator into a mode it has no ordering for.
static void setSubsystemNavigatorSortMode(const std::string& newMode);
static std::string getSubsystemNavigatorSortMode();
static std::vector<std::string> getAvailableSubsystemNavigatorSortModes();
// Which of the navigator's two view types is showing: the plain single-
// column list (false, the default) or the details table, which adds the
// Last Modified and Date Created columns beside the name.
//
// OFF by default deliberately -- the tree is read by name nine times out of
// ten, and two date columns in a 450px panel cost the name column half its
// width for information most sessions never look at. The user turns it on
// when they want it, and the project remembers.
static void setSubsystemNavigatorDetailColumnsVisible(bool visible);
static bool areSubsystemNavigatorDetailColumnsVisible();
// ================== Helpers
// Every preference above back to its shipped default, and one notification.
// This is what a project with no sidecar loads.
static void resetToDefaults();
// ================== Constants
// The four orders, in the order the combo box offers them. These strings are
// what lands in the sidecar, so they are a FILE FORMAT: renaming one silently
// demotes every project that stored it back to the default.
static const std::string SORT_BY_NAME;
static const std::string SORT_BY_KIND;
static const std::string SORT_BY_LAST_MODIFIED;
static const std::string SORT_BY_DATE_CREATED;
};
};
ICoreUserPreferences.h#
src/ICoreSDK/ICoreStudio/StudioObjects/Panels/ICorePreferences/ICoreUserPreferences.h
ICoreUserPreferencesNotifier#
ICoreUserPreferences.h:38 · class · final · 1 declaration(s)
ICoreUserPreferences Single source of truth for user-facing application preferences (appearance, rendering budget, canvas, editor behaviour, project handling, terminal, toolchain, logging).
class ICoreUserPreferencesNotifier final {
public:
// ICoreUserPreferences is a static facade with no instance of its own, so
// it asks the notifier to raise the signals rather than emitting them
// across the object boundary.
void notifyChanged(bool renderingGroup);
// Any preference at all changed.
ICoreSignal<> onPreferencesChanged;
// Only the Rendering & Performance group. Separate because the widgets that
// care about the rendering budget are not the ones that care about, say,
// the undo depth, and the rendering group is the one that changes in bulk
// when an interactive-UI preset is applied.
ICoreSignal<> onRenderingPreferencesChanged;
};
};
ICoreUserPreferences#
ICoreUserPreferences.h:57 · class · 86 declaration(s)
class ICoreUserPreferences {
public:
static long initializePreferences();
// The change-signal source — see the header comment.
static ICoreUserPreferencesNotifier& notifier();
// ================== Appearance
// "Light", "Dark" or "System". Storing "System" is what makes the app
// follow the desktop's colour scheme; getEffectiveTheme() is what the
// styling module actually derives from.
static void setTheme(const std::string& newTheme);
static std::string getTheme();
static std::vector<std::string> getAvailableThemes();
// The stored theme with "System" resolved against the desktop's current
// colour scheme. Always "Light" or "Dark".
static std::string getEffectiveTheme();
// Empty => the platform's default UI font. Applied by re-deriving the
// visual identity, so it lands on every widget that follows themeChanged.
static void setUIFontFamily(const std::string& newFamily);
static std::string getUIFontFamily();
// "Compact" / "Comfortable" / "Spacious" — scales the type scale and the
// spacing/padding primitives of the visual identity. Widgets that pin a
// fixed height take it on the next window rather than resizing in place.
static void setUIDensity(const std::string& newDensity);
static std::string getUIDensity();
static std::vector<std::string> getAvailableUIDensities();
// Presets over the Rendering & Performance group below. Setting a mode
// other than "Custom" overwrites every rendering preference with that
// preset's values; changing any single rendering preference afterwards
// moves the mode to "Custom".
static void setInteractiveUIMode(const std::string& newMode);
static std::string getInteractiveUIMode();
static std::vector<std::string> getAvailableInteractiveUIModes();
// ================== Rendering & Performance
// Note: whether the left/top fixed panels float above the canvas is NOT a
// preference. They always float — the docked-strip layout is gone.
// Drop shadows under floating panels, menus and combo popups.
static void setFloatingPanelShadowsEnabled(const bool& enabled);
static bool areFloatingPanelShadowsEnabled();
// Drop shadows under canvas items (blocks, areas, images). Off by default:
// this is a per-item drop-shadow effect, which is the single most
// expensive thing that can be switched on for a large diagram.
static void setCanvasShadowsEnabled(const bool& enabled);
static bool areCanvasShadowsEnabled();
// Eased transitions for canvas items (tab open/close, selection frames,
// block rotation, auto-inserter). Off => the property jumps to its end
// value immediately.
static void setCanvasAnimationsEnabled(const bool& enabled);
static bool areCanvasAnimationsEnabled();
// The same, for the software widgets (buttons, fields, toggles, spin
// boxes, radio buttons).
static void setWidgetAnimationsEnabled(const bool& enabled);
static bool areWidgetAnimationsEnabled();
// "Slow" / "Standard" / "Fast". Scales every duration that goes through
// ICoreAnimationPolicy; means nothing while both animation toggles are off.
static void setAnimationSpeed(const std::string& newSpeed);
static std::string getAnimationSpeed();
static std::vector<std::string> getAvailableAnimationSpeeds();
// The multiplier `newSpeed` stands for, as a percentage of the authored
// duration (Slow = 150, Standard = 100, Fast = 60).
static int getAnimationDurationPercent();
// Link routing quality: one switch for the two passes that only make sense
// together — the obstacle-avoiding path planner and the tidy-up optimizer
// over its output (corner minimisation and loop removal). Off => links take
// the direct L-shaped path between ports and route straight through blocks.
// The two getters always agree; both exist because callers consume the
// passes individually.
static void setLinkRoutingEnabled(const bool& enabled);
static bool isLinkPathPlannerEnabled();
static bool isLinkPathOptimizerEnabled();
// ================== Canvas
// How far one wheel notch zooms, as a percentage (115 => x1.15 in, /1.15
// out). Read on every wheel event, so it takes effect immediately.
static void setZoomStepPercent(const int& newPercent);
static int getZoomStepPercent();
// Zoom limits, as percentages of 1:1. Read on every zoom, so lowering the
// maximum below the current zoom pulls the next zoom back into range.
static void setMinZoomPercent(const int& newPercent);
static int getMinZoomPercent();
static void setMaxZoomPercent(const int& newPercent);
static int getMaxZoomPercent();
// How far past the used canvas area the view may be panned, in scene units.
static void setPanningLimitMargin(const int& newMargin);
static int getPanningLimitMargin();
// The guide lines that appear while a block is dragged or resized.
static void setAlignmentGuidesEnabled(const bool& enabled);
static bool areAlignmentGuidesEnabled();
// How close (scene units) a dragged block has to come to a neighbour's edge
// before the guide catches it. Read by a live guide, so it applies mid-drag.
static void setAlignmentGuideThreshold(const int& newThreshold);
static int getAlignmentGuideThreshold();
// ================== State Machine
static void setAutosaveEnabled(const bool& newAutosaveEnabled);
static bool isAutosaveEnabled();
// Milliseconds to wait after a logged action before the project is written.
// 0 (the default) writes synchronously on every action, which is the
// behaviour autosave has always had. Anything higher coalesces a burst of
// edits into one write, at the cost of that much unsaved work if the app is
// killed. Clamped to [AUTOSAVE_DEBOUNCE_MS_MIN, AUTOSAVE_DEBOUNCE_MS_MAX].
static void setAutosaveDebounceMs(const int& newDebounceMs);
static int getAutosaveDebounceMs();
// How many past/future recipe snapshots the undo/redo history keeps. Each
// snapshot is a full recipe capture of Home, so this trades memory for
// reach. Clamped to [UNDO_HISTORY_DEPTH_MIN, UNDO_HISTORY_DEPTH_MAX].
static void setUndoHistoryDepth(const int& newDepth);
static int getUndoHistoryDepth();
// ================== Editor
// Point size the code editors open at. Clamped to
// [CODE_EDITOR_FONT_SIZE_MIN, CODE_EDITOR_FONT_SIZE_MAX].
static void setCodeEditorFontSize(const int& newSize);
static int getCodeEditorFontSize();
// How many spaces the Tab key inserts in a code editor. Clamped to
// [CODE_EDITOR_TAB_WIDTH_MIN, CODE_EDITOR_TAB_WIDTH_MAX].
static void setCodeEditorTabWidth(const int& newWidth);
static int getCodeEditorTabWidth();
// Wrap long lines instead of scrolling horizontally. Off by default, which
// is what code editors have always done here.
static void setCodeEditorWordWrapEnabled(const bool& enabled);
static bool isCodeEditorWordWrapEnabled();
// ================== Command console
// How many submitted command lines the console's Up-arrow recall keeps
// ACROSS sessions (ICoreCommandHistoryStore). ZERO means stop recording:
// nothing further reaches the file, and the lines already in it stay until
// `clearCommandHistory` -- turning the recorder off is not the same request
// as erasing the tape. Clamped to
// [COMMAND_HISTORY_DEPTH_MIN, COMMAND_HISTORY_DEPTH_MAX].
static void setCommandHistoryDepth(const int& newDepth);
static int getCommandHistoryDepth();
// ================== Notifications
// Seconds a notification bubble stays up before it fades itself out.
// 0 means it never expires and has to be dismissed by hand. Clamped to
// [NOTIFICATION_DISMISS_SECONDS_MIN, NOTIFICATION_DISMISS_SECONDS_MAX].
static void setNotificationDismissSeconds(const int& newSeconds);
static int getNotificationDismissSeconds();
// ================== Project
// How many entries the Project Navigator's Recent Projects list keeps.
// Clamped to [MAX_RECENT_PROJECTS_MIN, MAX_RECENT_PROJECTS_MAX].
static void setMaxRecentProjects(const int& newMax);
static int getMaxRecentProjects();
// Where the New Project form points by default. Empty => the folder the
// last project was made in, falling back to the application home folder.
static void setDefaultProjectsFolder(const std::string& newFolder);
static std::string getDefaultProjectsFolder();
// What the app opens at launch: "Reopen Last Project" (the default) or
// "Show Project Navigator". Either way something has to be opened before the
// editor holds a project -- there is no longer an "Empty Editor" option,
// because it never meant an empty editor: it meant the hardcoded default
// project the app used to load before consulting this setting at all.
//
// Reopen falls back to the launcher's New Project form when there is no
// recent project, or the most recent one is gone or cannot be read.
static void setStartupBehavior(const std::string& newBehavior);
static std::string getStartupBehavior();
static std::vector<std::string> getAvailableStartupBehaviors();
// Whether destructive actions (delete all variables, discard a subsystem,
// drop an unsaved project) stop to ask first. Off is the "don't ask again"
// the prompts themselves offer.
static void setConfirmDestructiveActions(const bool& enabled);
static bool areDestructiveActionsConfirmed();
// ================== Window
// Reopen the main window at the size, position and maximised state it was
// last closed at. Off => it opens at the shipped default geometry.
static void setRestoreWindowGeometryEnabled(const bool& enabled);
static bool isRestoreWindowGeometryEnabled();
// The blob the main window's saveGeometry() produced, base64'd so it
// survives a plain ini file. Not user-facing — the window writes it on close and reads
// it on open. Empty when nothing has been stored yet.
static void setStoredWindowGeometry(const ICoreByteArray& geometry);
static ICoreByteArray getStoredWindowGeometry();
// ================== Terminal
// Shell the terminal panel runs commands through. Empty => $SHELL on Unix
// and %COMSPEC% on Windows, which is what it has always used.
static void setTerminalShellPath(const std::string& newPath);
static std::string getTerminalShellPath();
// ================== Toolchain
// App-wide fallbacks for code-export verification. A target with its own
// custom compiler path still wins; these only replace the auto-scan, which
// otherwise re-hunts the filesystem for every target.
static void setDefaultCppCompilerPath(const std::string& newPath);
static std::string getDefaultCppCompilerPath();
static void setDefaultPythonPath(const std::string& newPath);
static std::string getDefaultPythonPath();
// ================== Logging
// "Errors Only" or "Normal". Errors are never suppressed.
static void setLogVerbosity(const std::string& newVerbosity);
static std::string getLogVerbosity();
static std::vector<std::string> getAvailableLogVerbosities();
// Convenience for the log path itself.
static bool isNonErrorLoggingEnabled();
// Whether the loggers flush to their .log files at all. Off keeps logging
// in memory (and in the log panels) without touching the disk.
static void setFileLoggingEnabled(const bool& enabled);
static bool isFileLoggingEnabled();
// ================== Navigation
// Exposes the part of the subsystem tree above Home (Root and its
// Temp / ClipBoard / Trash children). Off by default: those are internal
// staging areas. ICoreSubsystemTreeNodeRegistry reads this through its own
// accessor, which forwards here.
static void setNavigationRootAccessAllowed(const bool& allowed);
static bool isNavigationRootAccessAllowed();
// ================== Helpers
// Restores every preference above to its shipped default and persists it.
static void resetToDefaults();
// Where the preferences are stored on disk. Public so the Settings panel
// can show the user the file it is writing.
static std::string getPreferencesFilePath();
// ================== Constants
static const std::string THEME_LIGHT;
static const std::string THEME_DARK;
static const std::string THEME_SYSTEM;
static const std::string UI_DENSITY_COMPACT;
static const std::string UI_DENSITY_COMFORTABLE;
static const std::string UI_DENSITY_SPACIOUS;
static const std::string INTERACTIVE_UI_GLASSY;
static const std::string INTERACTIVE_UI_EFFICIENCY;
static const std::string INTERACTIVE_UI_LITE;
static const std::string INTERACTIVE_UI_CUSTOM;
static const std::string ANIMATION_SPEED_SLOW;
static const std::string ANIMATION_SPEED_STANDARD;
static const std::string ANIMATION_SPEED_FAST;
static const std::string STARTUP_REOPEN_LAST_PROJECT;
static const std::string STARTUP_SHOW_PROJECT_NAVIGATOR;
static const std::string LOG_VERBOSITY_ERRORS_ONLY;
static const std::string LOG_VERBOSITY_NORMAL;
static const int ZOOM_STEP_PERCENT_MIN = 101;
static const int ZOOM_STEP_PERCENT_MAX = 300;
static const int ZOOM_STEP_PERCENT_DEFAULT = 115;
static const int MIN_ZOOM_PERCENT_MIN = 1;
static const int MIN_ZOOM_PERCENT_MAX = 100;
static const int MIN_ZOOM_PERCENT_DEFAULT = 20;
static const int MAX_ZOOM_PERCENT_MIN = 100;
static const int MAX_ZOOM_PERCENT_MAX = 2000;
static const int MAX_ZOOM_PERCENT_DEFAULT = 400;
static const int PANNING_LIMIT_MARGIN_MIN = 100;
static const int PANNING_LIMIT_MARGIN_MAX = 20000;
static const int PANNING_LIMIT_MARGIN_DEFAULT = 1500;
static const int ALIGNMENT_GUIDE_THRESHOLD_MIN = 1;
static const int ALIGNMENT_GUIDE_THRESHOLD_MAX = 200;
static const int ALIGNMENT_GUIDE_THRESHOLD_DEFAULT = 40;
static const int AUTOSAVE_DEBOUNCE_MS_MIN = 0;
static const int AUTOSAVE_DEBOUNCE_MS_MAX = 60000;
static const int AUTOSAVE_DEBOUNCE_MS_DEFAULT = 0;
static const int UNDO_HISTORY_DEPTH_MIN = 1;
static const int UNDO_HISTORY_DEPTH_MAX = 500;
static const int UNDO_HISTORY_DEPTH_DEFAULT = 20;
static const int CODE_EDITOR_FONT_SIZE_MIN = 8;
static const int CODE_EDITOR_FONT_SIZE_MAX = 32;
static const int CODE_EDITOR_FONT_SIZE_DEFAULT = 12;
static const int CODE_EDITOR_TAB_WIDTH_MIN = 1;
static const int CODE_EDITOR_TAB_WIDTH_MAX = 16;
static const int CODE_EDITOR_TAB_WIDTH_DEFAULT = 4;
// 0 is a real setting here, not a floor nobody should pick: it is how the
// console's recall is turned off. The ceiling is what append()'s duplicate
// check is willing to re-read on every submitted line.
static const int COMMAND_HISTORY_DEPTH_MIN = 0;
static const int COMMAND_HISTORY_DEPTH_MAX = 5000;
static const int COMMAND_HISTORY_DEPTH_DEFAULT = 500;
static const int NOTIFICATION_DISMISS_SECONDS_MIN = 0;
static const int NOTIFICATION_DISMISS_SECONDS_MAX = 600;
static const int NOTIFICATION_DISMISS_SECONDS_DEFAULT = 30;
static const int MAX_RECENT_PROJECTS_MIN = 1;
static const int MAX_RECENT_PROJECTS_MAX = 50;
static const int MAX_RECENT_PROJECTS_DEFAULT = 12;
};
};
ICoreUserPreferencesPanel.h#
src/ICoreSDK/ICoreStudio/StudioObjects/Panels/ICorePreferences/UI/ICoreUserPreferencesPanel.h
ICoreUserPreferencesPanel#
ICoreUserPreferencesPanel.h:36 · class · final · bases public ICoreMenuChooserPanel · pImpl · 3 declaration(s)
ICoreUserPreferencesPanel The Settings panel.
class ICoreUserPreferencesPanel final : public ICoreMenuChooserPanel {
public:
explicit ICoreUserPreferencesPanel(ICoreWidget* parent = nullptr);
// ==================== Helpers
void reloadAllPropertiesFromUserPreferences();
~ICoreUserPreferencesPanel() override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};