context_listener.hpp

Go to the documentation of this file.
00001 /*
00002  * ====================================================================
00003  * Copyright (c) 2002-2006 The RapidSvn Group.  All rights reserved.
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2.1 of the License, or (at your option) any later version.
00009  * 
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library (in the file LGPL.txt); if not, 
00017  * write to the Free Software Foundation, Inc., 51 Franklin St, 
00018  * Fifth Floor, Boston, MA  02110-1301  USA
00019  *
00020  * This software consists of voluntary contributions made by many
00021  * individuals.  For exact contribution history, see the revision
00022  * history and logs, available at http://rapidsvn.tigris.org/.
00023  * ====================================================================
00024  */
00025 
00026 #ifndef _SVNCPP_CONTEXT_LISTENER_HPP_
00027 #define _SVNCPP_CONTEXT_LISTENER_HPP_ 
00028 
00029 // stl
00030 #include <string>
00031 
00032 // Subversion api
00033 #include "svn_client.h"
00034 
00035 // svncpp
00036 #include "svncpp/pool.hpp"
00037 
00038 
00039 namespace svn
00040 {
00047   class ContextListener
00048   {
00049   public:
00064     virtual bool 
00065     contextGetLogin (const std::string & realm,
00066                      std::string & username, 
00067                      std::string & password,
00068                      bool & maySave) = 0;
00069 
00082     virtual void
00083     contextNotify (const char *path,
00084                    svn_wc_notify_action_t action,
00085                    svn_node_kind_t kind,
00086                    const char *mime_type,
00087                    svn_wc_notify_state_t content_state,
00088                    svn_wc_notify_state_t prop_state,
00089                    svn_revnum_t revision) = 0;
00090 
00091     /*
00092      * this method will be called periodically to allow
00093      * the app to cancel long running operations
00094      *
00095      * @return cancel action?
00096      * @retval true cancel
00097      */
00098     virtual bool
00099     contextCancel() = 0;
00100 
00112     virtual bool
00113     contextGetLogMessage (std::string & msg) = 0;
00114 
00115     typedef enum
00116     {
00117       DONT_ACCEPT = 0,
00118       ACCEPT_TEMPORARILY,
00119       ACCEPT_PERMANENTLY
00120     } SslServerTrustAnswer;
00121 
00122 
00127     struct SslServerTrustData
00128     {
00129     public:
00131       const apr_uint32_t failures;
00132 
00134       std::string hostname;
00135       std::string fingerprint;
00136       std::string validFrom;
00137       std::string validUntil;
00138       std::string issuerDName;
00139       std::string realm;
00140       bool maySave;
00141 
00142       SslServerTrustData (const apr_uint32_t failures_ = 0)
00143         : failures (failures_), hostname (""), fingerprint (""),
00144           validFrom (""), validUntil (""), issuerDName (""),
00145           realm (""), maySave (true)
00146       {
00147       }
00148     };
00149 
00150 
00159     virtual SslServerTrustAnswer
00160     contextSslServerTrustPrompt (const SslServerTrustData & data, 
00161                                  apr_uint32_t & acceptedFailures) = 0;
00162 
00167     virtual bool 
00168     contextSslClientCertPrompt (std::string & certFile) = 0;
00169 
00178     virtual bool
00179     contextSslClientCertPwPrompt (std::string & password, 
00180                                   const std::string & realm, 
00181                                   bool & maySave) = 0;
00182 
00183     virtual ~ContextListener () { }
00184   };
00185 }
00186 
00187 #endif
00188 /* -----------------------------------------------------------------
00189  * local variables:
00190  * eval: (load-file "../../rapidsvn-dev.el")
00191  * end:
00192  */

Generated on Sun May 14 15:16:32 2006 for SvnCpp by  doxygen 1.4.6