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

tdeparts

  • tdeparts
historyprovider.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2001 Carsten Pfeiffer <pfeiffer@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#include <tqdict.h>
21
22#include <tdeapplication.h>
23
24#include "historyprovider.h"
25
26using namespace KParts;
27template class TQDict<void>;
28
29HistoryProvider * HistoryProvider::s_self = 0L;
30
31class HistoryProvider::HistoryProviderPrivate
32{
33public:
34 HistoryProviderPrivate()
35 : dict( 1009 ) {}
36
37 TQDict<void> dict;
38};
39
40HistoryProvider * HistoryProvider::self()
41{
42 if ( !s_self )
43 s_self = new HistoryProvider( tdeApp, "history provider" );
44 return s_self;
45}
46
47HistoryProvider::HistoryProvider( TQObject *parent, const char *name )
48 : TQObject( parent, name )
49{
50 if ( !s_self )
51 s_self = this;
52
53 d = new HistoryProviderPrivate;
54}
55
56HistoryProvider::~HistoryProvider()
57{
58 delete d;
59
60 if ( s_self == this )
61 s_self = 0;
62}
63
64bool HistoryProvider::contains( const TQString& item ) const
65{
66 return (bool) d->dict.find( item );
67}
68
69void HistoryProvider::insert( const TQString& item )
70{
71 // no need to allocate memory, we only want to have fast lookup, no mapping
72 d->dict.replace( item, (void*) 1 );
73 emit inserted( item );
74}
75
76void HistoryProvider::remove( const TQString& item )
77{
78 (void) d->dict.remove( item );
79}
80
81void HistoryProvider::clear()
82{
83 d->dict.clear();
84 emit cleared();
85}
86
87void HistoryProvider::virtual_hook( int, void* )
88{ /*BASE::virtual_hook( id, data );*/ }
89
90#include "historyprovider.moc"
KParts::HistoryProvider
Basic class to manage a history of "items".
Definition: historyprovider.h:42
KParts::HistoryProvider::~HistoryProvider
virtual ~HistoryProvider()
Destroys the provider.
Definition: historyprovider.cpp:56
KParts::HistoryProvider::remove
virtual void remove(const TQString &item)
Removes item from the history.
Definition: historyprovider.cpp:76
KParts::HistoryProvider::HistoryProvider
HistoryProvider(TQObject *parent=0L, const char *name=0)
Creates a KHistoryProvider with an optional parent and name.
Definition: historyprovider.cpp:47
KParts::HistoryProvider::contains
virtual bool contains(const TQString &item) const
Definition: historyprovider.cpp:64
KParts::HistoryProvider::insert
virtual void insert(const TQString &item)
Inserts item into the history.
Definition: historyprovider.cpp:69
KParts::HistoryProvider::inserted
void inserted(const TQString &item)
Emitted after the item has been inserted.
KParts::HistoryProvider::clear
virtual void clear()
Clears the history.
Definition: historyprovider.cpp:81
KParts::HistoryProvider::cleared
void cleared()
Emitted after the history has been cleared.

tdeparts

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

tdeparts

Skip menu "tdeparts"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeparts by doxygen 1.9.4
This website is maintained by Timothy Pearson.