Warning, file /libraries/kmoretools/src/kmoretoolspresets.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     SPDX-FileCopyrightText: 2015 Gregor Mi <codestruct@posteo.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006 
0007 #ifndef KMORETOOLSPRESETS_H
0008 #define KMORETOOLSPRESETS_H
0009 
0010 #include <QString>
0011 #include <QUrl>
0012 
0013 #include <kmoretools_export.h>
0014 
0015 class KMoreTools;
0016 class KMoreToolsService;
0017 
0018 /**
0019  * Provides static methods to make use of desktop files provided by
0020  * KMoreTools.
0021  *
0022  * registerServiceByDesktopEntryName creates a KMoreToolsService instance
0023  * from a given desktopEntryName.
0024  *
0025  * registerServicesByGroupingNames takes a list of a set of predefined
0026  * grouping names and returns a list KMoreToolsService instances. Remember,
0027  * a KMoreToolsService represents a service which might or might not be
0028  * installed on the current machine.
0029  *
0030  * The groupings defined here are used for the KMoreToolsMenuFactory.
0031  *
0032  * (todo later: Probably it would make sense to move the methods of
0033  * this class to KMoreToolsMenuFactory because grouping names and special
0034  * handling are too much coupled anyway.)
0035  */
0036 class KMORETOOLS_EXPORT KMoreToolsPresets
0037 {
0038 public:
0039     /**
0040      * @returns an _ordered_ list of KMoreToolsService instances.
0041      * The most popular or recommended tools will be listed first.
0042      *
0043      * Available grouping names (listed in alphabetical order):
0044      *
0045      * - "disk-usage"
0046      *      Disk usage tools as currently used in dolphin.
0047      *      Some take 1 URL argument pointing to a directory.
0048      *
0049      * - "disk-partitions"
0050      *      Disk partition tools as currently used in dolphin.
0051      *
0052      * - "files-find"
0053      *      Tools to find files on disk.
0054      *      You can specify 1 URL argument that points to the directory
0055      *      where the search should be started.
0056      *
0057      * - "font-tools" (since 5.37.0)
0058      *      Tools to manage and analyze fonts.
0059      *
0060      * - "git-clients-for-folder"
0061      *      Collection of git clients which all take 1 URL argument pointing
0062      *      to a directory within a git repository. It may not be the
0063      *      git repo's root dir.
0064      *      e.g. "file:///home/user1/dev/kf5/src/frameworks/knewstuff/data/"
0065      *
0066      * - "git-clients-and-actions"
0067      *      Git clients and actions (e.g. View History for a specific file)
0068      *      to be used in a file tree context menu (e.g. in kate's project
0069      *      plugin).
0070      *      1 URL argument can be provided that points to a directory or a
0071      *      file within a git repository.
0072      *      e.g. "file:///home/user1/dev/knewstuff/data/"
0073      *      e.g. "file:///home/user1/dev/knewstuff/data/CMakeLists.txt"
0074      *
0075      * - "icon-browser"
0076      *      Browse for icons on your system
0077      *      (e.g. those under /usr/share/icons).
0078      *
0079      * - "language-dictionary" (since 5.37.0)
0080      *      Language dictionaries for translation
0081      *
0082      * - "mouse-tools" (since 5.37.0)
0083      *      Tools related to the mouse pointer device.
0084      *
0085      * - "screenrecorder" (since 5.37.0)
0086      *      Record screen contents to a video file (including animated gif).
0087      *
0088      * - "screenshot-take"
0089      *      Tools for taking and maybe also editing screenshots.
0090      *
0091      * - "system-monitor-processes"
0092      *      Tools to monitor the running processes on the system.
0093 
0094      * - "system-monitor-logs"
0095      *      Tools to view system logs.
0096      *
0097      * - "time-countdown"
0098      *      Tools for counting down the time and maybe trigger custom a action.
0099      *
0100      * For URL arguments see also QUrl::fromLocalFile.
0101      *
0102      * Services which are present in more than one grouping are only added once
0103      * to the resulting list.
0104      */
0105     static QList<KMoreToolsService *> registerServicesByGroupingNames(KMoreTools *kmt, const QStringList &groupingNames);
0106 
0107     /**
0108      * Registers a service who's kmt-desktopfile is provided by the
0109      * KMoreTools library itself (see directory kmoretools-desktopfiles).
0110      * If the kmt-desktopfile is missing the service is still created
0111      * but with no translations and icon if the service is not installed.
0112      *
0113      * Associates a homepage URL because a regular .desktop file has got
0114      * no field for this information.
0115      *
0116      * Adds some corrections to faulty upstream .desktop files. Corrected
0117      * desktop filenames end with .kmt-edition.desktop.
0118      *
0119      * todo: how to avoid the "Do you trust this program?" question when a
0120      * non-installed kmt-edition desktopfile is used but the program is installed?
0121      * Possible solution: install all .kmt-edition files to proper desktop
0122      * file location.
0123      *
0124      * @returns the added KMoreToolsService
0125      */
0126     static KMoreToolsService *registerServiceByDesktopEntryName(KMoreTools *kmt, const QString &desktopEntryName);
0127 
0128     // todo later: add another method registerServiceByDesktopEntryNames (plural) that handles
0129     // a list of desktopEntryNames.
0130 };
0131 
0132 #endif