00001 /* -*- Mode:c++ -*- */ 00002 /* 00003 * this is part of Spm 00004 * 00005 * Copyright (c) 2008 Guillaume Chevallereau 00006 * 00007 * This program is free software. You can redistribute it and/or modify it 00008 * under the terms of the GNU General Public License as published by the 00009 * Free Software Foundation. Either version 2 of the license or (at your 00010 * option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be usefull but WITHOUT 00013 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00015 * more details. 00016 * 00017 * You should have received a copy of the GNU General Public License along 00018 * with this program; if not, write to the Free Software Foundation, Inc., 00019 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 00020 */ 00021 #ifndef INSTALLATION_H 00022 #define INSTALLATION_H 00023 00024 #include <core/action.h> 00025 #include <plugin/installerInterface.h> 00026 00027 namespace Spm 00028 { 00029 namespace Core 00030 { 00031 class Installation : public Action 00032 { 00033 friend class Process; 00034 friend class PackageManager; 00035 friend class InstallationProcess; 00036 Plugin::InstallerInterface * installer_; 00037 boost::signal<void (Installation *)> haveOptions_; 00038 Installation (Plugin::InstallerInterface * installer); 00039 void doRun (); 00040 void onHaveOptions (Plugin::InstallerInterface * installer) 00041 { 00042 haveOptions_(this); 00043 } 00044 public: 00045 virtual ~Installation () 00046 { 00047 } 00048 boost::signal<void (Plugin::StepInterface *)> & signalChangedStep () 00049 { 00050 return installer_->signalChangedStep (); 00051 } 00052 00053 boost::signal<void (Plugin::InstallerInterface *)> & signalMetaDataParsed () 00054 { 00055 return installer_->signalMetaDataParsed (); 00056 } 00057 00058 boost::signal<void (Installation *)> & signalHaveOptions () 00059 { 00060 return haveOptions_; 00061 } 00062 00063 Plugin::Interface::state_e getState () 00064 { 00065 return installer_->getState(); 00066 } 00067 00068 Plugin::Interface::state_e getState () const 00069 { 00070 return installer_->getState(); 00071 } 00072 00073 const Plugin::StepInterface * getActualStep () 00074 { 00075 return installer_->getActualStep (); 00076 } 00077 00078 const miniXml::ustring & getPackageName () 00079 { 00080 return installer_->getPackageName (); 00081 } 00082 00083 const miniXml::ustring & getPackageVersion () 00084 { 00085 return installer_->getPackageVersion (); 00086 } 00087 00088 const miniXml::ustring & plugin () 00089 { 00090 return installer_->getDescription ().pluginName_; 00091 } 00092 00093 std::map<miniXml::ustring, 00094 boost::tuple<miniXml::ustring, 00095 int, 00096 Util::PropertyList::propertyType_e> > getOptions () 00097 { 00098 return installer_->getOptions (); 00099 } 00100 }; 00101 } 00102 } 00103 00104 #endif