2 * kcookiesmanagement.h - Cookies manager
4 * Copyright 2000-2001 Marco Pinelli <pinmc@orion.it>
7 * Copyright (c) 2000-2001 Dawit Alemayehu <adawit@kde.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef KCOOKIESMANAGEMENT_H
25 #define KCOOKIESMANAGEMENT_H
27 #include <QtCore/QList>
28 #include <QtCore/QStringList>
29 #include <QtGui/QTreeWidget>
30 #include <QtCore/QHash>
33 #include "ui_kcookiesmanagementdlg.h"
38 class KCookiesManagementDlgUI
: public QWidget
, public Ui::KCookiesManagementDlgUI
41 KCookiesManagementDlgUI( QWidget
*parent
) : QWidget( parent
) {
47 class CookieListViewItem
: public QTreeWidgetItem
50 CookieListViewItem(QTreeWidget
*parent
, const QString
&dom
);
51 CookieListViewItem(QTreeWidgetItem
*parent
, CookieProp
*cookie
);
52 ~CookieListViewItem();
54 QString
domain() const { return mDomain
; }
55 CookieProp
* cookie() const { return mCookie
; }
56 CookieProp
* leaveCookie();
57 void setCookiesLoaded() { mCookiesLoaded
= true; }
58 bool cookiesLoaded() const { return mCookiesLoaded
; }
61 void init( CookieProp
* cookie
,
62 const QString
&domain
= QString(),
63 bool cookieLoaded
=false );
69 class KCookiesManagement
: public KCModule
74 KCookiesManagement(const KComponentData
&componentData
, QWidget
*parent
);
75 ~KCookiesManagement();
79 virtual void defaults();
80 virtual QString
quickHelp() const;
84 void deleteAllCookies();
86 void getCookies(QTreeWidgetItem
*);
87 void showCookieDetails(QTreeWidgetItem
*);
91 void reset (bool deleteAll
= false);
92 bool cookieDetails(CookieProp
*cookie
);
93 void clearCookieDetails();
98 KCookiesManagementDlgUI
* dlg
;
100 QStringList deletedDomains
;
101 typedef QList
<CookieProp
*> CookiePropList
;
102 QHash
<QString
, CookiePropList
> deletedCookies
;
105 #endif // KCOOKIESMANAGEMENT_H