• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KHTML

  • khtml
khtml_wallet_p.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 *
3 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
4 * 1999-2001 Lars Knoll <knoll@kde.org>
5 * 1999-2001 Antti Koivisto <koivisto@kde.org>
6 * 2000-2001 Simon Hausmann <hausmann@kde.org>
7 * 2000-2001 Dirk Mueller <mueller@kde.org>
8 * 2000 Stefan Schimanski <1Stein@gmx.de>
9 * 2001-2003 George Staikos <staikos@kde.org>
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
20 *
21 * You should have received a copy of the GNU Library General Public License
22 * along with this library; see the file COPYING.LIB. If not, write to
23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301, USA.
25 */
26#if !defined khtml_wallet_p_h && !defined KHTML_NO_WALLET
27#define khtml_wallet_p_h
28
29#include <kcursor.h>
30#include <kxmlguifactory.h>
31#include <kaction.h>
32#include <kparts/partmanager.h>
33#include <kparts/statusbarextension.h>
34#include <kparts/browserextension.h>
35#include <kwallet.h>
36
37#include <QtCore/QPointer>
38#include <QtCore/QMap>
39#include <QtCore/QTimer>
40
41class KHTMLWalletQueue : public QObject
42{
43 Q_OBJECT
44 public:
45 KHTMLWalletQueue(QObject *parent) : QObject(parent) {
46 wallet = 0L;
47 }
48
49 virtual ~KHTMLWalletQueue() {
50 delete wallet;
51 wallet = 0L;
52 }
53
54 KWallet::Wallet *wallet;
55 typedef QPair<DOM::HTMLFormElementImpl*, QPointer<DOM::DocumentImpl> > Caller;
56 typedef QList<Caller> CallerList;
57 CallerList callers;
58 QList<QPair<QString, QMap<QString, QString> > > savers;
59
60 Q_SIGNALS:
61 void walletOpened(KWallet::Wallet*);
62
63 public Q_SLOTS:
64 void walletOpened(bool success) {
65 if (!success) {
66 delete wallet;
67 wallet = 0L;
68 }
69 emit walletOpened(wallet);
70 if (wallet) {
71 if (!wallet->hasFolder(KWallet::Wallet::FormDataFolder())) {
72 wallet->createFolder(KWallet::Wallet::FormDataFolder());
73 }
74 for (CallerList::Iterator i = callers.begin(); i != callers.end(); ++i) {
75 if ((*i).first && (*i).second) {
76 (*i).first->walletOpened(wallet);
77 }
78 }
79 wallet->setFolder(KWallet::Wallet::FormDataFolder());
80 for (QList<QPair<QString, QMap<QString, QString> > >::Iterator i = savers.begin(); i != savers.end(); ++i) {
81 wallet->writeMap((*i).first, (*i).second);
82 }
83 }
84 callers.clear();
85 savers.clear();
86 wallet = 0L; // gave it away
87 }
88};
89
90#endif
browserextension.h
KHTMLWalletQueue
Definition: khtml_wallet_p.h:42
KHTMLWalletQueue::walletOpened
void walletOpened(bool success)
Definition: khtml_wallet_p.h:64
KHTMLWalletQueue::callers
CallerList callers
Definition: khtml_wallet_p.h:57
KHTMLWalletQueue::Caller
QPair< DOM::HTMLFormElementImpl *, QPointer< DOM::DocumentImpl > > Caller
Definition: khtml_wallet_p.h:55
KHTMLWalletQueue::walletOpened
void walletOpened(KWallet::Wallet *)
KHTMLWalletQueue::CallerList
QList< Caller > CallerList
Definition: khtml_wallet_p.h:56
KHTMLWalletQueue::savers
QList< QPair< QString, QMap< QString, QString > > > savers
Definition: khtml_wallet_p.h:58
KHTMLWalletQueue::KHTMLWalletQueue
KHTMLWalletQueue(QObject *parent)
Definition: khtml_wallet_p.h:45
KHTMLWalletQueue::wallet
KWallet::Wallet * wallet
Definition: khtml_wallet_p.h:54
KHTMLWalletQueue::~KHTMLWalletQueue
virtual ~KHTMLWalletQueue()
Definition: khtml_wallet_p.h:49
KWallet::Wallet
KWallet::Wallet::createFolder
virtual bool createFolder(const QString &f)
KWallet::Wallet::hasFolder
virtual bool hasFolder(const QString &f)
KWallet::Wallet::setFolder
virtual bool setFolder(const QString &f)
KWallet::Wallet::FormDataFolder
static const QString FormDataFolder()
KWallet::Wallet::writeMap
virtual int writeMap(const QString &key, const QMap< QString, QString > &value)
QList
QMap
QObject
QPair
kaction.h
kcursor.h
kwallet.h
kxmlguifactory.h
partmanager.h
statusbarextension.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal