00001 /*! 00002 * \file PasswordTreeDelElementVisitor.h 00003 * \brief Defines the visitor used to remove a password infos 00004 * from the password composite 00005 * 00006 * \author Frederic RUAUDEL <grumz@users.sf.net> 00007 * 00008 * $Revision: 1.3 $ 00009 * $Date: 2003/02/22 10:54:25 $ 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_TREE_DEL_ELEMENT_VISITOR_H 00030 #define PASSWORD_TREE_DEL_ELEMENT_VISITOR_H 00031 00032 #include <stdio.h> 00033 00034 #include <PasswordInfos.h> 00035 #include <PasswordTreeElement.h> 00036 #include <PasswordRootElement.h> 00037 #include <PasswordGroupElement.h> 00038 #include <PasswordManagerElement.h> 00039 #include <PasswordFinderVisitor.h> 00040 #include <PasswordTreeElementFactory.h> 00041 00042 using namespace std; 00043 00044 /*! 00045 * \brief The visitor used to remove a password infos 00046 * from the password composite 00047 **/ 00048 class PasswordTreeDelElementVisitor : public PasswordFinderVisitor 00049 { 00050 public: 00051 PasswordTreeDelElementVisitor (void); 00052 virtual ~PasswordTreeDelElementVisitor (); 00053 00054 virtual int visitPasswordRootElement (PasswordRootElement* element); 00055 virtual int visitPasswordGroupElement (PasswordGroupElement* element); 00056 virtual int visitPasswordManagerElement (PasswordManagerElement* element); 00057 00058 virtual void setPasswordInfos (PasswordInfos password_infos); 00059 00060 bool deletePasswordInfos (void); 00061 00062 private: 00063 PasswordGroupElement* _father_group; 00064 PasswordGroupElement* _old_father_group; 00065 PasswordGroupElement* _group_2_delete; 00066 PasswordGroupElement* _old_group_2_delete; 00067 int _father_group_nb_childs; 00068 bool _is_password_infos_found; 00069 string _last_function_in_error; 00070 }; 00071 00072 #endif /* PASSWORD_TREE_DEL_ELEMENT_VISITOR_H */