Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

opimxref.cpp

Go to the documentation of this file.
00001 /*
00002                              This file is part of the Opie Project
00003                              Copyright (C) The Main Author <main-author@whereever.org>
00004               =.             Copyright (C) The Opie Team <opie-devel@handhelds.org>
00005             .=l.
00006            .>+-=
00007  _;:,     .>    :=|.         This program is free software; you can
00008 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00009 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00010 .="- .-=="i,     .._         License as published by the Free Software
00011  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00012      ._= =}       :          or (at your option) any later version.
00013     .%`+i>       _;_.
00014     .i_,=:_.      -<s.       This program is distributed in the hope that
00015      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00016     : ..    .:,     . . .    without even the implied warranty of
00017     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00018   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00019 ..}^=.=       =       ;      Library General Public License for more
00020 ++=   -.     .`     .:       details.
00021  :     =  ...= . :.=-
00022  -.   .:....=;==+<;          You should have received a copy of the GNU
00023   -_. . .   )=.  =           Library General Public License along with
00024     --        :-=`           this library; see the file COPYING.LIB.
00025                              If not, write to the Free Software Foundation,
00026                              Inc., 59 Temple Place - Suite 330,
00027                              Boston, MA 02111-1307, USA.
00028 */
00029 #include "opimxref.h"
00030 
00031 namespace Opie {
00032 
00033 OPimXRef::OPimXRef( const OPimXRefPartner& one, const OPimXRefPartner& two )
00034     : m_partners(2)
00035 {
00036     m_partners[0] = one;
00037     m_partners[1] = two;
00038 }
00039 OPimXRef::OPimXRef():m_partners(2)
00040 {
00041 
00042 }
00043 
00044 OPimXRef::OPimXRef( const OPimXRef& ref) {
00045     *this = ref;
00046 }
00047 
00048 OPimXRef::~OPimXRef() {
00049 }
00050 
00051 OPimXRef &OPimXRef::operator=( const OPimXRef& ref) {
00052     m_partners = ref.m_partners;
00053     m_partners.detach();
00054 
00055     return *this;
00056 }
00057 
00058 bool OPimXRef::operator==( const OPimXRef& oper ) {
00059     if ( m_partners == oper.m_partners ) return true;
00060 
00061     return false;
00062 }
00063 OPimXRefPartner OPimXRef::partner( enum Partners par) const{
00064     return m_partners[par];
00065 }
00066 
00067 void OPimXRef::setPartner( enum Partners par,  const OPimXRefPartner& part) {
00068     m_partners[par] = part;
00069 }
00070 
00071 bool OPimXRef::containsString( const QString& string ) const{
00072     if ( m_partners[One].service() == string ||
00073          m_partners[Two].service() == string ) return true;
00074 
00075     return false;
00076 }
00077 
00078 bool OPimXRef::containsUid( int uid ) const{
00079     if ( m_partners[One].uid() == uid ||
00080          m_partners[Two].uid() == uid ) return true;
00081 
00082     return false;
00083 }
00084 
00085 }

Generated on Sat Nov 5 16:16:22 2005 for OPIE by  doxygen 1.4.2