libopie PIM API Documentation

opimxrefmanager.cpp

Go to the documentation of this file.
00001 #include "opimxrefmanager.h"
00002 
00003 
00004 OPimXRefManager::OPimXRefManager() {
00005 }
00006 OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) {
00007     m_list = ref.m_list;
00008 }
00009 OPimXRefManager::~OPimXRefManager() {
00010 }
00011 OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) {
00012     m_list = ref.m_list;
00013     return *this;
00014 }
00015 bool OPimXRefManager::operator==( const OPimXRefManager& /*ref*/) {
00016     //   if ( m_list == ref.m_list ) return true;
00017 
00018     return false;
00019 }
00020 void OPimXRefManager::add( const OPimXRef& ref) {
00021     m_list.append( ref );
00022 }
00023 void OPimXRefManager::remove( const OPimXRef& ref) {
00024     m_list.remove( ref );
00025 }
00026 void OPimXRefManager::replace( const OPimXRef& ref) {
00027     m_list.remove( ref );
00028     m_list.append( ref );
00029 }
00030 void OPimXRefManager::clear() {
00031     m_list.clear();
00032 }
00033 QStringList OPimXRefManager::apps()const {
00034     OPimXRef::ValueList::ConstIterator it;
00035     QStringList list;
00036 
00037     QString str;
00038     for ( it = m_list.begin(); it != m_list.end(); ++it ) {
00039         str = (*it).partner( OPimXRef::One ).service();
00040         if ( !list.contains( str ) ) list << str;
00041 
00042         str = (*it).partner( OPimXRef::Two ).service();
00043         if ( !list.contains( str ) ) list << str;
00044     }
00045     return list;
00046 }
00047 OPimXRef::ValueList OPimXRefManager::list()const {
00048     return m_list;
00049 }
00050 OPimXRef::ValueList OPimXRefManager::list( const QString& appName )const{
00051     OPimXRef::ValueList list;
00052     OPimXRef::ValueList::ConstIterator it;
00053 
00054     for ( it = m_list.begin(); it != m_list.end(); ++it ) {
00055         if ( (*it).containsString( appName ) )
00056             list.append( (*it) );
00057     }
00058 
00059     return list;
00060 }
00061 OPimXRef::ValueList OPimXRefManager::list( int uid )const {
00062     OPimXRef::ValueList list;
00063     OPimXRef::ValueList::ConstIterator it;
00064 
00065     for ( it = m_list.begin(); it != m_list.end(); ++it ) {
00066         if ( (*it).containsUid( uid ) )
00067             list.append( (*it) );
00068     }
00069 
00070     return list;
00071 }
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:25:21 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001