kcookieserver.h
00001 /* 00002 This file is part of the KDE File Manager 00003 00004 Copyright (C) 1998 Waldo Bastian (bastian@kde.org) 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU General Public License 00008 version 2 as published by the Free Software Foundation. 00009 00010 This software is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this library; see the file COPYING. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 //---------------------------------------------------------------------------- 00021 // 00022 // KDE Cookie Server 00023 // $Id$ 00024 00025 #ifndef KCOOKIESERVER_H 00026 #define KCOOKIESERVER_H 00027 00028 #include <tqstringlist.h> 00029 #include <kded/kdedmodule.h> 00030 00031 class KHttpCookieList; 00032 class KCookieJar; 00033 class KHttpCookie; 00034 class TQTimer; 00035 class RequestList; 00036 class DCOPClient; 00037 class KConfig; 00038 00039 class KCookieServer : public KDEDModule 00040 { 00041 Q_OBJECT 00042 K_DCOP 00043 public: 00044 KCookieServer(const TQCString &); 00045 ~KCookieServer(); 00046 00047 k_dcop: 00048 TQString findCookies(TQString); 00049 TQString findCookies(TQString, long); 00050 TQStringList findDomains(); 00051 TQStringList findCookies(TQValueList<int>,TQString,TQString,TQString,TQString); 00052 TQString findDOMCookies(TQString); 00053 TQString findDOMCookies(TQString, long); 00054 void addCookies(TQString, TQCString, long); 00055 void deleteCookie(TQString, TQString, TQString, TQString); 00056 void deleteCookiesFromDomain(TQString); 00057 void deleteSessionCookies(long); 00058 void deleteSessionCookiesFor(TQString, long); 00059 void deleteAllCookies(); 00060 void addDOMCookies(TQString, TQCString, long); 00064 void setDomainAdvice(TQString url, TQString advice); 00068 TQString getDomainAdvice(TQString url); 00069 void reloadPolicy(); 00070 void shutdown(); 00071 00072 public: 00073 bool cookiesPending(const TQString &url, KHttpCookieList *cookieList=0); 00074 void addCookies(const TQString &url, const TQCString &cookieHeader, 00075 long windowId, bool useDOMFormat); 00076 void checkCookies(KHttpCookieList *cookieList); 00077 00078 public slots: 00079 void slotSave(); 00080 void slotDeleteSessionCookies(long); 00081 00082 protected: 00083 KCookieJar *mCookieJar; 00084 KHttpCookieList *mPendingCookies; 00085 RequestList *mRequestList; 00086 TQTimer *mTimer; 00087 bool mAdvicePending; 00088 DCOPClient *mOldCookieServer; 00089 KConfig *mConfig; 00090 00091 private: 00092 virtual int newInstance(TQValueList<TQCString>) { return 0; } 00093 bool cookieMatches(KHttpCookie*, TQString, TQString, TQString, TQString); 00094 void putCookie(TQStringList&, KHttpCookie*, const TQValueList<int>&); 00095 void saveCookieJar(); 00096 }; 00097 00098 #endif