Line data Source code
1 : // SPDX-FileCopyrightText: 2016 Anne Jan Brouwer
2 : // SPDX-License-Identifier: GPL-3.0-or-later
3 : /**
4 : * @file
5 : * @brief The Enums namespace: clipboard behaviour and the identifiers of the
6 : * subprocess kinds QtPass queues.
7 : */
8 : #ifndef SRC_ENUMS_H_
9 : #define SRC_ENUMS_H_
10 :
11 : #include <QMetaType>
12 :
13 : /**
14 : * @namespace Enums
15 : * @ingroup process
16 : * @brief Enumerators for QtPass configuration and runtime operations.
17 : */
18 : namespace Enums {
19 :
20 : /**
21 : * @enum ClipBoardType
22 : * @brief Defines when to copy passwords to clipboard.
23 : */
24 : enum ClipBoardType {
25 : CLIPBOARD_NEVER = 0, /**< Never automatically copy to clipboard */
26 : CLIPBOARD_ALWAYS = 1, /**< Always copy to clipboard after showing */
27 : CLIPBOARD_ON_DEMAND = 2 /**< Copy only when user explicitly requests */
28 : };
29 :
30 : /**
31 : * @enum PROCESS
32 : * @brief Identifies different subprocess operations used in QtPass.
33 : *
34 : * Adding a value: give it a row in the table in processinfo.cpp, which says
35 : * what the command is called and whether its stdout may contain a secret (a
36 : * decrypted entry, a search hit in one). Secret-bearing output reaches
37 : * neither the process output panel nor the generic finished signal. The
38 : * build fails until the row is there, and
39 : * tst_realpass::genericOutputSignalIsAnAllowList() and
40 : * tst_processoutputpanel::everyShownProcessHasItsCommandLabel() pin the
41 : * decision.
42 : */
43 : enum PROCESS {
44 : GIT_INIT = 0, /**< Initialize Git repository */
45 : GIT_ADD, /**< Git add command */
46 : GIT_COMMIT, /**< Git commit */
47 : GIT_RM, /**< Git remove */
48 : GIT_PULL, /**< Git pull */
49 : GIT_PUSH, /**< Git push */
50 : PASS_SHOW, /**< Pass show - decrypt password file */
51 : PASS_INSERT, /**< Pass insert - create/update password */
52 : PASS_REMOVE, /**< Pass remove - delete password */
53 : PASS_INIT, /**< Pass init - initialize store */
54 : GPG_GENKEYS, /**< GPG key generation */
55 : PASS_MOVE, /**< Move password file */
56 : PASS_COPY, /**< Copy password file */
57 : GIT_MOVE, /**< Git move/rename */
58 : GIT_COPY, /**< Git copy */
59 : PASS_GREP, /**< Not started any more (content search runs in-process,
60 : NativeGrep); kept for the process-name table and the
61 : checks that keep its output out of the panel */
62 : PROCESS_COUNT, /**< Total number of process types */
63 : INVALID /**< Invalid/unknown process */
64 : };
65 :
66 : } // namespace Enums
67 :
68 3 : Q_DECLARE_METATYPE(Enums::PROCESS)
69 :
70 : #endif // SRC_ENUMS_H_
|