diff -r dcf0eedfc1a3 -r d189ee25cf9d emailservices/nmailbase/src/nmmailbox.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/nmailbase/src/nmmailbox.cpp Tue Aug 31 15:04:17 2010 +0300 @@ -0,0 +1,163 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "emailtrace.h" + +#include + +#include "nmmailbox.h" + +NmMailboxPrivate::NmMailboxPrivate() +{ + NM_FUNCTION; +} + +NmMailboxPrivate::~NmMailboxPrivate() +{ + NM_FUNCTION; +} + +/*! + \class NmMailbox + \brief Data model for mailbox spesific data + */ + +/*! + Constructs NmMailbox object with empty data + */ +NmMailbox::NmMailbox() +{ + NM_FUNCTION; + + d = new NmMailboxPrivate(); +} + +/*! + Copy constructor + */ +NmMailbox::NmMailbox(const NmMailbox &mailbox) +{ + NM_FUNCTION; + + d = mailbox.d; +} + +/*! + Constructs NmMailbox object from \a mailbox data + */ +NmMailbox::NmMailbox(QExplicitlySharedDataPointer mailboxprivate) +{ + NM_FUNCTION; + + d = mailboxprivate; +} + +/*! + Assign data from \a mailbox + */ +NmMailbox &NmMailbox::operator=(const NmMailbox &mailbox) +{ + NM_FUNCTION; + + if (this != &mailbox) { + d = mailbox.d; + } + return *this; +} + +/*! + Destructor + */ +NmMailbox::~NmMailbox() +{ + NM_FUNCTION; +} + +/*! + Returns mailbox id + */ +NmId NmMailbox::id() const +{ + NM_FUNCTION; + + return d->mId; +} + +/*! + Sets mailbox id from \a id + */ +void NmMailbox::setId(const NmId& id) +{ + NM_FUNCTION; + + d->mId = id; +} + +/*! + Returns mailbox name string + */ +QString NmMailbox::name() const +{ + NM_FUNCTION; + + return d->mName; +} + +/*! + Sets mailbox name from \a name + */ +void NmMailbox::setName(const QString &name) +{ + NM_FUNCTION; + + d->mName = name; +} + +/*! + Equal operator returns true if both NmMailbox objects have same name and id + */ +bool NmMailbox::operator==(const NmMailbox &mailbox) const +{ + NM_FUNCTION; + + bool ret = true; + + if (this->name().compare(mailbox.name()) != 0) { + ret = false; + } + if (this->id() != mailbox.id()) { + ret = false; + } + return ret; +} + + +NmAddress NmMailbox::address() const +{ + NM_FUNCTION; + + return d->mAddress; +} + + +void NmMailbox::setAddress(const NmAddress& address) +{ + NM_FUNCTION; + + d->mAddress = address; +} +