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

kparts

  • kparts
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 <kapplication.h>
23 
24 #include "historyprovider.h"
25 
26 using namespace KParts;
27 template class TQDict<void>;
28 
29 HistoryProvider * HistoryProvider::s_self = 0L;
30 
31 class HistoryProvider::HistoryProviderPrivate
32 {
33 public:
34  HistoryProviderPrivate()
35  : dict( 1009 ) {}
36 
37  TQDict<void> dict;
38 };
39 
40 HistoryProvider * HistoryProvider::self()
41 {
42  if ( !s_self )
43  s_self = new HistoryProvider( TQT_TQOBJECT(kapp), "history provider" );
44  return s_self;
45 }
46 
47 HistoryProvider::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 
56 HistoryProvider::~HistoryProvider()
57 {
58  delete d;
59 
60  if ( s_self == this )
61  s_self = 0;
62 }
63 
64 bool HistoryProvider::contains( const TQString& item ) const
65 {
66  return (bool) d->dict.find( item );
67 }
68 
69 void 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 
76 void HistoryProvider::remove( const TQString& item )
77 {
78  (void) d->dict.remove( item );
79 }
80 
81 void HistoryProvider::clear()
82 {
83  d->dict.clear();
84  emit cleared();
85 }
86 
87 void HistoryProvider::virtual_hook( int, void* )
88 { /*BASE::virtual_hook( id, data );*/ }
89 
90 #include "historyprovider.moc"
KParts::HistoryProvider::contains
virtual bool contains(const TQString &item) const
Definition: historyprovider.cpp:64
KParts::HistoryProvider::~HistoryProvider
virtual ~HistoryProvider()
Destroys the provider.
Definition: historyprovider.cpp:56
KParts::HistoryProvider
Basic class to manage a history of "items".
Definition: historyprovider.h:41
KParts::HistoryProvider::cleared
void cleared()
Emitted after the history has been cleared.
KParts::HistoryProvider::inserted
void inserted(const TQString &item)
Emitted after the item has been inserted.
KParts::HistoryProvider::remove
virtual void remove(const TQString &item)
Removes item from the history.
Definition: historyprovider.cpp:76
KParts::HistoryProvider::clear
virtual void clear()
Clears the history.
Definition: historyprovider.cpp:81
KParts::HistoryProvider::insert
virtual void insert(const TQString &item)
Inserts item into the history.
Definition: historyprovider.cpp:69
KParts
Definition: browserextension.cpp:64
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

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

kparts

Skip menu "kparts"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kparts by doxygen 1.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |