summaryrefslogtreecommitdiffstats
path: root/doc/scripting-api/qdesktopservices.qdoc
blob: 1b639f1e2a843f6a3853e106f7e7265cee9a65e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \qmltype QDesktopServices
    \inqmlmodule scripting

    \brief Provides methods for accessing common desktop services.

    Many desktop environments provide services that can be used by applications
    to perform common tasks, such as opening a file, in a way that is both
    consistent and takes into account the user's application preferences.

    This object contains methods that provide simple interfaces to these
    services that indicate whether they succeeded or failed.

    The openUrl() method is used to open files located at arbitrary URLs in
    external applications. For URLs that correspond to resources on the local
    filing system (where the URL scheme is "file"), a suitable application is
    used to open the file.

    The displayName() and storageLocation() methods take one of the following
    enums as an argument:

    \list
        \li DesktopServices.DesktopLocation
        \li DesktopServices.DocumentsLocation
        \li DesktopServices.FontsLocation
        \li DesktopServices.ApplicationsLocation
        \li DesktopServices.MusicLocation
        \li DesktopServices.MoviesLocation
        \li DesktopServices.PicturesLocation
        \li DesktopServices.TempLocation
        \li DesktopServices.HomeLocation
        \li DesktopServices.DataLocation
        \li DesktopServices.CacheLocation
        \li DesktopServices.GenericDataLocation
        \li DesktopServices.RuntimeLocation
        \li DesktopServices.ConfigLocation
        \li DesktopServices.DownloadLocation
        \li DesktopServices.GenericCacheLocation
        \li DesktopServices.GenericConfigLocation
    \endlist

    The enum values correspond to the values of the
    \l{QStandardPaths::StandardLocation} enum with the same names.
*/

/*!
    \qmlproperty enumeration QDesktopServices::QStandardPaths
    \internal
*/

/*!
    \qmlmethod boolean QDesktopServices::openUrl(string url)

    Uses the URL scheme \c file to open the specified \a url with a suitable
    application.

    \warning A return value of \c true indicates that the installer has successfully
    requested the operating system to open the URL in an external application. It may
    still fail to launch or fail to open the requested URL. This result will not be
    reported back to the installer.
*/

/*!
    \qmlmethod string QDesktopServices::displayName(int location)

    Returns a localized display name for the specified \a location or an empty
    QString if no relevant location can be found.
*/

/*!
    \qmlmethod string QDesktopServices::storageLocation(int location)

    Returns the specified \a location.
*/

/*!
    \qmlmethod array QDesktopServices::findFiles(string path, string pattern)

    Returns file names matching \a pattern. Searches the files recursively from \a path.
    \a Pattern understands * and ? wildcards.
*/