00001 // 00002 // ResultFilters.h 00003 // 00004 // Copyright (c) Shareaza Development Team, 2002-2005. 00005 // This file is part of SHAREAZA (www.shareaza.com) 00006 // 00007 // Shareaza is free software; you can redistribute it 00008 // and/or modify it under the terms of the GNU General Public License 00009 // as published by the Free Software Foundation; either version 2 of 00010 // the License, or (at your option) any later version. 00011 // 00012 // Shareaza is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with Shareaza; if not, write to the Free Software 00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 // 00021 // 00022 // Author : [email protected] 00023 // 00024 #pragma once 00025 00026 //create a class with some of the CMatchObjects members 00027 00028 class CFilterOptions 00029 { 00030 public: 00031 CFilterOptions(); 00032 void Serialize(CArchive& ar); 00033 public: 00034 CString m_sName; // the options set name 00035 CString m_sFilter; 00036 BOOL m_bFilterBusy; 00037 BOOL m_bFilterPush; 00038 BOOL m_bFilterUnstable; 00039 BOOL m_bFilterLocal; 00040 BOOL m_bFilterReject; 00041 BOOL m_bFilterBogus; 00042 BOOL m_bFilterDRM; 00043 BOOL m_bFilterAdult; 00044 DWORD m_nFilterSources; 00045 QWORD m_nFilterMinSize; 00046 QWORD m_nFilterMaxSize; 00047 }; 00048 00049 #define NONE -1 00050 00051 class CResultFilters 00052 { 00053 public: 00054 CResultFilters(void); 00055 ~CResultFilters(void); 00056 void Serialize(CArchive& ar); 00057 void Add(CFilterOptions *pOptions); 00058 void Remove(DWORD index); 00059 void Load(); 00060 void Save(); 00061 int Search(const CString& strName); 00062 public: 00063 DWORD m_nFilters; // count of filter options 00064 CFilterOptions ** m_pFilters; // the array of filter options 00065 DWORD m_nDefault; // the index of the default filter options 00066 };