Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/krun.h
Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Line(s) | 65 | public: | |||
---|---|---|---|---|---|
175 | * Sets whether a prompt should be shown before executing scripts or desktop files. | 175 | * Sets whether a prompt should be shown before executing scripts or desktop files. | ||
176 | * If enabled, KRun uses the "kiorc" configuration file to decide whether to open the | 176 | * If enabled, KRun uses the "kiorc" configuration file to decide whether to open the | ||
177 | * file, execute it or show a prompt. | 177 | * file, execute it or show a prompt. | ||
178 | * @since 5.4 | 178 | * @since 5.4 | ||
179 | */ | 179 | */ | ||
180 | void setShowScriptExecutionPrompt(bool showPrompt); | 180 | void setShowScriptExecutionPrompt(bool showPrompt); | ||
181 | 181 | | |||
182 | /** | 182 | /** | ||
183 | * Sets cursor position for text files. | ||||
184 | * If service supports it, this information gets passed to it. | ||||
185 | * @since 5.54 | ||||
186 | */ | ||||
187 | void setCursorInformation(unsigned row, unsigned column); | ||||
188 | | ||||
189 | /** | ||||
183 | * Suggested file name given by the server (e.g. HTTP content-disposition) | 190 | * Suggested file name given by the server (e.g. HTTP content-disposition) | ||
184 | */ | 191 | */ | ||
185 | QString suggestedFileName() const; | 192 | QString suggestedFileName() const; | ||
186 | 193 | | |||
187 | /** | 194 | /** | ||
188 | * Associated window, as passed to the constructor | 195 | * Associated window, as passed to the constructor | ||
189 | * @since 4.9.3 | 196 | * @since 4.9.3 | ||
190 | */ | 197 | */ | ||
Show All 34 Lines | |||||
225 | * when the application exits. | 232 | * when the application exits. | ||
226 | * @param suggestedFileName see setSuggestedFileName | 233 | * @param suggestedFileName see setSuggestedFileName | ||
227 | * @param asn Application startup notification id, if any (otherwise ""). | 234 | * @param asn Application startup notification id, if any (otherwise ""). | ||
228 | * @return 0 on error, the process ID on success | 235 | * @return 0 on error, the process ID on success | ||
229 | * @since 5.6 | 236 | * @since 5.6 | ||
230 | */ | 237 | */ | ||
231 | static qint64 runService(const KService &service, const QList<QUrl> &urls, QWidget *window, | 238 | static qint64 runService(const KService &service, const QList<QUrl> &urls, QWidget *window, | ||
232 | bool tempFiles = false, const QString &suggestedFileName = QString(), | 239 | bool tempFiles = false, const QString &suggestedFileName = QString(), | ||
233 | const QByteArray &asn = QByteArray()); // TODO KF6: deprecate/remove | 240 | const QByteArray &asn = QByteArray(), unsigned cursorRow = 0, | ||
241 | unsigned cursorColumn = 0); // TODO KF6: deprecate/remove | ||||
234 | 242 | | |||
235 | enum RunFlag { | 243 | enum RunFlag { | ||
236 | DeleteTemporaryFiles = 0x1, ///< the URLs passed to the service will be deleted when it exits (if the URLs are local files) | 244 | DeleteTemporaryFiles = 0x1, ///< the URLs passed to the service will be deleted when it exits (if the URLs are local files) | ||
237 | RunExecutables = 0x2, ///< Whether to run URLs that are executable scripts or binaries @see isExecutableFile() @since 5.31 | 245 | RunExecutables = 0x2, ///< Whether to run URLs that are executable scripts or binaries @see isExecutableFile() @since 5.31 | ||
238 | }; | 246 | }; | ||
239 | Q_DECLARE_FLAGS(RunFlags, RunFlag) | 247 | Q_DECLARE_FLAGS(RunFlags, RunFlag) | ||
240 | 248 | | |||
241 | /** | 249 | /** | ||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 313 | #endif | |||
315 | * @param window The top-level widget of the app that invoked this object. | 323 | * @param window The top-level widget of the app that invoked this object. | ||
316 | * @param flags Various run flags. | 324 | * @param flags Various run flags. | ||
317 | * @param suggestedFileName See setSuggestedFileName() | 325 | * @param suggestedFileName See setSuggestedFileName() | ||
318 | * @param asn Application startup notification id, if any (otherwise ""). | 326 | * @param asn Application startup notification id, if any (otherwise ""). | ||
319 | * @return @c true on success, @c false on error | 327 | * @return @c true on success, @c false on error | ||
320 | * @since 5.31 | 328 | * @since 5.31 | ||
321 | */ | 329 | */ | ||
322 | static bool runUrl(const QUrl &url, const QString &mimetype, QWidget *window, RunFlags flags, | 330 | static bool runUrl(const QUrl &url, const QString &mimetype, QWidget *window, RunFlags flags, | ||
323 | const QString &suggestedFileName = QString(), const QByteArray &asn = QByteArray()); | 331 | const QString &suggestedFileName = QString(), const QByteArray &asn = QByteArray(), | ||
332 | unsigned cursorRow = 0, unsigned cursorColumn = 0); | ||||
324 | 333 | | |||
325 | /** | 334 | /** | ||
326 | * Run the given shell command and notifies KDE of the starting | 335 | * Run the given shell command and notifies KDE of the starting | ||
327 | * of the application. If the program to be called doesn't exist, | 336 | * of the application. If the program to be called doesn't exist, | ||
328 | * an error box will be displayed. | 337 | * an error box will be displayed. | ||
329 | * | 338 | * | ||
330 | * Use only when you know the full command line. Otherwise use the other | 339 | * Use only when you know the full command line. Otherwise use the other | ||
331 | * static methods, or KRun's constructor. | 340 | * static methods, or KRun's constructor. | ||
▲ Show 20 Lines • Show All 320 Lines • Show Last 20 Lines |