SvnCpp
context_listener.hpp
Go to the documentation of this file.
1 /*
2  * ====================================================================
3  * Copyright (c) 2002-2009 The RapidSvn Group. All rights reserved.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program (in the file GPL.txt.
17  * If not, see <http://www.gnu.org/licenses/>.
18  *
19  * This software consists of voluntary contributions made by many
20  * individuals. For exact contribution history, see the revision
21  * history and logs, available at http://rapidsvn.tigris.org/.
22  * ====================================================================
23  */
24 
25 #ifndef _SVNCPP_CONTEXT_LISTENER_HPP_
26 #define _SVNCPP_CONTEXT_LISTENER_HPP_
27 
28 // stl
30 
31 // Subversion api
32 #include "svn_client.h"
33 
34 // svncpp
35 #include "svncpp/pool.hpp"
36 
37 namespace svn
38 {
46  {
47  public:
62  virtual bool
63  contextGetLogin(const std::string & realm,
64  std::string & username,
65  std::string & password,
66  bool & maySave) = 0;
67 
80  virtual void
81  contextNotify(const char *path,
82  svn_wc_notify_action_t action,
83  svn_node_kind_t kind,
84  const char *mime_type,
85  svn_wc_notify_state_t content_state,
86  svn_wc_notify_state_t prop_state,
87  svn_revnum_t revision) = 0;
88 
89  /*
90  * this method will be called periodically to allow
91  * the app to cancel long running operations
92  *
93  * @return cancel action?
94  * @retval true cancel
95  */
96  virtual bool
97  contextCancel() = 0;
98 
110  virtual bool
111  contextGetLogMessage(std::string & msg) = 0;
112 
113  typedef enum
114  {
119 
120 
126  {
127 public:
129  apr_uint32_t failures;
130 
132  std::string hostname;
133  std::string fingerprint;
134  std::string validFrom;
135  std::string validUntil;
136  std::string issuerDName;
137  std::string realm;
138  bool maySave;
139 
140  SslServerTrustData(const apr_uint32_t failures_ = 0)
141  : failures(failures_), hostname(""), fingerprint(""),
142  validFrom(""), validUntil(""), issuerDName(""),
143  realm(""), maySave(true)
144  {
145  }
146 
148  : failures(src.failures)
149  {
150  hostname = src.hostname;
151  fingerprint = src.fingerprint;
152  validFrom = src.validFrom;
153  validUntil = src.validUntil;
154  issuerDName = src.issuerDName;
155  realm = src.realm;
156  maySave = src.maySave;
157  }
158 
161  {
162  if (this == &src)
163  return *this;
164 
165  hostname = src.hostname;
166  fingerprint = src.fingerprint;
167  validFrom = src.validFrom;
168  validUntil = src.validUntil;
169  issuerDName = src.issuerDName;
170  realm = src.realm;
171  maySave = src.maySave;
172  failures = src.failures;
173 
174  return *this;
175  }
176  };
177 
178 
187  virtual SslServerTrustAnswer
188  contextSslServerTrustPrompt(const SslServerTrustData & data,
189  apr_uint32_t & acceptedFailures) = 0;
190 
195  virtual bool
196  contextSslClientCertPrompt(std::string & certFile) = 0;
197 
206  virtual bool
207  contextSslClientCertPwPrompt(std::string & password,
208  const std::string & realm,
209  bool & maySave) = 0;
210 
211  virtual ~ContextListener() { }
212  };
213 }
214 
215 #endif
216 /* -----------------------------------------------------------------
217  * local variables:
218  * eval: (load-file "../../rapidsvn-dev.el")
219  * end:
220  */
SslServerTrustData & operator=(const SslServerTrustData &src)
Definition: context_listener.hpp:160
SslServerTrustData(const SslServerTrustData &src)
Definition: context_listener.hpp:147
virtual bool contextGetLogMessage(std::string &msg)=0
std::string issuerDName
Definition: context_listener.hpp:136
std::string fingerprint
Definition: context_listener.hpp:133
std::string realm
Definition: context_listener.hpp:137
std::string hostname
Definition: context_listener.hpp:132
virtual bool contextGetLogin(const std::string &realm, std::string &username, std::string &password, bool &maySave)=0
Definition: context_listener.hpp:116
Definition: annotate_line.hpp:31
virtual bool contextSslClientCertPrompt(std::string &certFile)=0
virtual bool contextSslClientCertPwPrompt(std::string &password, const std::string &realm, bool &maySave)=0
Definition: context_listener.hpp:125
apr_uint32_t failures
Definition: context_listener.hpp:129
virtual ~ContextListener()
Definition: context_listener.hpp:211
virtual SslServerTrustAnswer contextSslServerTrustPrompt(const SslServerTrustData &data, apr_uint32_t &acceptedFailures)=0
SslServerTrustAnswer
Definition: context_listener.hpp:113
std::string validFrom
Definition: context_listener.hpp:134
bool maySave
Definition: context_listener.hpp:138
virtual bool contextCancel()=0
Definition: context_listener.hpp:115
std::string validUntil
Definition: context_listener.hpp:135
Definition: context_listener.hpp:45
Definition: context_listener.hpp:117
SslServerTrustData(const apr_uint32_t failures_=0)
Definition: context_listener.hpp:140
virtual void contextNotify(const char *path, svn_wc_notify_action_t action, svn_node_kind_t kind, const char *mime_type, svn_wc_notify_state_t content_state, svn_wc_notify_state_t prop_state, svn_revnum_t revision)=0