00001 /* 00002 * Copyright (C) 2004-2005 Alo Sarv <madcat_@users.sourceforge.net> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 */ 00018 00019 #include <hn/search.h> 00020 #include <hn/hash.h> 00021 00022 /** 00023 * SearchFile is a customized ED2KFile which adds search-result related 00024 * members. This type should be used when handling search results. 00025 */ 00026 class ED2KSearchResult : public SearchResult { 00027 public: 00028 /** 00029 * Construct using hash, name and type. 00030 * 00031 * @param h ED2KHash of the file 00032 * @param name File name 00033 * @param size File size 00034 * @param id ID of the client sharing this file 00035 * @param port Port of the client sharing this file 00036 */ 00037 ED2KSearchResult( 00038 Hash<ED2KHash> h, const std::string &name, uint32_t size 00039 ); 00040 00041 /** 00042 * Download this SearchFile 00043 */ 00044 virtual void download(); 00045 private: 00046 Hash<ED2KHash> m_hash; 00047 };