• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libkonq
 

libkonq

Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KonqHistoryManager Class Reference

#include <konq_historymgr.h>

Inheritance diagram for KonqHistoryManager:
KonqHistoryComm

Public Slots

bool loadHistory ()
 
bool saveHistory ()
 
void emitClear ()
 

Signals

void loadingFinished ()
 
void entryAdded (const KonqHistoryEntry *entry)
 
void entryRemoved (const KonqHistoryEntry *entry)
 

Public Member Functions

 KonqHistoryManager (TQObject *parent, const char *name)
 
void emitSetMaxCount (TQ_UINT32 count)
 
void emitSetMaxAge (TQ_UINT32 days)
 
void emitRemoveFromHistory (const KURL &url)
 
void emitRemoveFromHistory (const KURL::List &urls)
 
TQ_UINT32 maxCount () const
 
TQ_UINT32 maxAge () const
 
void addPending (const KURL &url, const TQString &typedURL=TQString::null, const TQString &title=TQString::null)
 
void confirmPending (const KURL &url, const TQString &typedURL=TQString::null, const TQString &title=TQString::null)
 
void removePending (const KURL &url)
 
TDECompletion * completionObject () const
 
const KonqHistoryList & entries () const
 
virtual void insert (const TQString &)
 
virtual void remove (const TQString &)
 
virtual void clear ()
 

Static Public Member Functions

static KonqHistoryManager * kself ()
 

Protected Member Functions

void adjustSize ()
 
bool isExpired (KonqHistoryEntry *entry)
 
void emitAddToHistory (const KonqHistoryEntry &entry)
 
virtual void notifyHistoryEntry (KonqHistoryEntry e, TQCString saveId)
 
virtual void notifyMaxCount (TQ_UINT32 count, TQCString saveId)
 
virtual void notifyMaxAge (TQ_UINT32 days, TQCString saveId)
 
virtual void notifyClear (TQCString saveId)
 
virtual void notifyRemove (KURL url, TQCString saveId)
 
virtual void notifyRemove (KURL::List urls, TQCString saveId)
 
virtual TQStringList allURLs () const
 
void addToHistory (bool pending, const KURL &url, const TQString &typedURL=TQString::null, const TQString &title=TQString::null)
 
virtual bool filterOut (const KURL &url)
 
void addToUpdateList (const TQString &url)
 
- Protected Member Functions inherited from KonqHistoryComm
 KonqHistoryComm (TQCString objId)
 

Protected Attributes

TQStringList m_updateURLs
 

Detailed Description

This class maintains and manages a history of all URLs visited by one Konqueror instance.

Additionally it synchronizes the history with other Konqueror instances via DCOP to keep one global and persistant history.

It keeps the history in sync with one TDECompletion object

Definition at line 74 of file konq_historymgr.h.

Constructor & Destructor Documentation

◆ KonqHistoryManager()

KonqHistoryManager::KonqHistoryManager ( TQObject *  parent,
const char *  name 
)

Definition at line 36 of file konq_historymgr.cpp.

◆ ~KonqHistoryManager()

KonqHistoryManager::~KonqHistoryManager ( )

Definition at line 68 of file konq_historymgr.cpp.

Member Function Documentation

◆ addPending()

void KonqHistoryManager::addPending ( const KURL &  url,
const TQString &  typedURL = TQString::null,
const TQString &  title = TQString::null 
)

Adds a pending entry to the history.

Pending means, that the entry is not verified yet, i.e. it is not sure url does exist at all. You probably don't know the title of the url in that case either. Call confirmPending() as soon you know the entry is good and should be updated.

If an entry with url already exists, it will be updated (lastVisited date will become the current time and the number of visits will be incremented).

Parameters
urlThe url of the history entry
typedURLthe string that the user typed, which resulted in url Doesn't have to be a valid url, e.g. "slashdot.org".
titleThe title of the URL. If you don't know it (yet), you may specify it in confirmPending().

Definition at line 256 of file konq_historymgr.cpp.

◆ addToHistory()

void KonqHistoryManager::addToHistory ( bool  pending,
const KURL &  url,
const TQString &  typedURL = TQString::null,
const TQString &  title = TQString::null 
)
protected

Does the work for addPending() and confirmPending().

Adds an entry to the history. If an entry with url already exists, it will be updated (lastVisited date will become the current time and the number of visits will be incremented). pending means, the entry has not been "verified", it's been added right after typing the url. If pending is false, url will be removed from the pending urls (if available) and NOT be added again in that case.

Definition at line 270 of file konq_historymgr.cpp.

◆ addToUpdateList()

void KonqHistoryManager::addToUpdateList ( const TQString &  url)
inlineprotected

Definition at line 315 of file konq_historymgr.h.

◆ adjustSize()

void KonqHistoryManager::adjustSize ( )
protected

Resizes the history list to contain less or equal than m_maxCount entries.

The first (oldest) entries are removed.

Definition at line 236 of file konq_historymgr.cpp.

◆ allURLs()

TQStringList KonqHistoryManager::allURLs ( ) const
protectedvirtual
Returns
a list of all urls in the history.

Implements KonqHistoryComm.

Definition at line 675 of file konq_historymgr.cpp.

◆ clear()

virtual void KonqHistoryManager::clear ( )
inlinevirtual

Definition at line 186 of file konq_historymgr.h.

◆ completionObject()

TDECompletion * KonqHistoryManager::completionObject ( ) const
inline
Returns
the TDECompletion object.

Definition at line 169 of file konq_historymgr.h.

◆ confirmPending()

void KonqHistoryManager::confirmPending ( const KURL &  url,
const TQString &  typedURL = TQString::null,
const TQString &  title = TQString::null 
)

Confirms and updates the entry for url.

Definition at line 262 of file konq_historymgr.cpp.

◆ emitAddToHistory()

void KonqHistoryManager::emitAddToHistory ( const KonqHistoryEntry &  entry)
protected

Notifes all running instances about a new HistoryEntry via DCOP.

Definition at line 350 of file konq_historymgr.cpp.

◆ emitClear

void KonqHistoryManager::emitClear ( )
slot

Clears the history and tells all other Konqueror instances via DCOP to do the same.

The history is saved afterwards, if necessary.

Definition at line 413 of file konq_historymgr.cpp.

◆ emitRemoveFromHistory() [1/2]

void KonqHistoryManager::emitRemoveFromHistory ( const KURL &  url)

Removes the history entry for url, if existant.

Tells all other Konqueror instances via DCOP to do the same.

The history is saved after receiving the DCOP call.

Definition at line 395 of file konq_historymgr.cpp.

◆ emitRemoveFromHistory() [2/2]

void KonqHistoryManager::emitRemoveFromHistory ( const KURL::List &  urls)

Removes the history entries for the given list of urls.

Tells all other Konqueror instances via DCOP to do the same.

The history is saved after receiving the DCOP call.

Definition at line 404 of file konq_historymgr.cpp.

◆ emitSetMaxAge()

void KonqHistoryManager::emitSetMaxAge ( TQ_UINT32  days)

Sets a new maximum age of history entries and removes all entries that are older than days.

Notifies all other Konqueror instances via DCOP to do the same.

An age of 0 means no expiry based on the age.

The history is saved after receiving the DCOP call.

Definition at line 431 of file konq_historymgr.cpp.

◆ emitSetMaxCount()

void KonqHistoryManager::emitSetMaxCount ( TQ_UINT32  count)

Sets a new maximum size of history and truncates the current history if necessary.

Notifies all other Konqueror instances via DCOP to do the same.

The history is saved after receiving the DCOP call.

Definition at line 422 of file konq_historymgr.cpp.

◆ entries()

const KonqHistoryList & KonqHistoryManager::entries ( ) const
inline
Returns
the list of all history entries, sorted by date (oldest entries first)

Definition at line 175 of file konq_historymgr.h.

◆ entryAdded

void KonqHistoryManager::entryAdded ( const KonqHistoryEntry *  entry)
signal

Emitted after a new entry was added.

◆ entryRemoved

void KonqHistoryManager::entryRemoved ( const KonqHistoryEntry *  entry)
signal

Emitted after an entry was removed from the history Note, that this entry will be deleted immediately after you got that signal.

◆ filterOut()

bool KonqHistoryManager::filterOut ( const KURL &  url)
protectedvirtual
Returns
true if the given url should be filtered out and not be added to the history. By default, all local urls (url.isLocalFile()) will return true, as well as urls with an empty host.

Definition at line 664 of file konq_historymgr.cpp.

◆ insert()

void KonqHistoryManager::insert ( const TQString &  url)
virtual

Reimplemented in such a way that all URLs that would be filtered out normally (see filterOut()) will still be added to the history.

By default, file:/ urls will be filtered out, but if they come thru the HistoryProvider interface, they are added to the history.

Definition at line 336 of file konq_historymgr.cpp.

◆ isExpired()

bool KonqHistoryManager::isExpired ( KonqHistoryEntry *  entry)
inlineprotected
Returns
true if entry is older than the given maximum age, otherwise false.

Definition at line 237 of file konq_historymgr.h.

◆ kself()

static KonqHistoryManager * KonqHistoryManager::kself ( )
inlinestatic

Definition at line 80 of file konq_historymgr.h.

◆ loadHistory

bool KonqHistoryManager::loadHistory ( )
slot

Loads the history and fills the completion object.

Definition at line 81 of file konq_historymgr.cpp.

◆ loadingFinished

void KonqHistoryManager::loadingFinished ( )
signal

Emitted after the entire history was loaded from disk.

◆ maxAge()

TQ_UINT32 KonqHistoryManager::maxAge ( ) const
inline
Returns
the current maximum age (in days) of history entries.

Definition at line 131 of file konq_historymgr.h.

◆ maxCount()

TQ_UINT32 KonqHistoryManager::maxCount ( ) const
inline
Returns
the current maximum number of history entries.

Definition at line 126 of file konq_historymgr.h.

◆ notifyClear()

void KonqHistoryManager::notifyClear ( TQCString  saveId)
protectedvirtual

Clears the history completely.

Called via DCOP by some config-module

Implements KonqHistoryComm.

Definition at line 522 of file konq_historymgr.cpp.

◆ notifyHistoryEntry()

void KonqHistoryManager::notifyHistoryEntry ( KonqHistoryEntry  e,
TQCString  saveId 
)
protectedvirtual

Every konqueror instance broadcasts new history entries to the other konqueror instances.

Those add the entry to their list, but don't save the list, because the sender saves the list.

Parameters
ethe new history entry
saveIdis the DCOPObject::objId() of the sender so that only the sender saves the new history.

Implements KonqHistoryComm.

Definition at line 443 of file konq_historymgr.cpp.

◆ notifyMaxAge()

void KonqHistoryManager::notifyMaxAge ( TQ_UINT32  days,
TQCString  saveId 
)
protectedvirtual

Called when the configuration of the maximum age of history-entries changed.

Called via DCOP by some config-module

Implements KonqHistoryComm.

Definition at line 506 of file konq_historymgr.cpp.

◆ notifyMaxCount()

void KonqHistoryManager::notifyMaxCount ( TQ_UINT32  count,
TQCString  saveId 
)
protectedvirtual

Called when the configuration of the maximum count changed.

Called via DCOP by some config-module

Implements KonqHistoryComm.

Definition at line 490 of file konq_historymgr.cpp.

◆ notifyRemove() [1/2]

void KonqHistoryManager::notifyRemove ( KURL  url,
TQCString  saveId 
)
protectedvirtual

Notifes about a url that has to be removed from the history.

The instance where saveId == objId() has to save the history.

Implements KonqHistoryComm.

Definition at line 534 of file konq_historymgr.cpp.

◆ notifyRemove() [2/2]

void KonqHistoryManager::notifyRemove ( KURL::List  urls,
TQCString  saveId 
)
protectedvirtual

Notifes about a list of urls that has to be removed from the history.

The instance where saveId == objId() has to save the history.

Implements KonqHistoryComm.

Definition at line 558 of file konq_historymgr.cpp.

◆ remove()

virtual void KonqHistoryManager::remove ( const TQString &  )
inlinevirtual

Definition at line 185 of file konq_historymgr.h.

◆ removePending()

void KonqHistoryManager::removePending ( const KURL &  url)

Removes a pending url from the history, e.g.

when the url does not exist, or the user aborted loading.

Definition at line 364 of file konq_historymgr.cpp.

◆ saveHistory

bool KonqHistoryManager::saveHistory ( )
slot

Saves the entire history.

Definition at line 200 of file konq_historymgr.cpp.

Member Data Documentation

◆ m_updateURLs

TQStringList KonqHistoryManager::m_updateURLs
protected

The list of urls that is going to be emitted in slotEmitUpdated.

Add urls to it whenever you modify the list of history entries and start m_updateTimer.

Definition at line 325 of file konq_historymgr.h.


The documentation for this class was generated from the following files:
  • konq_historymgr.h
  • konq_historymgr.cpp

libkonq

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

libkonq

Skip menu "libkonq"
  • kate
  • libkonq
  • twin
  •   lib
Generated for libkonq by doxygen 1.9.4
This website is maintained by Timothy Pearson.