Changeset View
Changeset View
Standalone View
Standalone View
src/kdeinit/ktoolinvocation.h
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 76 | private: | |||
---|---|---|---|---|---|
77 | KToolInvocation(); | 77 | KToolInvocation(); | ||
78 | public: | 78 | public: | ||
79 | // @internal | 79 | // @internal | ||
80 | ~KToolInvocation(); | 80 | ~KToolInvocation(); | ||
81 | static KToolInvocation *self(); | 81 | static KToolInvocation *self(); | ||
82 | 82 | | |||
83 | public Q_SLOTS: | 83 | public Q_SLOTS: | ||
84 | 84 | | |||
85 | #if KSERVICE_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
85 | /** | 86 | /** | ||
86 | * Convenience method; invokes the standard email application. | 87 | * Convenience method; invokes the standard email application. | ||
87 | * | 88 | * | ||
88 | * @param address The destination address | 89 | * @param address The destination address | ||
89 | * @param subject Subject string. Can be QString(). | 90 | * @param subject Subject string. Can be QString(). | ||
90 | * @param startup_id for app startup notification, "0" for none, | 91 | * @param startup_id for app startup notification, "0" for none, | ||
91 | * "" ( empty string ) is the default | 92 | * "" ( empty string ) is the default | ||
92 | * | 93 | * | ||
93 | * @deprecated since 5.0, use QDesktopServices::openUrl(mailtoURL), | 94 | * @deprecated since 5.0, use QDesktopServices::openUrl(mailtoURL), | ||
94 | * using QUrl::setPath(address) and a query item of "subject" for the subject. | 95 | * using QUrl::setPath(address) and a query item of "subject" for the subject. | ||
95 | */ | 96 | */ | ||
96 | KSERVICE_DEPRECATED static void invokeMailer(const QString &address, const QString &subject, | 97 | KSERVICE_DEPRECATED_VERSION(5, 0, "Use QDesktopServices::openUrl(mailtoURL), using QUrl::setPath(address) and a query item of \"subject\" for the subject") | ||
98 | static void invokeMailer(const QString &address, const QString &subject, | ||||
97 | const QByteArray &startup_id = QByteArray()); | 99 | const QByteArray &startup_id = QByteArray()); | ||
98 | 100 | | |||
99 | /** | 101 | /** | ||
100 | * Invokes the standard email application. | 102 | * Invokes the standard email application. | ||
101 | * | 103 | * | ||
102 | * @param mailtoURL A mailto URL. | 104 | * @param mailtoURL A mailto URL. | ||
103 | * @param startup_id for app startup notification, "0" for none, | 105 | * @param startup_id for app startup notification, "0" for none, | ||
104 | * "" ( empty string ) is the default | 106 | * "" ( empty string ) is the default | ||
105 | * @param allowAttachments whether attachments specified in mailtoURL should be honoured. | 107 | * @param allowAttachments whether attachments specified in mailtoURL should be honoured. | ||
106 | * The default is false; do not honor requests for attachments. | 108 | * The default is false; do not honor requests for attachments. | ||
107 | * @deprecated since 5.0, use QDesktopServices::openUrl(mailtoURL) | 109 | * @deprecated since 5.0, use QDesktopServices::openUrl(mailtoURL) | ||
108 | */ | 110 | */ | ||
109 | KSERVICE_DEPRECATED static void invokeMailer(const QUrl &mailtoURL, const QByteArray &startup_id = QByteArray(), | 111 | KSERVICE_DEPRECATED_VERSION(5, 0, "Use QDesktopServices::openUrl(const QUrl&)") | ||
112 | static void invokeMailer(const QUrl &mailtoURL, const QByteArray &startup_id = QByteArray(), | ||||
110 | bool allowAttachments = false); | 113 | bool allowAttachments = false); | ||
114 | #endif | ||||
111 | 115 | | |||
112 | /** | 116 | /** | ||
113 | * Convenience method; invokes the standard email application. | 117 | * Convenience method; invokes the standard email application. | ||
114 | * | 118 | * | ||
115 | * All parameters are optional. | 119 | * All parameters are optional. | ||
116 | * | 120 | * | ||
117 | * @param to The destination address. | 121 | * @param to The destination address. | ||
118 | * @param cc The Cc field | 122 | * @param cc The Cc field | ||
119 | * @param bcc The Bcc field | 123 | * @param bcc The Bcc field | ||
120 | * @param subject Subject string | 124 | * @param subject Subject string | ||
121 | * @param body A string containing the body of the mail (exclusive with messageFile) | 125 | * @param body A string containing the body of the mail (exclusive with messageFile) | ||
122 | * @param messageFile A file (URL) containing the body of the mail (exclusive with body) - currently unsupported | 126 | * @param messageFile A file (URL) containing the body of the mail (exclusive with body) - currently unsupported | ||
123 | * @param attachURLs List of URLs to be attached to the mail. | 127 | * @param attachURLs List of URLs to be attached to the mail. | ||
124 | * @param startup_id for app startup notification, "0" for none, | 128 | * @param startup_id for app startup notification, "0" for none, | ||
125 | * "" ( empty string ) is the default | 129 | * "" ( empty string ) is the default | ||
126 | */ | 130 | */ | ||
127 | static void invokeMailer(const QString &to, const QString &cc, const QString &bcc, | 131 | static void invokeMailer(const QString &to, const QString &cc, const QString &bcc, | ||
128 | const QString &subject, const QString &body, | 132 | const QString &subject, const QString &body, | ||
129 | const QString &messageFile = QString(), | 133 | const QString &messageFile = QString(), | ||
130 | const QStringList &attachURLs = QStringList(), | 134 | const QStringList &attachURLs = QStringList(), | ||
131 | const QByteArray &startup_id = QByteArray()); | 135 | const QByteArray &startup_id = QByteArray()); | ||
132 | 136 | | |||
137 | #if KSERVICE_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
133 | /** | 138 | /** | ||
134 | * Invokes the user's preferred browser. | 139 | * Invokes the user's preferred browser. | ||
135 | * Note that you should only do this when you know for sure that the browser can | 140 | * Note that you should only do this when you know for sure that the browser can | ||
136 | * handle the URL (i.e. its mimetype). In doubt, if the URL can point to an image | 141 | * handle the URL (i.e. its mimetype). In doubt, if the URL can point to an image | ||
137 | * or anything else than HTML, prefer to use new KRun( url ). | 142 | * or anything else than HTML, prefer to use new KRun( url ). | ||
138 | * | 143 | * | ||
139 | * See also <a | 144 | * See also <a | ||
140 | * href="http://techbase.kde.org/Development/Architecture/KDE4/Starting_Other_Programs#KToolInvocation::invokeBrowser>techbase</a> | 145 | * href="http://techbase.kde.org/Development/Architecture/KDE4/Starting_Other_Programs#KToolInvocation::invokeBrowser>techbase</a> | ||
141 | * for a discussion of invokeBrowser vs KRun. | 146 | * for a discussion of invokeBrowser vs KRun. | ||
142 | * | 147 | * | ||
143 | * @param url The destination address | 148 | * @param url The destination address | ||
144 | * @param startup_id for app startup notification, "0" for none, | 149 | * @param startup_id for app startup notification, "0" for none, | ||
145 | * "" ( empty string ) is the default | 150 | * "" ( empty string ) is the default | ||
146 | * @deprecated since 5.0, use QDesktopServices::openUrl(url) | 151 | * @deprecated since 5.0, use QDesktopServices::openUrl(url) | ||
147 | */ | 152 | */ | ||
148 | KSERVICE_DEPRECATED static void invokeBrowser(const QString &url, | 153 | KSERVICE_DEPRECATED_VERSION(5, 0, "Use QDesktopServices::openUrl(const QUrl&)") | ||
dfaure: No #if for this one? | |||||
I cannot remember this was left out on purpose, so far assume I was just confused by the existing if/endif spanning multiple methods, and missing out this one was not covered. kossebau: I cannot remember this was left out on purpose, so far assume I was just confused by the… | |||||
154 | static void invokeBrowser(const QString &url, | ||||
149 | const QByteArray &startup_id = QByteArray()); | 155 | const QByteArray &startup_id = QByteArray()); | ||
156 | #endif | ||||
150 | 157 | | |||
151 | /** | 158 | /** | ||
152 | * Invokes the standard terminal application. | 159 | * Invokes the standard terminal application. | ||
153 | * | 160 | * | ||
154 | * @param command the command to execute, can be empty. | 161 | * @param command the command to execute, can be empty. | ||
155 | * @param workdir the initial working directory, can be empty. | 162 | * @param workdir the initial working directory, can be empty. | ||
156 | * @param startup_id for app startup notification, "0" for none, | 163 | * @param startup_id for app startup notification, "0" for none, | ||
157 | * "" ( empty string ) is the default | 164 | * "" ( empty string ) is the default | ||
158 | * | 165 | * | ||
159 | * @since 4.1 | 166 | * @since 4.1 | ||
160 | */ | 167 | */ | ||
161 | static void invokeTerminal(const QString &command, | 168 | static void invokeTerminal(const QString &command, | ||
162 | const QString &workdir = QString(), | 169 | const QString &workdir = QString(), | ||
163 | const QByteArray &startup_id = ""); | 170 | const QByteArray &startup_id = ""); | ||
164 | 171 | | |||
165 | public: | 172 | public: | ||
166 | 173 | | |||
174 | #if KSERVICE_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
167 | /** | 175 | /** | ||
168 | * Starts a service based on the (translated) name of the service. | 176 | * Starts a service based on the (translated) name of the service. | ||
169 | * E.g. "Web Browser" | 177 | * E.g. "Web Browser" | ||
170 | * | 178 | * | ||
171 | * @param _name the name of the service | 179 | * @param _name the name of the service | ||
172 | * @param URL if not empty this URL is passed to the service | 180 | * @param URL if not empty this URL is passed to the service | ||
173 | * @param error On failure, error contains a description of the error | 181 | * @param error On failure, error contains a description of the error | ||
174 | * that occurred. If the pointer is 0, the argument will be | 182 | * that occurred. If the pointer is 0, the argument will be | ||
175 | * ignored | 183 | * ignored | ||
176 | * @param serviceName On success, serviceName contains the D-Bus name | 184 | * @param serviceName On success, serviceName contains the D-Bus name | ||
177 | * under which this service is available. If empty, the service does | 185 | * under which this service is available. If empty, the service does | ||
178 | * not provide D-Bus services. If the pointer is 0 the argument | 186 | * not provide D-Bus services. If the pointer is 0 the argument | ||
179 | * will be ignored | 187 | * will be ignored | ||
180 | * @param pid On success, the process id of the new service will be written | 188 | * @param pid On success, the process id of the new service will be written | ||
181 | * here. If the pointer is 0, the argument will be ignored. | 189 | * here. If the pointer is 0, the argument will be ignored. | ||
182 | * @param startup_id for app startup notification, "0" for none, | 190 | * @param startup_id for app startup notification, "0" for none, | ||
183 | * "" ( empty string ) is the default | 191 | * "" ( empty string ) is the default | ||
184 | * @param noWait if set, the function does not wait till the service is running. | 192 | * @param noWait if set, the function does not wait till the service is running. | ||
185 | * @return an error code indicating success (== 0) or failure (> 0). | 193 | * @return an error code indicating success (== 0) or failure (> 0). | ||
186 | * @deprecated Use startServiceByDesktopName or startServiceByDesktopPath | 194 | * @deprecated Use startServiceByDesktopName or startServiceByDesktopPath | ||
187 | */ | 195 | */ | ||
188 | #ifndef KSERVICE_NO_DEPRECATED | 196 | KSERVICE_DEPRECATED_VERSION(5, 0, "Use KToolInvocation::startServiceByDesktopName(...) or KToolInvocation::startServiceByDesktopPath(...)") | ||
189 | KSERVICE_DEPRECATED static int startServiceByName(const QString &_name, const QString &URL, | 197 | static int startServiceByName(const QString &_name, const QString &URL, | ||
190 | QString *error = nullptr, QString *serviceName = nullptr, int *pid = nullptr, | 198 | QString *error = nullptr, QString *serviceName = nullptr, int *pid = nullptr, | ||
191 | const QByteArray &startup_id = QByteArray(), bool noWait = false); | 199 | const QByteArray &startup_id = QByteArray(), bool noWait = false); | ||
192 | #endif | | |||
193 | 200 | | |||
194 | /** | 201 | /** | ||
195 | * Starts a service based on the (translated) name of the service. | 202 | * Starts a service based on the (translated) name of the service. | ||
196 | * E.g. "Web Browser" | 203 | * E.g. "Web Browser" | ||
197 | * | 204 | * | ||
198 | * @param _name the name of the service | 205 | * @param _name the name of the service | ||
199 | * @param URLs if not empty these URLs will be passed to the service | 206 | * @param URLs if not empty these URLs will be passed to the service | ||
200 | * @param error On failure, @p error contains a description of the error | 207 | * @param error On failure, @p error contains a description of the error | ||
201 | * that occurred. If the pointer is 0, the argument will be | 208 | * that occurred. If the pointer is 0, the argument will be | ||
202 | * ignored | 209 | * ignored | ||
203 | * @param serviceName On success, @p serviceName contains the D-Bus name | 210 | * @param serviceName On success, @p serviceName contains the D-Bus name | ||
204 | * under which this service is available. If empty, the service does | 211 | * under which this service is available. If empty, the service does | ||
205 | * not provide D-Bus services. If the pointer is 0 the argument | 212 | * not provide D-Bus services. If the pointer is 0 the argument | ||
206 | * will be ignored | 213 | * will be ignored | ||
207 | * @param pid On success, the process id of the new service will be written | 214 | * @param pid On success, the process id of the new service will be written | ||
208 | * here. If the pointer is 0, the argument will be ignored. | 215 | * here. If the pointer is 0, the argument will be ignored. | ||
209 | * @param startup_id for app startup notification, "0" for none, | 216 | * @param startup_id for app startup notification, "0" for none, | ||
210 | * "" ( empty string ) is the default | 217 | * "" ( empty string ) is the default | ||
211 | * @param noWait if set, the function does not wait till the service is running. | 218 | * @param noWait if set, the function does not wait till the service is running. | ||
212 | * @return an error code indicating success (== 0) or failure (> 0). | 219 | * @return an error code indicating success (== 0) or failure (> 0). | ||
213 | * @deprecated Use startServiceByDesktopName or startServiceByDesktopPath | 220 | * @deprecated Use startServiceByDesktopName or startServiceByDesktopPath | ||
214 | */ | 221 | */ | ||
215 | #ifndef KSERVICE_NO_DEPRECATED | 222 | KSERVICE_DEPRECATED_VERSION(5, 0, "Use KToolInvocation::startServiceByDesktopName(...) or KToolInvocation::startServiceByDesktopPath(...)") | ||
216 | KSERVICE_DEPRECATED static int startServiceByName(const QString &_name, const QStringList &URLs = QStringList(), | 223 | static int startServiceByName(const QString &_name, const QStringList &URLs = QStringList(), | ||
217 | QString *error = nullptr, QString *serviceName = nullptr, int *pid = nullptr, | 224 | QString *error = nullptr, QString *serviceName = nullptr, int *pid = nullptr, | ||
218 | const QByteArray &startup_id = QByteArray(), bool noWait = false); | 225 | const QByteArray &startup_id = QByteArray(), bool noWait = false); | ||
219 | #endif | 226 | #endif | ||
220 | 227 | | |||
221 | /** | 228 | /** | ||
222 | * Starts a service based on the desktop path of the service. | 229 | * Starts a service based on the desktop path of the service. | ||
223 | * E.g. "Applications/konqueror.desktop" or "/home/user/bla/myfile.desktop" | 230 | * E.g. "Applications/konqueror.desktop" or "/home/user/bla/myfile.desktop" | ||
224 | * | 231 | * | ||
▲ Show 20 Lines • Show All 170 Lines • Show Last 20 Lines |
No #if for this one?