20 #ifndef KONQ_HISTORY_H
21 #define KONQ_HISTORY_H
23 #include <tqdatastream.h>
25 #include <tqptrlist.h>
30 #include <dcopobject.h>
32 #include <kcompletion.h>
34 #include <tdeparts/historyprovider.h>
36 #include "konq_historycomm.h"
38 #include <libkonq_export.h>
43 typedef TQPtrList<KonqHistoryEntry> KonqBaseHistoryList;
44 typedef TQPtrListIterator<KonqHistoryEntry> KonqHistoryIterator;
46 class LIBKONQ_EXPORT KonqHistoryList :
public KonqBaseHistoryList
54 KonqHistoryEntry * findEntry(
const KURL& url );
60 virtual int compareItems( TQPtrCollection::Item, TQPtrCollection::Item );
94 void emitSetMaxCount( TQ_UINT32 count );
105 void emitSetMaxAge( TQ_UINT32 days );
113 void emitRemoveFromHistory(
const KURL& url );
121 void emitRemoveFromHistory(
const KURL::List& urls );
131 TQ_UINT32
maxAge()
const {
return m_maxAgeDays; }
150 void addPending(
const KURL& url,
const TQString& typedURL = TQString::null,
151 const TQString& title = TQString::null );
156 void confirmPending(
const KURL& url,
157 const TQString& typedURL = TQString::null,
158 const TQString& title = TQString::null );
164 void removePending(
const KURL& url );
175 const KonqHistoryList&
entries()
const {
return m_history; }
184 virtual void insert(
const TQString& );
185 virtual void remove(
const TQString& ) {}
186 virtual void clear() {}
238 return (entry && m_maxAgeDays > 0 && entry->lastVisited <
239 TQDateTime(TQDate::currentDate().addDays( -m_maxAgeDays )));
245 void emitAddToHistory(
const KonqHistoryEntry& entry );
256 virtual void notifyHistoryEntry( KonqHistoryEntry e, TQCString saveId );
262 virtual void notifyMaxCount( TQ_UINT32 count, TQCString saveId );
268 virtual void notifyMaxAge( TQ_UINT32 days, TQCString saveId );
273 virtual void notifyClear( TQCString saveId );
279 virtual void notifyRemove( KURL url, TQCString saveId );
285 virtual void notifyRemove( KURL::List urls, TQCString saveId );
290 virtual TQStringList allURLs()
const;
303 void addToHistory(
bool pending,
const KURL& url,
304 const TQString& typedURL = TQString::null,
305 const TQString& title = TQString::null );
313 virtual bool filterOut(
const KURL& url );
315 void addToUpdateList(
const TQString& url ) {
316 m_updateURLs.append( url );
317 m_updateTimer->start( 500,
true );
332 void slotEmitUpdated();
338 bool isSenderOfBroadcast();
347 KonqHistoryEntry * findEntry(
const KURL& url );
354 KonqHistoryEntry * createFallbackEntry(
const TQString& )
const;
356 void addToCompletion(
const TQString& url,
const TQString& typedURL,
int numberOfTimesVisited = 1 );
357 void removeFromCompletion(
const TQString& url,
const TQString& typedURL );
360 KonqHistoryList m_history;
368 TQMap<TQString,KonqHistoryEntry*> m_pending;
370 TQ_UINT32 m_maxCount;
371 TQ_UINT32 m_maxAgeDays;
373 TDECompletion *m_pCompletion;
379 TQTimer *m_updateTimer;
381 static const TQ_UINT32 s_historyVersion;
DCOP Methods for KonqHistoryManager.
This class maintains and manages a history of all URLs visited by one Konqueror instance.
TQ_UINT32 maxCount() const
void entryAdded(const KonqHistoryEntry *entry)
Emitted after a new entry was added.
bool isExpired(KonqHistoryEntry *entry)
void loadingFinished()
Emitted after the entire history was loaded from disk.
TQStringList m_updateURLs
The list of urls that is going to be emitted in slotEmitUpdated.
void entryRemoved(const KonqHistoryEntry *entry)
Emitted after an entry was removed from the history Note, that this entry will be deleted immediately...
TDECompletion * completionObject() const
const KonqHistoryList & entries() const