Skip to content
Snippets Groups Projects
Commit 3bd1cb01 authored by Emmanuel Lepage's avatar Emmanuel Lepage
Browse files

[#7121] Polishing library (over). Indentation, spacing and naming are now consistent

parent 3a2a4e94
Branches
Tags
No related merge requests found
Showing with 992 additions and 825 deletions
......@@ -100,7 +100,7 @@ QString SFLPhoneEngine::getCallStateName(call_state state)
void SFLPhoneEngine::updateHistory()
{
foreach (Call* oldCall, historyCalls) {
foreach (Call* oldCall, getHistory()) {
historyCall[oldCall->getCallId()]["Name"] = oldCall->getPeerName();
historyCall[oldCall->getCallId()]["Number"] = oldCall->getPeerPhoneNumber();
historyCall[oldCall->getCallId()]["Date"] = oldCall->getStopTimeStamp();
......
......@@ -78,8 +78,8 @@ AccountView* AccountView::buildExistingAccountFromId(QString _accountId)
//Account* a = Account::buildExistingAccountFromId( _accountId);
ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
AccountView* a = new AccountView();
a->accountId = new QString(_accountId);
a->accountDetails = new MapStringString( configurationManager.getAccountDetails(_accountId).value() );
a->m_pAccountId = new QString(_accountId);
a->m_pAccountDetails = new MapStringString( configurationManager.getAccountDetails(_accountId).value() );
a->initItem();
return a;
}
......@@ -88,7 +88,7 @@ AccountView* AccountView::buildNewAccountFromAlias(QString alias)
{
//Account* a = Account::buildNewAccountFromAlias(alias);
AccountView* a = new AccountView();
a->accountDetails = new MapStringString();
a->m_pAccountDetails = new MapStringString();
a->setAccountDetail(ACCOUNT_ALIAS,alias);
a->initItem();
return a;
......
......@@ -510,7 +510,7 @@ void CallView::conferenceRemoved(const QString &confId)
///Clear the list of old calls //TODO Clear them from the daemon
void CallView::clearHistory()
{
historyCalls.clear();
m_pHistoryCalls.clear();
}
void CallView::conferenceCreatedSignal(const QString& confId)
......
......@@ -27,7 +27,7 @@
#include "sflphone_const.h"
#include "configurationmanager_interface_singleton.h"
///Match state name to user readable string
const QString account_state_name(QString & s)
{
if(s == QString(ACCOUNT_STATE_REGISTERED) )
......@@ -51,131 +51,158 @@ const QString account_state_name(QString & s)
return "Invalid" ;
}
//Constructors
Account::Account():accountId(NULL),accountDetails(NULL)
///Constructors
Account::Account():m_pAccountId(NULL),m_pAccountDetails(NULL)
{
}
#include <unistd.h>
///Build an account from it'id
Account* Account::buildExistingAccountFromId(QString _accountId)
{
qDebug() << "Building an account from id: " << _accountId;
ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
Account* a = new Account();
a->accountId = new QString(_accountId);
a->m_pAccountId = new QString(_accountId);
MapStringString* aDetails = new MapStringString(configurationManager.getAccountDetails(_accountId).value());
//MapStringString* accountDetails = &configurationManager.getAccountDetails(_accountId).value(); //SegFault???
if (!aDetails->count()) {
qDebug() << "Account not found";
return NULL;
}
a->accountDetails = aDetails;
a->m_pAccountDetails = aDetails;
return a;
}
///Build an account from it's name / alias
Account* Account::buildNewAccountFromAlias(QString alias)
{
qDebug() << "Building an account from alias: " << alias;
Account* a = new Account();
a->accountDetails = new MapStringString();
a->m_pAccountDetails = new MapStringString();
a->setAccountDetail(ACCOUNT_ALIAS,alias);
return a;
}
///Destructor
Account::~Account()
{
delete accountId;
//delete accountDetails;
//delete item;
delete m_pAccountId;
}
//Getters
/*****************************************************************************
* *
* Getters *
* *
****************************************************************************/
///IS this account new
bool Account::isNew() const
{
return (accountId == NULL);
return (m_pAccountId == NULL);
}
///Get this account ID
const QString & Account::getAccountId() const
{
if (isNew())
qDebug() << "Error : getting AccountId of a new account.";
if (!accountId) {
if (!m_pAccountId) {
qDebug() << "Account not configured";
return ""; //WARNING May explode
}
return *accountId;
return *m_pAccountId;
}
///Get this account details
MapStringString& Account::getAccountDetails() const
{
return *accountDetails;
return *m_pAccountDetails;
}
///Get current state
QString Account::getStateName(QString & state)
{
return account_state_name(state);
}
///Get an account detail
QString Account::getAccountDetail(QString param) const
{
if (!accountDetails) {
if (!m_pAccountDetails) {
qDebug() << "The account list is not set";
return NULL; //May crash, but better than crashing now
}
if (accountDetails->find(param) != accountDetails->end())
return (*accountDetails)[param];
if (m_pAccountDetails->find(param) != m_pAccountDetails->end())
return (*m_pAccountDetails)[param];
else {
qDebug() << "Account details not found, there is " << accountDetails->count() << " details available";
qDebug() << "Account details not found, there is " << m_pAccountDetails->count() << " details available";
return NULL;
}
}
///Get the alias
QString Account::getAlias() const
{
return getAccountDetail(ACCOUNT_ALIAS);
}
///Is this account enabled
bool Account::isEnabled() const
{
qDebug() << "isEnabled = " << getAccountDetail(ACCOUNT_ENABLED);
return (getAccountDetail(ACCOUNT_ENABLED) == ACCOUNT_ENABLED_TRUE);
}
///Is this account registered
bool Account::isRegistered() const
{
qDebug() << "isRegistered = " << getAccountDetail(ACCOUNT_STATUS);
return (getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED);
}
//Setters
/*****************************************************************************
* *
* Setters *
* *
****************************************************************************/
///Set account details
void Account::setAccountDetails(MapStringString m)
{
*accountDetails = m;
*m_pAccountDetails = m;
}
///Set a specific detail
void Account::setAccountDetail(QString param, QString val)
{
(*accountDetails)[param] = val;
(*m_pAccountDetails)[param] = val;
}
///Set the account id
void Account::setAccountId(QString id)
{
qDebug() << "accountId = " << accountId;
qDebug() << "accountId = " << m_pAccountId;
if (! isNew())
qDebug() << "Error : setting AccountId of an existing account.";
accountId = new QString(id);
m_pAccountId = new QString(id);
}
///Set account enabled
void Account::setEnabled(bool checked)
{
setAccountDetail(ACCOUNT_ENABLED, checked ? ACCOUNT_ENABLED_TRUE : ACCOUNT_ENABLED_FALSE);
}
bool Account::isEnabled() const
{
qDebug() << "isEnabled = " << getAccountDetail(ACCOUNT_ENABLED);
return (getAccountDetail(ACCOUNT_ENABLED) == ACCOUNT_ENABLED_TRUE);
}
bool Account::isRegistered() const
{
qDebug() << "isRegistered = " << getAccountDetail(ACCOUNT_STATUS);
return (getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED);
}
/*****************************************************************************
* *
* Mutator *
* *
****************************************************************************/
///Update the account
void Account::updateState()
{
qDebug() << "updateState";
......@@ -187,10 +214,16 @@ void Account::updateState()
}
}
//Operators
/*****************************************************************************
* *
* Operator *
* *
****************************************************************************/
///Are both account the same
bool Account::operator==(const Account& a)const
{
return *accountId == *a.accountId;
return *m_pAccountId == *a.m_pAccountId;
}
......@@ -61,8 +61,8 @@ class LIB_EXPORT Account : public QObject {
protected:
Account();
QString * accountId;
MapStringString* accountDetails;
QString* m_pAccountId;
MapStringString* m_pAccountDetails;
public slots:
void setEnabled(bool checked);
......
......@@ -17,7 +17,7 @@
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
**************************************************************************/
#include "AccountList.h"
#include "sflphone_const.h"
......@@ -25,54 +25,93 @@
//Constructors
///Constructors
AccountList::AccountList(QStringList & _accountIds)
{
// firstAccount = QString();
accounts = new QVector<Account*>();
m_pAccounts = new QVector<Account*>();
for (int i = 0; i < _accountIds.size(); ++i) {
(*accounts) += Account::buildExistingAccountFromId(_accountIds[i]);
(*m_pAccounts) += Account::buildExistingAccountFromId(_accountIds[i]);
}
}
///Constructors
AccountList::AccountList(bool fill)
{
accounts = new QVector<Account *>();
m_pAccounts = new QVector<Account *>();
if(fill)
updateAccounts();
}
///Destructor
AccountList::~AccountList()
{
delete m_pAccounts;
}
/*****************************************************************************
* *
* Mutator *
* *
****************************************************************************/
///Update accounts
void AccountList::update()
{
ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
Account * current;
for (int i = 0; i < accounts->size(); i++) {
current = (*accounts)[i];
if (!(*accounts)[i]->isNew())
for (int i = 0; i < m_pAccounts->size(); i++) {
current = (*m_pAccounts)[i];
if (!(*m_pAccounts)[i]->isNew())
removeAccount(current);
}
//ask for the list of accounts ids to the configurationManager
QStringList accountIds = configurationManager.getAccountList().value();
for (int i = 0; i < accountIds.size(); ++i) {
accounts->insert(i, Account::buildExistingAccountFromId(accountIds[i]));
m_pAccounts->insert(i, Account::buildExistingAccountFromId(accountIds[i]));
}
}
///Update accounts
void AccountList::updateAccounts()
{
qDebug() << "updateAccounts";
ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
QStringList accountIds = configurationManager.getAccountList().value();
accounts->clear();
m_pAccounts->clear();
for (int i = 0; i < accountIds.size(); ++i) {
qDebug() << "updateAccounts " << accountIds[i];
(*accounts) += Account::buildExistingAccountFromId(accountIds[i]);
(*m_pAccounts) += Account::buildExistingAccountFromId(accountIds[i]);
}
emit accountListUpdated();
}
/*****************************************************************************
* *
* Getters *
* *
****************************************************************************/
///Get all accounts
QVector<Account*> & AccountList::getAccounts()
{
return *m_pAccounts;
}
///Get a single account
const Account* AccountList::getAccountAt (int i) const
{
return (*m_pAccounts)[i];
}
///Get a single account
Account* AccountList::getAccountAt (int i)
{
return (*m_pAccounts)[i];
}
///Get a serialized string of all accounts
QString AccountList::getOrderedList() const
{
QString order;
......@@ -82,13 +121,37 @@ QString AccountList::getOrderedList() const
return order;
}
///Get account using its ID
Account* AccountList::getAccountById(const QString & id) const
{
if(id.isEmpty())
return NULL;
for (int i = 0; i < m_pAccounts->size(); ++i) {
if (!(*m_pAccounts)[i]->isNew() && (*m_pAccounts)[i]->getAccountId() == id)
return (*m_pAccounts)[i];
}
return NULL;
}
///Get account with a specific state
QVector<Account*> AccountList::getAccountsByState(QString & state)
{
QVector<Account *> v;
for (int i = 0; i < m_pAccounts->size(); ++i) {
if ((*m_pAccounts)[i]->getAccountDetail(ACCOUNT_STATUS) == state)
v += (*m_pAccounts)[i];
}
return v;
}
///Get a list of all registerred account
QVector<Account*> AccountList::registeredAccounts() const
{
qDebug() << "registeredAccounts";
QVector<Account*> registeredAccounts;
Account* current;
for (int i = 0; i < accounts->count(); ++i) {
current = (*accounts)[i];
for (int i = 0; i < m_pAccounts->count(); ++i) {
current = (*m_pAccounts)[i];
if(current->getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED) {
qDebug() << current->getAlias() << " : " << current;
registeredAccounts.append(current);
......@@ -97,11 +160,12 @@ QVector<Account*> AccountList::registeredAccounts() const
return registeredAccounts;
}
///Get the first registerred account (default account)
Account* AccountList::firstRegisteredAccount() const
{
Account* current;
for (int i = 0; i < accounts->count(); ++i) {
current = (*accounts)[i];
for (int i = 0; i < m_pAccounts->count(); ++i) {
current = (*m_pAccounts)[i];
if(current->getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED) {
return current;
}
......@@ -112,73 +176,46 @@ Account* AccountList::firstRegisteredAccount() const
return NULL;
}
AccountList::~AccountList()
{
delete accounts;
}
//Getters
QVector<Account*> & AccountList::getAccounts()
{
return *accounts;
}
const Account* AccountList::getAccountAt (int i) const
{
return (*accounts)[i];
}
Account* AccountList::getAccountAt (int i)
{
return (*accounts)[i];
}
Account* AccountList::getAccountById(const QString & id) const
{
if(id.isEmpty())
return NULL;
for (int i = 0; i < accounts->size(); ++i) {
if (!(*accounts)[i]->isNew() && (*accounts)[i]->getAccountId() == id)
return (*accounts)[i];
}
return NULL;
}
QVector<Account*> AccountList::getAccountsByState(QString & state)
{
QVector<Account *> v;
for (int i = 0; i < accounts->size(); ++i) {
if ((*accounts)[i]->getAccountDetail(ACCOUNT_STATUS) == state)
v += (*accounts)[i];
}
return v;
}
///Get the account size
int AccountList::size() const
{
return accounts->size();
return m_pAccounts->size();
}
//Setters
/*****************************************************************************
* *
* Setters *
* *
****************************************************************************/
///Add an account
Account* AccountList::addAccount(QString & alias)
{
Account* a = Account::buildNewAccountFromAlias(alias);
(*accounts) += a;
(*m_pAccounts) += a;
return a;
}
///Remove an account
void AccountList::removeAccount(Account* account)
{
accounts->remove(accounts->indexOf(account));
m_pAccounts->remove(m_pAccounts->indexOf(account));
}
/*****************************************************************************
* *
* Operator *
* *
****************************************************************************/
///Get the accoutn from its index
const Account* AccountList::operator[] (int i) const
{
return (*accounts)[i];
return (*m_pAccounts)[i];
}
///Get the accoutn from its index
Account* AccountList::operator[] (int i)
{
return (*accounts)[i];
return (*m_pAccounts)[i];
}
......@@ -34,7 +34,7 @@ class LIB_EXPORT AccountList : public QObject{
private:
QVector<Account*>* accounts;
QVector<Account*>* m_pAccounts;
public:
......
This diff is collapsed.
......@@ -117,14 +117,14 @@ private:
//Call attributes
QString account;
QString callId;
QString confId;
QString peerPhoneNumber;
QString peerName;
history_state historyState;
QDateTime * startTime;
QDateTime * stopTime;
QString m_pAccount;
QString m_pCallId;
QString m_pConfId;
QString m_pPeerPhoneNumber;
QString m_pPeerName;
history_state m_pHistoryState;
QDateTime* m_pStartTime;
QDateTime* m_pStopTime;
/*
QWidget * historyItemWidget;
......@@ -204,16 +204,16 @@ private:
void warning ();
public:
Call(QString confId, QString account);
//Constructors & Destructors
Call(QString confId, QString account);
~Call();
// void initCallItemWidget();
static Call* buildDialingCall (QString callId, const QString & peerName, QString account = "" );
static Call* buildIncomingCall (const QString & callId );
static Call* buildRingingCall (const QString & callId );
static Call* buildHistoryCall (const QString & callId, uint startTimeStamp, uint stopTimeStamp, QString account, QString name, QString number, QString type );
static Call* buildExistingCall (QString callId );
//Static getters
static history_state getHistoryStateFromType ( QString type );
static QString getTypeFromHistoryState ( history_state historyState );
static call_state getStartStateFromDaemonCallState ( QString daemonCallState, QString daemonCallType );
......@@ -231,34 +231,28 @@ public:
bool isHistory () const;
QString getStopTimeStamp () const;
QString getStartTimeStamp () const;
QString getCurrentCodecName();
bool isSecure();
QString getCurrentCodecName () const;
bool isSecure () const;
bool isConference () const;
void setConference(bool value);
QString getConfId () const;
void setConfId(QString value);
QString getTransferNumber () const;
void setTransferNumber(QString number);
QString getCallNumber () const;
void setCallNumber(QString number);
//Automate calls
//Automated function
call_state stateChanged(const QString & newState);
call_state actionPerformed(call_action action);
//Setters
// void appendItemText(QString text);
void setConference(bool value);
void setConfId(QString value);
void setTransferNumber(QString number);
void setCallNumber(QString number);
//Mutotors
void appendText(QString str);
void backspaceItemText();
// void setItemIcon(const QString pixmap);
// void setPeerName(const QString peerName);
void changeCurrentState(call_state newState);
signals:
void changed();
void isOver(Call*);
......
......@@ -16,6 +16,6 @@
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
**************************************************************************/
#include <CallModel.h>
......@@ -37,12 +37,13 @@
#include "unistd.h"
#include "typedefs.h"
/** Note from the author: It was previously done by a QAbstractModel + QTreeView, but the sip-call use case is incompatible
* with the MVC model. The MVC never got to a point were it was bug-free and the code was getting dirty. The QTreeWidget
typedef QHash<QString, Call*> CallHash;
typedef QList<Call*> CallList;
/**
* Note from the author: It was previously done by a QAbstractModel + QTreeView, but the sip-call use case is incompatible
* with the MVC model. The MVC never got to a point were it was bug-free and the code was getting dirty. The Mirror model
* solution may be less "clean" than MVC, but is 3 time smaller and easier to improve (in fact, possible to improve).
*
* @note This model intend to be reimplemented by the view, not used alone
* @note Most of the member are static to preserve ressources and QObject::connect()
*/
template <typename CallWidget, typename Index>
class LIB_EXPORT CallModel {
......@@ -54,66 +55,65 @@ class LIB_EXPORT CallModel {
Address
};
//Constructors, initializer and destructors
CallModel ( ModelType type );
virtual ~CallModel ( ) {}
virtual bool initCall ( );
virtual bool initHistory ( );
//Call related
virtual Call* addCall ( Call* call , Call* parent =0 );
int size();
Call* findCallByCallId(QString callId);
QList<Call*> getCallList();
Call* addDialingCall ( const QString& peerName="", QString account="" );
Call* addIncomingCall ( const QString& callId );
Call* addRingingCall ( const QString& callId );
static QString generateCallId ( );
void removeCall ( Call* call );
virtual bool selectItem(Call* item) { Q_UNUSED(item); return false;}
//Comference related
bool createConferenceFromCall ( Call* call1, Call* call2 );
bool mergeConferences ( Call* conf1, Call* conf2 );
bool addParticipant ( Call* call2, Call* conference );
bool detachParticipant ( Call* call );
virtual Call* addConference(const QString &confID);
virtual bool conferenceChanged ( const QString &confId, const QString &state );
virtual void conferenceRemoved ( const QString &confId );
virtual bool selectItem(Call* item) { Q_UNUSED(item); return false;}
static QString generateCallId();
virtual Call* addConference ( const QString &confID );
void removeConference ( Call* call );
void removeCall(Call* call);
const QHash<QString, Call*> getHistory();
QStringList getHistoryCallId();
//Getters
int size ();
CallList getCallList ();
static const CallHash& getHistory ();
static const QStringList getHistoryCallId ();
//Account related members
//Account related
static Account* getCurrentAccount ( );
static QString getCurrentAccountId ( );
static AccountList* getAccountList ( );
static QString getPriorAccoundId ( );
static void setPriorAccountId ( QString value );
//Connection related members
//Connection related
static bool init();
//Magic dispatcher
Call* getCall(const CallWidget widget) const;
Index getTreeItem(const CallWidget widget) const;
QList<Call*> getCalls(const CallWidget widget) const;
QList<Call*> getCalls();
bool isConference(const CallWidget widget) const;
Call* findCallByCallId( QString callId );
CallList getCalls ( );
CallList getCalls ( const CallWidget widget) const;
CallList getCalls ( const QString callId ) const;
CallList getCalls ( const Call* call ) const;
CallList getCalls ( const Index idx ) const;
Call* getCall(const Call* call) const;
Index getTreeItem(const Call* call) const;
QList<Call*> getCalls(const Call* call) const;
bool isConference ( const Call* call ) const;
Call* getCall(const Index idx) const;
Index getTreeItem(const Index idx) const;
QList<Call*> getCalls(const Index idx) const;
bool isConference ( const QString callId ) const;
bool isConference ( const Index idx ) const;
bool isConference ( const CallWidget widget) const;
Call* getCall ( const QString callId ) const;
Index getTreeItem(const QString callId) const;
QList<Call*> getCalls(const QString callId) const;
bool isConference(const QString callId) const;
Call* getCall ( const Index idx ) const;
Call* getCall ( const Call* call ) const;
Call* getCall ( const CallWidget widget) const;
Index getIndex ( const Call* call ) const;
Index getIndex ( const Index idx ) const;
......@@ -130,34 +130,35 @@ class LIB_EXPORT CallModel {
protected:
struct InternalCallModelStruct {
struct InternalStruct;
typedef QList<InternalStruct*> InternalCallList;
struct InternalStruct {
CallWidget call ;
Call* call_real ;
Index treeItem; //For the view
QList<InternalCallModelStruct*> children; //For the view
Index index ;
InternalCallList children ;
bool conference ;
};
typedef QHash<Call*, InternalCallModelStruct*> InternalCall;
typedef QHash<QString, InternalCallModelStruct*> InternalCallId;
typedef QHash<CallWidget, InternalCallModelStruct*> InternalWidget;
typedef QHash<Index, InternalCallModelStruct*> InternalIndex;
typedef QHash< Call* , InternalStruct* > InternalCall ;
typedef QHash< QString , InternalStruct* > InternalCallId;
typedef QHash< CallWidget , InternalStruct* > InternalWidget;
typedef QHash< Index , InternalStruct* > InternalIndex ;
static QHash<QString, Call*> activeCalls;
static QHash<QString, Call*> historyCalls;
static CallHash m_pActiveCalls ;
static CallHash m_pHistoryCalls;
static InternalCall privateCallList_call;
static InternalCallId privateCallList_callId;
static InternalWidget privateCallList_widget;
static InternalIndex privateCallList_index;
static InternalCall m_pPrivateCallList_call ;
static InternalCallId m_pPrivateCallList_callId;
static InternalWidget m_pPrivateCallList_widget;
static InternalIndex m_pPrivateCallList_index ;
static QString currentAccountId;
static QString priorAccountId;
static AccountList* accountList;
static bool callInit;
static bool historyInit;
static QString m_pPriorAccountId;
static AccountList* m_pAccountList ;
static bool m_pCallInit ;
static bool m_pHistoryInit ;
private:
static bool instanceInit;
static bool m_pInstanceInit;
//public slots:
//void clearHistory();
};
......
This diff is collapsed.
......@@ -24,119 +24,139 @@
#include "sflphone_const.h"
///Constructor
Contact::Contact():m_pPhoto(0)
{
initItem();
}
///Destructor
Contact::~Contact()
{
delete m_pPhoto;
}
///May be used in extended classes
void Contact::initItem()
{
initItemWidget();
}
///May be used in extended classes
void Contact::initItemWidget()
{
}
///Get the phone number list
PhoneNumbers Contact::getPhoneNumbers() const
{
return m_pNumbers;
}
///Get the nickname
QString Contact::getNickName() const
{
return m_pNickName;
}
///Get the firstname
QString Contact::getFirstName() const
{
return m_pFirstName;
}
///Get the second/family name
QString Contact::getSecondName() const
{
return m_pSecondName;
}
///Get the photo
const QPixmap* Contact::getPhoto() const
{
return m_pPhoto;
}
///Get the formatted name
QString Contact::getFormattedName() const
{
return m_pFormattedName;
}
///Get the organisation
QString Contact::getOrganization() const
{
return m_pOrganization;
}
///Get the preferred email
QString Contact::getPreferredEmail() const
{
return m_pPreferredEmail;
}
///Get the unique identifier (used for drag and drop)
QString Contact::getUid() const
{
return m_pUid;
}
///Get the contact type
QString Contact::getType() const
{
return m_pType;
}
///Set the phone number (type and number)
void Contact::setPhoneNumbers(PhoneNumbers numbers)
{
m_pNumbers = numbers;
}
///Set the nickname
void Contact::setNickName(QString name)
{
m_pNickName = name;
}
///Set the first name
void Contact::setFirstName(QString name)
{
m_pFirstName = name;
}
///Set the family name
void Contact::setFamilyName(QString name)
{
m_pSecondName = name;
}
///Set the Photo/Avatar
void Contact::setPhoto(QPixmap* photo)
{
m_pPhoto = photo;
}
///Set the formatted name (display name)
void Contact::setFormattedName(QString name)
{
m_pFormattedName = name;
}
///Set the organisation / business
void Contact::setOrganization(QString name)
{
m_pOrganization = name;
}
///Set the default email
void Contact::setPreferredEmail(QString name)
{
m_pPreferredEmail = name;
}
///Set UID
void Contact::setUid(QString id)
{
m_pUid = id;
......
......@@ -17,7 +17,7 @@
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
**************************************************************************/
#ifndef CONTACT_H
#define CONTACT_H
......
......@@ -16,7 +16,7 @@
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
**************************************************************************/
#include "callmanager_interface_singleton.h"
......
/***************************************************************************
* Copyright (C) 2009-2010 by Savoir-Faire Linux *
* Author : Jérémy Quentin *
* jeremy.quentin@savoirfairelinux.com *
* Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -17,7 +16,7 @@
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
**************************************************************************/
#ifndef CALL_MANAGER_INTERFACE_SINGLETON_H
#define CALL_MANAGER_INTERFACE_SINGLETON_H
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment