KParts.HistoryProvider

KDE 4.5 PyKDE API Reference

- KDE's Python API

# HistoryProvider Class Reference

`from PyKDE4.kparts import *`

Inherits: QObject
Namespace: KParts

## Detailed Description

Basic class to manage a history of "items". This class is only meant for fast lookup, if an item is in the history or not.

May be subclassed to implement a persistent history for example. For usage with khtml, just create your provider and call the HistoryProvider constructor _before_ you do any khtml stuff. That way, khtml, using the self()-method, will use your subclassed provider.

Author:
  Carsten Pfeiffer <pfeiffer@kde.org>

## Signals
| cleared ()
| inserted (QString item)
| updated (QStringList items)
## Methods
| __init__ (self, QObject parent=0)
| clear (self)
bool | contains (self, QString item)
| insert (self, QString item)
| remove (self, QString item)
## Static Methods
bool | exists ()
KParts.HistoryProvider | self ()

## Signal Documentation

cleared | ( |  | ) |

Emitted after the history has been cleared.

Signal syntax:
  `QObject.connect(source, SIGNAL("cleared()"), target_slot)`

inserted | ( | QString | item
| ) |  |  |

Emitted after the item has been inserted

Signal syntax:
  `QObject.connect(source, SIGNAL("inserted(const QString&)"), target_slot)`

updated | ( | QStringList | items
| ) |  |  |

This signal is never emitted from this class, it is only meant as an interface for subclasses. Emit this signal to notify others that the history has changed. Put those items that were added or removed from the history into items.

Signal syntax:
  `QObject.connect(source, SIGNAL("updated(const QStringList&)"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | QObject | parent=0
| ) |  |  |

Creates a KHistoryProvider with an optional parent and name

clear | ( |  | self ) |

Clears the history. The cleared() signal is emitted after clearing.

bool contains | ( | self, |
|  | QString | item
| ) |  |  |

Returns:
  true if item is present in the history.

insert | ( | self, |
|  | QString | item
| ) |  |  |

Inserts item into the history.

remove | ( | self, |
|  | QString | item
| ) |  |  |

Removes item from the history.

## Static Method Documentation

bool exists | ( |  | ) |

Returns:
  true if a provider has already been created.

Since:
  4.4

KParts.HistoryProvider self | ( |  | ) |