1 /*
2  * SessionAskSecret.hpp
3  *
4  * Copyright (C) 2021 by RStudio, PBC
5  *
6  * Unless you have received this program directly from RStudio pursuant
7  * to the terms of a commercial license agreement with RStudio, then
8  * this program is licensed to you under the terms of version 3 of the
9  * GNU Affero General Public License. This program is distributed WITHOUT
10  * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
11  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
12  * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
13  *
14  */
15 
16 #ifndef SESSION_SESSION_ASK_SECRET_HPP
17 #define SESSION_SESSION_ASK_SECRET_HPP
18 
19 #include <string>
20 
21 namespace rstudio {
22 namespace core {
23    class Error;
24 }
25 }
26 
27 namespace rstudio {
28 namespace session {
29 namespace modules {
30 namespace ask_secret {
31 
32 
33 std::string activeWindow();
34 void setActiveWindow(const std::string& windowName);
35 
36 struct SecretInput
37 {
SecretInputrstudio::session::modules::ask_secret::SecretInput38    SecretInput() : cancelled(false), remember(false), changed(true) {}
39    bool cancelled;
40    std::string secret;
41    bool remember;
42    bool changed;
43 };
44 
45 core::Error askForSecret(const std::string& name,
46                          const std::string& title,
47                          const std::string& prompt,
48                          bool canRemember,
49                          bool hasSecret,
50                          SecretInput* pInput);
51 
52 core::Error initialize();
53 
54 } // namespace ask_secret
55 } // namepace handlers
56 } // namespace session
57 } // namespace rstudio
58 
59 #endif // SESSION_SESSION_ASK_SECRET_HPP
60