1 /* UserPrefValues.hpp 2 * 3 * Copyright (C) 2021 by RStudio, PBC 4 * 5 * Unless you have received this program directly from RStudio pursuant 6 * to the terms of a commercial license agreement with RStudio, then 7 * this program is licensed to you under the terms of version 3 of the 8 * GNU Affero General Public License. This program is distributed WITHOUT 9 * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, 10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the 11 * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details. 12 * 13 */ 14 15 /* DO NOT HAND-EDIT! This file is automatically generated from the formal user preference schema 16 * JSON. To add a preference, add it to "user-prefs-schema.json", then run "generate-prefs.R" to 17 * rebuild this file. 18 */ 19 20 #ifndef SESSION_USER_STATE_VALUES_HPP 21 #define SESSION_USER_STATE_VALUES_HPP 22 23 #include <session/prefs/Preferences.hpp> 24 25 namespace rstudio { 26 namespace session { 27 namespace prefs { 28 29 #define kContextId "context_id" 30 #define kAutoCreatedProfile "auto_created_profile" 31 #define kTheme "theme" 32 #define kThemeName "name" 33 #define kThemeUrl "url" 34 #define kThemeIsDark "isDark" 35 #define kDefaultProjectLocation "default_project_location" 36 #define kClearHidden "clear_hidden" 37 #define kExportPlotOptions "export_plot_options" 38 #define kExportPlotOptionsWidth "width" 39 #define kExportPlotOptionsHeight "height" 40 #define kExportPlotOptionsFormat "format" 41 #define kExportPlotOptionsKeepRatio "keepRatio" 42 #define kExportPlotOptionsViewAfterSave "viewAfterSave" 43 #define kExportPlotOptionsCopyAsMetafile "copyAsMetafile" 44 #define kExportViewerOptions "export_viewer_options" 45 #define kExportViewerOptionsWidth "width" 46 #define kExportViewerOptionsHeight "height" 47 #define kExportViewerOptionsFormat "format" 48 #define kExportViewerOptionsKeepRatio "keepRatio" 49 #define kExportViewerOptionsViewAfterSave "viewAfterSave" 50 #define kExportViewerOptionsCopyAsMetafile "copyAsMetafile" 51 #define kSavePlotAsPdfOptions "save_plot_as_pdf_options" 52 #define kSavePlotAsPdfOptionsWidth "width" 53 #define kSavePlotAsPdfOptionsHeight "height" 54 #define kSavePlotAsPdfOptionsPortrait "portrait" 55 #define kSavePlotAsPdfOptionsCairoPdf "cairo_pdf" 56 #define kSavePlotAsPdfOptionsViewAfterSave "viewAfterSave" 57 #define kCompileRNotebookPrefs "compile_r_notebook_prefs" 58 #define kCompileRNotebookPrefsAuthor "author" 59 #define kCompileRNotebookPrefsType "type" 60 #define kCompileRMarkdownNotebookPrefs "compile_r_markdown_notebook_prefs" 61 #define kCompileRMarkdownNotebookPrefsFormat "format" 62 #define kShowPublishUi "show_publish_ui" 63 #define kEnableRsconnectPublishUi "enable_rsconnect_publish_ui" 64 #define kPublishAccount "publish_account" 65 #define kPublishAccountName "name" 66 #define kPublishAccountServer "server" 67 #define kDocumentOutlineWidth "document_outline_width" 68 #define kConnectVia "connect_via" 69 #define kConnectViaConnectRConsole "connect-r-console" 70 #define kConnectViaConnectNewRScript "connect-new-r-script" 71 #define kConnectViaConnectNewRNotebook "connect-new-r-notebook" 72 #define kConnectViaConnectCopyToClipboard "connect-copy-to-clipboard" 73 #define kErrorHandlerType "error_handler_type" 74 #define kErrorHandlerTypeMessage "message" 75 #define kErrorHandlerTypeTraceback "traceback" 76 #define kErrorHandlerTypeBreak "break" 77 #define kErrorHandlerTypeNotebook "notebook" 78 #define kErrorHandlerTypeCustom "custom" 79 #define kUsingMingwGcc49 "using_mingw_gcc49" 80 #define kVisualModeConfirmed "visual_mode_confirmed" 81 #define kBibliographyDefaultType "bibliography_default_type" 82 #define kBibliographyDefaultTypeBib "bib" 83 #define kBibliographyDefaultTypeYaml "yaml" 84 #define kBibliographyDefaultTypeJson "json" 85 #define kCitationDefaultInText "citation_default_in_text" 86 #define kZoteroConnectionType "zotero_connection_type" 87 #define kZoteroConnectionTypeAuto "auto" 88 #define kZoteroConnectionTypeNone "none" 89 #define kZoteroConnectionTypeLocal "local" 90 #define kZoteroConnectionTypeWeb "web" 91 #define kZoteroUseBetterBibtex "zotero_use_better_bibtex" 92 #define kZoteroApiKey "zotero_api_key" 93 #define kZoteroDataDir "zotero_data_dir" 94 95 class UserStateValues: public Preferences 96 { 97 public: 98 static std::vector<std::string> allKeys(); 99 /** 100 * A unique identifier representing the user and machine. 101 */ 102 std::string contextId(); 103 core::Error setContextId(std::string val); 104 105 /** 106 * Whether we have automatically created an .Rprofile for this user. 107 */ 108 bool autoCreatedProfile(); 109 core::Error setAutoCreatedProfile(bool val); 110 111 /** 112 * The color theme to apply. 113 */ 114 core::json::Object theme(); 115 core::Error setTheme(core::json::Object val); 116 117 /** 118 * The directory path under which to place new projects by default. Shadows a uipref. 119 */ 120 std::string defaultProjectLocation(); 121 core::Error setDefaultProjectLocation(std::string val); 122 123 /** 124 * Whether to clear hidden objects along with visible objects when clearing the workspace. Set automatically to remember last action. 125 */ 126 bool clearHidden(); 127 core::Error setClearHidden(bool val); 128 129 /** 130 * The most recently used plot export options. 131 */ 132 core::json::Object exportPlotOptions(); 133 core::Error setExportPlotOptions(core::json::Object val); 134 135 /** 136 * The most recently used viewer export options. 137 */ 138 core::json::Object exportViewerOptions(); 139 core::Error setExportViewerOptions(core::json::Object val); 140 141 /** 142 * The most recently used options for saving a plot as a PDF. 143 */ 144 core::json::Object savePlotAsPdfOptions(); 145 core::Error setSavePlotAsPdfOptions(core::json::Object val); 146 147 /** 148 * Most recently used settings for compiling a notebook from an R script. 149 */ 150 core::json::Object compileRNotebookPrefs(); 151 core::Error setCompileRNotebookPrefs(core::json::Object val); 152 153 /** 154 * Most recently used settings for compiling a notebook using R Markdown. 155 */ 156 core::json::Object compileRMarkdownNotebookPrefs(); 157 core::Error setCompileRMarkdownNotebookPrefs(core::json::Object val); 158 159 /** 160 * Whether to show UI for publishing content. 161 */ 162 bool showPublishUi(); 163 core::Error setShowPublishUi(bool val); 164 165 /** 166 * Whether to show UI for publishing content to RStudio Connect. 167 */ 168 bool enableRsconnectPublishUi(); 169 core::Error setEnableRsconnectPublishUi(bool val); 170 171 /** 172 * The default (last) account used for publishing 173 */ 174 core::json::Object publishAccount(); 175 core::Error setPublishAccount(core::json::Object val); 176 177 /** 178 * The preferred width, in pixels, of the document outline pane. 179 */ 180 int documentOutlineWidth(); 181 core::Error setDocumentOutlineWidth(int val); 182 183 /** 184 * How to create new connections to data sources. 185 */ 186 std::string connectVia(); 187 core::Error setConnectVia(std::string val); 188 189 /** 190 * The kind of handler to invoke when errors occur. 191 */ 192 std::string errorHandlerType(); 193 core::Error setErrorHandlerType(std::string val); 194 195 /** 196 * Whether or not the MinGW compiler with GCC 4.9 is used. 197 */ 198 bool usingMingwGcc49(); 199 core::Error setUsingMingwGcc49(bool val); 200 201 /** 202 * Whether or not the use of Visual Mode has been confirmed. 203 */ 204 bool visualModeConfirmed(); 205 core::Error setVisualModeConfirmed(bool val); 206 207 /** 208 * The default type for new bibliographies. 209 */ 210 std::string bibliographyDefaultType(); 211 core::Error setBibliographyDefaultType(std::string val); 212 213 /** 214 * The default style for inserting citations. 215 */ 216 bool citationDefaultInText(); 217 core::Error setCitationDefaultInText(bool val); 218 219 /** 220 * Zotero connection type (local or web) 221 */ 222 std::string zoteroConnectionType(); 223 core::Error setZoteroConnectionType(std::string val); 224 225 /** 226 * Whether to use Better BibTeX when suggesting citation keys and writing citations to BibTeX bibliographies 227 */ 228 bool zoteroUseBetterBibtex(); 229 core::Error setZoteroUseBetterBibtex(bool val); 230 231 /** 232 * Key for making Zotero API calls 233 */ 234 std::string zoteroApiKey(); 235 core::Error setZoteroApiKey(std::string val); 236 237 /** 238 * Directory containing Zotero data files 239 */ 240 std::string zoteroDataDir(); 241 core::Error setZoteroDataDir(std::string val); 242 243 }; 244 245 246 } 247 } 248 } 249 250 #endif 251