00001 /***************************************************************** 00002 00003 Copyright (c) 2005 Fred Schaettgen <kde.sch@ttgen.net> 00004 00005 Permission is hereby granted, free of charge, to any person obtaining a copy 00006 of this software and associated documentation files (the "Software"), to deal 00007 in the Software without restriction, including without limitation the rights 00008 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00009 copies of the Software, and to permit persons to whom the Software is 00010 furnished to do so, subject to the following conditions: 00011 00012 The above copyright notice and this permission notice shall be included in 00013 all copies or substantial portions of the Software. 00014 00015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00017 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00018 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 00019 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00020 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00021 00022 ******************************************************************/ 00023 00024 #ifndef __popularity_h__ 00025 #define __popularity_h__ 00026 00027 #include <tqstring.h> 00028 #include <tqstringlist.h> 00029 00030 class PopularityStatisticsImpl; 00031 class Prefs; 00032 00053 class PopularityStatistics 00054 { 00055 public: 00056 PopularityStatistics(); 00057 virtual ~PopularityStatistics(); 00058 00064 void useService(const TQString& service); 00065 00074 void moveToTop(const TQStringList& services); 00075 00079 void moveToBottom(const TQString& service); 00080 00085 TQString serviceByRank(int n) const; 00086 00091 double popularityByRank(int n) const; 00092 00097 int rankByService(const TQString service); 00098 00103 void writeConfig(Prefs* prefs) const; 00104 00109 void readConfig(Prefs* prefs); 00110 00117 void setHistoryHorizon(double h); 00118 double historyHorizon(); 00119 00120 protected: 00121 PopularityStatisticsImpl *d; 00122 00123 private: 00124 PopularityStatistics(const PopularityStatistics&) {} 00125 }; 00126 00127 #endif
1.6.1