{
  "name": "App",
  "component": "gui",
  "header": "nativeui/app.h",
  "type": "class",
  "singleton": true,
  "namespace": "nu",
  "description": "Application class.",
  "detail": "This class represents current app and provides app wide APIs.\n\nThis class can not be created by user, you must create `State` first and\nthen receive an instance of `App` via `App::GetCurrent`.\n\n```cpp\nnu::State state;\nnu::App* app = nu::App::GetCurrent();\n```\n",
  "class_methods": [
    {
      "signature": {
        "returnType": {
          "name": "App*",
          "id": "app"
        },
        "name": "GetCurrent",
        "parameters": [],
        "shortStr": "GetCurrent()",
        "str": "App* GetCurrent()"
      },
      "description": "Return current app.",
      "id": "getcurrent"
    }
  ],
  "methods": [
    {
      "signature": {
        "name": "SetName",
        "parameters": [
          {
            "type": {
              "name": "std::string"
            },
            "name": "name"
          }
        ],
        "shortStr": "SetName(name)",
        "str": "void SetName(std::string name)"
      },
      "description": "Set the name of current app.",
      "detail": "The app name should be something like \"My App\", it will be used in vairous\nplaces, such as folder name when storing user data, or key name when\nwriting registry.\n\nYou should always call this API at the beginning of your app.\n\nOn macOS it is strong recommended to use the same name with the\n`CFBundleName` field of app bundle's `Info.plist` file.\n",
      "id": "setname-name"
    },
    {
      "signature": {
        "returnType": {
          "name": "std::string"
        },
        "name": "GetName",
        "parameters": [],
        "shortStr": "GetName()",
        "str": "std::string GetName() const"
      },
      "description": "Return current app's name.",
      "detail": "If `<!method>App::SetName(name)` has never been called, this API will try to guess a\nname from existing information, for example the executable's version info,\nor the app bundle information, or the executable file's base name.\n",
      "id": "getname"
    },
    {
      "signature": {
        "name": "SetID",
        "parameters": [
          {
            "type": {
              "name": "std::string"
            },
            "name": "id"
          }
        ],
        "shortStr": "SetID(id)",
        "str": "void SetID(std::string id)"
      },
      "platform": [
        "Windows",
        "Linux"
      ],
      "description": "Set the application ID.",
      "detail": "The application ID must be globally unique, and it is recommended to use\nsomething like \"org.myself.myapp\".\n\nOn macOS the application ID is the app bundle ID, and there is no way to\nchange it at runtime.\n\nOn Linux the application ID will be used in various places, such as the\nname of the [`.desktop` file](https://developer.gnome.org/integration-guide/stable/desktop-files.html),\nor the base name of GSettings schemas.\n\nOn Windows the application ID is [`AppUserModelID`](https://docs.microsoft.com/en-us/windows/win32/shell/appids),\nit is mainly used to recognize which app a process belongs to. For\nUWP/Desktop Bridge apps, Windows will assign an AppUserModelID to the app\nand this API should not be used.\n",
      "id": "setid-id"
    },
    {
      "signature": {
        "returnType": {
          "name": "std::string"
        },
        "name": "GetID",
        "parameters": [],
        "shortStr": "GetID()",
        "str": "std::string GetID() const"
      },
      "description": "Return the application ID.",
      "detail": "On macOS if the app is bundled, the app bundle ID will be returned,\notherwise empty string will be returned.\n\nOn Linux the ID set by `<!name>SetID` will be returned.\n\nOn Windows the [`AppUserModelID`](https://docs.microsoft.com/en-us/windows/win32/shell/appids)\nwill be returned. If neither you or Windows ever assigned an ID to the\napp, empty string will be returned.\n",
      "id": "getid"
    },
    {
      "signature": {
        "name": "SetApplicationMenu",
        "parameters": [
          {
            "type": {
              "name": "scoped_refptr<MenuBar>",
              "id": "menubar"
            },
            "name": "menu"
          }
        ],
        "shortStr": "SetApplicationMenu(menu)",
        "str": "void SetApplicationMenu(scoped_refptr<MenuBar> menu)"
      },
      "platform": [
        "macOS"
      ],
      "description": "Set the application menu bar.",
      "id": "setapplicationmenu-menu"
    },
    {
      "signature": {
        "returnType": {
          "name": "MenuBar*",
          "id": "menubar"
        },
        "name": "GetApplicationMenu",
        "parameters": [],
        "shortStr": "GetApplicationMenu()",
        "str": "MenuBar* GetApplicationMenu() const"
      },
      "platform": [
        "macOS"
      ],
      "description": "Return the application menu bar.",
      "id": "getapplicationmenu"
    },
    {
      "signature": {
        "name": "SetDockBadgeLabel",
        "parameters": [
          {
            "type": {
              "name": "const std::string&"
            },
            "name": "label"
          }
        ],
        "shortStr": "SetDockBadgeLabel(label)",
        "str": "void SetDockBadgeLabel(const std::string& label)"
      },
      "platform": [
        "macOS"
      ],
      "description": "Set the `label` to be displayed in dock’s badging area.",
      "id": "setdockbadgelabel-label"
    },
    {
      "signature": {
        "returnType": {
          "name": "std::string"
        },
        "name": "GetDockBadgeLabel",
        "parameters": [],
        "shortStr": "GetDockBadgeLabel()",
        "str": "std::string GetDockBadgeLabel() const"
      },
      "platform": [
        "macOS"
      ],
      "description": "Get the label displayed in dock’s badging area.",
      "id": "getdockbadgelabel"
    },
    {
      "signature": {
        "returnType": {
          "name": "bool"
        },
        "name": "IsRunningAsUWP",
        "parameters": [],
        "shortStr": "IsRunningAsUWP()",
        "str": "bool IsRunningAsUWP() const"
      },
      "platform": [
        "Windows"
      ],
      "description": "Return whether app is running as UWP/Desktop Bridge.",
      "detail": "On Windows the Win32 apps can run as UWP apps by using\n[Desktop Bridge](https://techcommunity.microsoft.com/t5/windows-dev-appconsult/desktop-bridge-8211-the-bridge-between-desktop-apps-and-the/ba-p/316488),\nwhich is required for submitting Win32 apps to Microsoft Store.\n\nThere are a few runtime differences when running apps as UWP, and this\nAPI can be used to detect the environment.\n",
      "id": "isrunningasuwp"
    },
    {
      "signature": {
        "returnType": {
          "name": "bool"
        },
        "name": "CreateStartMenuShortcut",
        "parameters": [
          {
            "type": {
              "name": "const App::ShortcutOptions&",
              "id": "app_shortcutoptions"
            },
            "name": "options"
          }
        ],
        "shortStr": "CreateStartMenuShortcut(options)",
        "str": "bool CreateStartMenuShortcut(const App::ShortcutOptions& options)"
      },
      "platform": [
        "Windows"
      ],
      "description": "Create a start menu shortcut for current user linking to current process.",
      "detail": "This API will write the `AppUserModelID` and `ToastActivatorCLSID` to the\nshortcut file, and the shortcut file's name will be the app's name, so it\nis recommended to call `<!method>App::SetID(id)` and\n`<!method>App::SetName(name)` before using this API.\n\nNote that on Windows you should generally not write start menu shortcut\nautomatically, by convention the file is commonly created by installers\nor users themselves. This API is usually used for testing purpose.\n",
      "id": "createstartmenushortcut-options"
    },
    {
      "signature": {
        "returnType": {
          "name": "base::FilePath"
        },
        "name": "GetStartMenuShortcutPath",
        "parameters": [],
        "shortStr": "GetStartMenuShortcutPath()",
        "str": "base::FilePath GetStartMenuShortcutPath() const"
      },
      "platform": [
        "Windows"
      ],
      "description": "Return file path to the shortcut created by the `<!method>App::CreateStartMenuShortcut(options)` API.",
      "id": "getstartmenushortcutpath"
    },
    {
      "signature": {
        "name": "Activate",
        "parameters": [
          {
            "type": {
              "name": "bool"
            },
            "name": "force"
          }
        ],
        "shortStr": "Activate(force)",
        "str": "void Activate(bool force)"
      },
      "platform": [
        "macOS"
      ],
      "description": "Make current app the active app.",
      "detail": "The `force` parameter is normally set to false. When the Finder launches\nan app, using a value of false for `force` allows the app to become active\nif the user waits for it to launch, but the app remains unobtrusive if the\nuser activates another app. Regardless of the setting of flag, there may\nbe a time lag before the app activates—you should not assume the app will\nbe active immediately after sending this message.\n",
      "id": "activate-force"
    },
    {
      "signature": {
        "name": "Deactivate",
        "parameters": [],
        "shortStr": "Deactivate()",
        "str": "void Deactivate()"
      },
      "platform": [
        "macOS"
      ],
      "description": "Deactivate current app.",
      "id": "deactivate"
    },
    {
      "signature": {
        "returnType": {
          "name": "bool"
        },
        "name": "IsActive",
        "parameters": [],
        "shortStr": "IsActive()",
        "str": "bool IsActive() const"
      },
      "platform": [
        "macOS"
      ],
      "description": "Return whether current app is the active app.",
      "id": "isactive"
    },
    {
      "signature": {
        "name": "SetActivationPolicy",
        "parameters": [
          {
            "type": {
              "name": "App::ActivationPolicy",
              "id": "app_activationpolicy"
            },
            "name": "policy"
          }
        ],
        "shortStr": "SetActivationPolicy(policy)",
        "str": "void SetActivationPolicy(App::ActivationPolicy policy)"
      },
      "platform": [
        "macOS"
      ],
      "description": "Modify the app's activation policy.",
      "id": "setactivationpolicy-policy"
    },
    {
      "signature": {
        "returnType": {
          "name": "App::ActivationPolicy",
          "id": "app_activationpolicy"
        },
        "name": "GetActivationPolicy",
        "parameters": [],
        "shortStr": "GetActivationPolicy()",
        "str": "App::ActivationPolicy GetActivationPolicy() const"
      },
      "platform": [
        "macOS"
      ],
      "description": "Return app's activation policy.",
      "id": "getactivationpolicy"
    }
  ],
  "id": "app"
}