00001 /*! 00002 * \file PasswordSaverVisitor.h 00003 * \brief Defines the visitor that will push every PasswordInfos entry 00004 * of the tree into the codec object for saving 00005 * 00006 * \author Frederic RUAUDEL <grumz@users.sf.net> 00007 * 00008 * $Revision: 1.2 $ 00009 * $Date: 2003/02/20 14:41:42 $ 00010 * 00011 * \b PassGuardFramework 00012 * Copyleft (c) 2002 Frederic RUAUDEL, all rights reversed 00013 * 00014 * This program is free software which I release under the GNU General Public 00015 * License. You may redistribute and/or modify this program under the terms 00016 * of that license as published by the Free Software Foundation; either 00017 * version 2 of the License, or (at your option) any later version. 00018 * 00019 * This program is distributed in the hope that it will be useful, 00020 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 * GNU General Public License for more details. Version 2 is in the 00023 * COPYING file in the top level directory of this distribution. 00024 * 00025 * To get a copy of the GNU General Public License, write to the Free Software 00026 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00027 **/ 00028 00029 #ifndef PASSWORD_SAVER_VISITOR_H 00030 #define PASSWORD_SAVER_VISITOR_H 00031 00032 #include <PasswordRootElement.h> 00033 #include <PasswordGroupElement.h> 00034 #include <PasswordManagerElement.h> 00035 #include <PasswordInfos.h> 00036 #include <PasswordCodecPrototype.h> 00037 00038 using namespace std; 00039 00040 /*! 00041 * \brief Visitor of the password composite used to run throught all 00042 * the tree and push every PasswordInfos structure into the given 00043 * codec object 00044 **/ 00045 class PasswordSaverVisitor : public PasswordTreeElementAbstractVisitor 00046 { 00047 public: 00048 PasswordSaverVisitor (); 00049 virtual ~PasswordSaverVisitor (); 00050 00051 virtual int visitPasswordRootElement (PasswordRootElement* element); 00052 virtual int visitPasswordGroupElement (PasswordGroupElement* element); 00053 virtual int visitPasswordManagerElement (PasswordManagerElement* element); 00054 00055 void setCodecToUse (PasswordCodecPrototype* codec); 00056 bool isVisitSuccessfull (void); 00057 00058 protected: 00059 bool _is_successfull; 00060 string _last_function_in_error; 00061 PasswordCodecPrototype* _codec; 00062 PasswordInfos* _current_password_infos; 00063 }; 00064 00065 #endif /* PASSWORD_SAVER_VISITOR_H */