KMoreTools

kmoretoolspresets.h
1/*
2 SPDX-FileCopyrightText: 2015 Gregor Mi <codestruct@posteo.org>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef KMORETOOLSPRESETS_H
8#define KMORETOOLSPRESETS_H
9
10#include <QString>
11#include <QUrl>
12
13#include <kmoretools_export.h>
14
15class KMoreTools;
17
18/**
19 * Provides static methods to make use of desktop files provided by
20 * KMoreTools.
21 *
22 * registerServiceByDesktopEntryName creates a KMoreToolsService instance
23 * from a given desktopEntryName.
24 *
25 * registerServicesByGroupingNames takes a list of a set of predefined
26 * grouping names and returns a list KMoreToolsService instances. Remember,
27 * a KMoreToolsService represents a service which might or might not be
28 * installed on the current machine.
29 *
30 * The groupings defined here are used for the KMoreToolsMenuFactory.
31 *
32 * (todo later: Probably it would make sense to move the methods of
33 * this class to KMoreToolsMenuFactory because grouping names and special
34 * handling are too much coupled anyway.)
35 */
36class KMORETOOLS_EXPORT KMoreToolsPresets
37{
38public:
39 /**
40 * @returns an _ordered_ list of KMoreToolsService instances.
41 * The most popular or recommended tools will be listed first.
42 *
43 * Available grouping names (listed in alphabetical order):
44 *
45 * - "disk-usage"
46 * Disk usage tools as currently used in dolphin.
47 * Some take 1 URL argument pointing to a directory.
48 *
49 * - "disk-partitions"
50 * Disk partition tools as currently used in dolphin.
51 *
52 * - "files-find"
53 * Tools to find files on disk.
54 * You can specify 1 URL argument that points to the directory
55 * where the search should be started.
56 *
57 * - "font-tools" (since 5.37.0)
58 * Tools to manage and analyze fonts.
59 *
60 * - "git-clients-for-folder"
61 * Collection of git clients which all take 1 URL argument pointing
62 * to a directory within a git repository. It may not be the
63 * git repo's root dir.
64 * e.g. "file:///home/user1/dev/kf5/src/frameworks/knewstuff/data/"
65 *
66 * - "git-clients-and-actions"
67 * Git clients and actions (e.g. View History for a specific file)
68 * to be used in a file tree context menu (e.g. in kate's project
69 * plugin).
70 * 1 URL argument can be provided that points to a directory or a
71 * file within a git repository.
72 * e.g. "file:///home/user1/dev/knewstuff/data/"
73 * e.g. "file:///home/user1/dev/knewstuff/data/CMakeLists.txt"
74 *
75 * - "icon-browser"
76 * Browse for icons on your system
77 * (e.g. those under /usr/share/icons).
78 *
79 * - "language-dictionary" (since 5.37.0)
80 * Language dictionaries for translation
81 *
82 * - "mouse-tools" (since 5.37.0)
83 * Tools related to the mouse pointer device.
84 *
85 * - "screenrecorder" (since 5.37.0)
86 * Record screen contents to a video file (including animated gif).
87 *
88 * - "screenshot-take"
89 * Tools for taking and maybe also editing screenshots.
90 *
91 * - "system-monitor-processes"
92 * Tools to monitor the running processes on the system.
93
94 * - "system-monitor-logs"
95 * Tools to view system logs.
96 *
97 * - "time-countdown"
98 * Tools for counting down the time and maybe trigger custom a action.
99 *
100 * For URL arguments see also QUrl::fromLocalFile.
101 *
102 * Services which are present in more than one grouping are only added once
103 * to the resulting list.
104 */
105 static QList<KMoreToolsService *> registerServicesByGroupingNames(KMoreTools *kmt, const QStringList &groupingNames);
106
107 /**
108 * Registers a service who's kmt-desktopfile is provided by the
109 * KMoreTools library itself (see directory kmoretools-desktopfiles).
110 * If the kmt-desktopfile is missing the service is still created
111 * but with no translations and icon if the service is not installed.
112 *
113 * Associates a homepage URL because a regular .desktop file has got
114 * no field for this information.
115 *
116 * Adds some corrections to faulty upstream .desktop files. Corrected
117 * desktop filenames end with .kmt-edition.desktop.
118 *
119 * todo: how to avoid the "Do you trust this program?" question when a
120 * non-installed kmt-edition desktopfile is used but the program is installed?
121 * Possible solution: install all .kmt-edition files to proper desktop
122 * file location.
123 *
124 * @returns the added KMoreToolsService
125 */
126 static KMoreToolsService *registerServiceByDesktopEntryName(KMoreTools *kmt, const QString &desktopEntryName);
127
128 // todo later: add another method registerServiceByDesktopEntryNames (plural) that handles
129 // a list of desktopEntryNames.
130};
131
132#endif
Provides static methods to make use of desktop files provided by KMoreTools.
A service described in a .desktop file (kmt-desktopfile) which will be called "registered service".
Definition kmoretools.h:357
Helps to create user-configurable menus with tools which are potentially not yet installed.
Definition kmoretools.h:163
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:48:55 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.