From ce4a32fe52ef09d8f5ff1dd22c001110902b60a2 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kioslave/http/kcookiejar/kcookieserver.h | 98 ++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 kioslave/http/kcookiejar/kcookieserver.h (limited to 'kioslave/http/kcookiejar/kcookieserver.h') diff --git a/kioslave/http/kcookiejar/kcookieserver.h b/kioslave/http/kcookiejar/kcookieserver.h new file mode 100644 index 000000000..bcd7fa530 --- /dev/null +++ b/kioslave/http/kcookiejar/kcookieserver.h @@ -0,0 +1,98 @@ +/* + This file is part of the KDE File Manager + + Copyright (C) 1998 Waldo Bastian (bastian@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as published by the Free Software Foundation. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +//---------------------------------------------------------------------------- +// +// KDE Cookie Server +// $Id$ + +#ifndef KCOOKIESERVER_H +#define KCOOKIESERVER_H + +#include +#include + +class KHttpCookieList; +class KCookieJar; +class KHttpCookie; +class QTimer; +class RequestList; +class DCOPClient; +class KConfig; + +class KCookieServer : public KDEDModule +{ + Q_OBJECT + K_DCOP +public: + KCookieServer(const QCString &); + ~KCookieServer(); + +k_dcop: + QString findCookies(QString); + QString findCookies(QString, long); + QStringList findDomains(); + QStringList findCookies(QValueList,QString,QString,QString,QString); + QString findDOMCookies(QString); + QString findDOMCookies(QString, long); + void addCookies(QString, QCString, long); + void deleteCookie(QString, QString, QString, QString); + void deleteCookiesFromDomain(QString); + void deleteSessionCookies(long); + void deleteSessionCookiesFor(QString, long); + void deleteAllCookies(); + void addDOMCookies(QString, QCString, long); + /** + * Sets the cookie policy for the domain associated with the specified URL. + */ + void setDomainAdvice(QString url, QString advice); + /** + * Returns the cookie policy in effect for the specified URL. + */ + QString getDomainAdvice(QString url); + void reloadPolicy(); + void shutdown(); + +public: + bool cookiesPending(const QString &url, KHttpCookieList *cookieList=0); + void addCookies(const QString &url, const QCString &cookieHeader, + long windowId, bool useDOMFormat); + void checkCookies(KHttpCookieList *cookieList); + +public slots: + void slotSave(); + void slotDeleteSessionCookies(long); + +protected: + KCookieJar *mCookieJar; + KHttpCookieList *mPendingCookies; + RequestList *mRequestList; + QTimer *mTimer; + bool mAdvicePending; + DCOPClient *mOldCookieServer; + KConfig *mConfig; + +private: + virtual int newInstance(QValueList) { return 0; } + bool cookieMatches(KHttpCookie*, QString, QString, QString, QString); + void putCookie(QStringList&, KHttpCookie*, const QValueList&); + void saveCookieJar(); +}; + +#endif -- cgit v1.2.1