File: shellutils.h

package info (click to toggle)
okular 4%3A25.04.2-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 36,108 kB
  • sloc: cpp: 81,483; ansic: 7,822; xml: 3,446; javascript: 435; java: 59; sh: 33; makefile: 11
file content (47 lines) | stat: -rw-r--r-- 1,467 bytes parent folder | download | duplicates (2)
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
/*
    SPDX-FileCopyrightText: 2009 Pino Toscano <pino@kde.org>

    SPDX-License-Identifier: GPL-2.0-or-later
*/

#ifndef OKULAR_SHELLUTILS_H
#define OKULAR_SHELLUTILS_H

#include "config-okular.h"

#include <QString>

#if HAVE_DBUS
#include <QLatin1StringView>
#endif

class QUrl;

class QCommandLineParser;

namespace ShellUtils
{
typedef bool (*FileExistFunc)(const QString &fileName);

FileExistFunc qfileExistFunc();
QUrl urlFromArg(const QString &_arg, FileExistFunc exist_func, const QString &pageArg = QString());
QString serializeOptions(const QCommandLineParser &args);
QString serializeOptions(bool startInPresentation, bool showPrintDialog, bool showPrintDialogAndExit, bool unique, bool noRaise, const QString &page, const QString &find, const QString &editorCmd);
bool unique(const QString &serializedOptions);
bool noRaise(const QString &serializedOptions);
bool startInPresentation(const QString &serializedOptions);
bool showPrintDialog(const QString &serializedOptions);
bool showPrintDialogAndExit(const QString &serializedOptions);
QString page(const QString &serializedOptions);
QString find(const QString &serializedOptions);
QString editorCmd(const QString &serializedOptions);

#if HAVE_DBUS
// Must be a subname of "org.kde.okular" due to Flatpak not supporting wildcard D-Bus permissions.
inline constexpr QLatin1StringView kPerProcessDbusPrefix("org.kde.okular.Instance_");

QString currentProcessDbusName();
#endif // HAVE_DBUS
}

#endif