File indexing completed on 2024-04-28 05:50:07

0001 /*
0002  * SPDX-License-Identifier: GPL-3.0-or-later
0003  * SPDX-FileCopyrightText: 2021 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
0004  */
0005 #ifndef APP_FLOWS_P_H
0006 #define APP_FLOWS_P_H
0007 
0008 #include <QCommandLineParser>
0009 
0010 #include "keysmith.h"
0011 #include "vms.h"
0012 #include "../model/accounts.h"
0013 #include "../model/password.h"
0014 
0015 namespace app
0016 {
0017     class InitialFlow: public QObject
0018     {
0019         Q_OBJECT
0020     public:
0021         explicit InitialFlow(Keysmith *app);
0022     public:
0023         void run(const QCommandLineParser &parser);
0024     private Q_SLOTS:
0025         void onNewAccountInvalid(void);
0026         void onNewAccountProcessed(void);
0027         void onNewAccountAccepted(void);
0028         void onNewAccountRejected(void);
0029         void resume(void);
0030     private:
0031         bool m_started;
0032         bool m_uriToAdd;
0033         bool m_uriParsed;
0034         bool m_passwordPromptResolved;
0035     private:
0036         Keysmith * const m_app;
0037         model::AccountInput * const m_input;
0038         model::PasswordRequest * const m_passwordRequest;
0039     };
0040 
0041     class ManualAddAccountFlow: public QObject
0042     {
0043         Q_OBJECT
0044     public:
0045         explicit ManualAddAccountFlow(Keysmith *app);
0046         void run(void);
0047     private Q_SLOTS:
0048         void back(void);
0049         void onAccepted(void);
0050     private:
0051         Keysmith * const m_app;
0052         model::AccountInput * const m_input;
0053     };
0054 
0055     class ExternalCommandLineFlow: public QObject
0056     {
0057         Q_OBJECT
0058     public:
0059         explicit ExternalCommandLineFlow(Keysmith *app);
0060     public:
0061         void run(const QCommandLineParser &parser);
0062     private Q_SLOTS:
0063         void onNewAccountInvalid(void);
0064         void onNewAccountProcessed(void);
0065         void back(void);
0066         void onAccepted(void);
0067     private:
0068         Keysmith * const m_app;
0069         model::AccountInput * const m_input;
0070     };
0071 }
0072 
0073 #endif