diff --git a/kde/src/CallView.cpp b/kde/src/CallView.cpp index d43e6792ade779f1d5ec8b02b68695231ccef1c8..924e3a8ee9a4df095274a6c262009a2913504d8d 100644 --- a/kde/src/CallView.cpp +++ b/kde/src/CallView.cpp @@ -752,6 +752,7 @@ CallViewOverlay::CallViewOverlay(QWidget* parent) : QWidget(parent),m_pIcon(0),m m_black.setAlpha(75); } +///Destructor CallViewOverlay::~CallViewOverlay() { diff --git a/kde/src/SFLPhoneView.cpp b/kde/src/SFLPhoneView.cpp index 964497ce38838384c449251a0575501033697682..ab98de450ea285652561af04a65c351c553cefc1 100755 --- a/kde/src/SFLPhoneView.cpp +++ b/kde/src/SFLPhoneView.cpp @@ -566,7 +566,6 @@ void SFLPhoneView::updateStatusMessage() ****************************************************************************/ ///Proxy to hide or show the volume control -///@TODO is it still needed? <elepage 2011> void SFLPhoneView::displayVolumeControls(bool checked) { //ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); @@ -575,13 +574,13 @@ void SFLPhoneView::displayVolumeControls(bool checked) } ///Proxy to hide or show the dialpad -///@TODO is it still needed? <elepage 2011> void SFLPhoneView::displayDialpad(bool checked) { ConfigurationSkeleton::setDisplayDialpad(checked); updateDialpad(); } +///Display a notification popup (freedesktop notification) void SFLPhoneView::displayMessageBox(bool checked) { ConfigurationSkeleton::setDisplayMessageBox(checked); diff --git a/kde/src/conf/ConfigAccountList.cpp b/kde/src/conf/ConfigAccountList.cpp index ff4e6d47c9e2a31dd0df20f2711905f1de433db8..650f983466c4d649754fdef68d255a445051d3e6 100644 --- a/kde/src/conf/ConfigAccountList.cpp +++ b/kde/src/conf/ConfigAccountList.cpp @@ -26,6 +26,7 @@ #include "lib/sflphone_const.h" #include "lib/configurationmanager_interface_singleton.h" +///Constructor ConfigAccountList::ConfigAccountList(QStringList &_accountIds) : QObject() { accounts = new QVector<AccountView*>(); @@ -34,6 +35,8 @@ ConfigAccountList::ConfigAccountList(QStringList &_accountIds) : QObject() } } +///Constructor +///@param fill Keep the list empty (false), load all account (true) ConfigAccountList::ConfigAccountList(bool fill) : QObject() { accounts = new QVector<AccountView*>(); @@ -41,6 +44,7 @@ ConfigAccountList::ConfigAccountList(bool fill) : QObject() updateAccounts(); } +///Destructor ConfigAccountList::~ConfigAccountList() { foreach(Account* a, *accounts) { @@ -49,7 +53,8 @@ ConfigAccountList::~ConfigAccountList() delete accounts; } -AccountView* ConfigAccountList::getAccountByItem(QListWidgetItem * item) +///Get an account using a widget +AccountView* ConfigAccountList::getAccountByItem(QListWidgetItem* item) { for (int i = 0; i < accounts->size(); ++i) { if ((*accounts)[i]->getItem() == item) @@ -58,6 +63,7 @@ AccountView* ConfigAccountList::getAccountByItem(QListWidgetItem * item) return NULL; } +///Add an account AccountView* ConfigAccountList::addAccount(const QString& alias) { AccountView* a = AccountView::buildNewAccountFromAlias(alias); @@ -65,6 +71,7 @@ AccountView* ConfigAccountList::addAccount(const QString& alias) return a; } +///Remove an account void ConfigAccountList::removeAccount(QListWidgetItem* item) { if(!item) { @@ -81,6 +88,7 @@ void ConfigAccountList::removeAccount(QListWidgetItem* item) accounts->remove(accounts->indexOf(a)); } +///Operator overload to access an account using its position in the list AccountView* ConfigAccountList::operator[] (int i) { if (i < accounts->size()) @@ -89,13 +97,13 @@ AccountView* ConfigAccountList::operator[] (int i) return 0; } +///Remove an account void ConfigAccountList::removeAccount(AccountView* account) { accounts->remove(accounts->indexOf(account)); } - - +///Get an account by id AccountView* ConfigAccountList::getAccountById(const QString & id) const { if(id.isEmpty()) @@ -107,6 +115,7 @@ AccountView* ConfigAccountList::getAccountById(const QString & id) const return NULL; } +///Get an account according to its state QVector<AccountView*> ConfigAccountList::getAccountByState(QString & state) { QVector<AccountView*> v; @@ -117,22 +126,25 @@ QVector<AccountView*> ConfigAccountList::getAccountByState(QString & state) return v; } - +///Return the list of all loaded accounts QVector<AccountView*>& ConfigAccountList::getAccounts() { return *accounts; } +///Get account at index 'i' const AccountView* ConfigAccountList::getAccountAt(int i) const { return (*accounts)[i]; } +///Get account at index 'i' AccountView* ConfigAccountList::getAccountAt (int i) { return (*accounts)[i]; } +///Update the list void ConfigAccountList::update() { ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); @@ -149,6 +161,7 @@ void ConfigAccountList::update() } } +///Reload accounts void ConfigAccountList::updateAccounts() { kDebug() << "updateAccounts"; @@ -161,6 +174,7 @@ void ConfigAccountList::updateAccounts() emit accountListUpdated(); } +///Move account up void ConfigAccountList::upAccount(int index) { if(index <= 0 || index >= size()) { @@ -172,6 +186,7 @@ void ConfigAccountList::upAccount(int index) accounts->insert(index - 1, account); } +///Move account down void ConfigAccountList::downAccount(int index) { if(index < 0 || index >= size() - 1) { @@ -183,7 +198,7 @@ void ConfigAccountList::downAccount(int index) accounts->insert(index + 1, account); } - +///Get an account list separated by '/' QString ConfigAccountList::getOrderedList() const { QString order; @@ -193,6 +208,7 @@ QString ConfigAccountList::getOrderedList() const return order; } +///Return a list of all registered accounts QVector<AccountView*> ConfigAccountList::registeredAccounts() const { QVector<AccountView*> registeredAccounts; @@ -207,6 +223,7 @@ QVector<AccountView*> ConfigAccountList::registeredAccounts() const return registeredAccounts; } +///Return the first registered account AccountView* ConfigAccountList::firstRegisteredAccount() const { AccountView* current; @@ -220,6 +237,7 @@ AccountView* ConfigAccountList::firstRegisteredAccount() const return NULL; } +///Return the number (count) of accounts int ConfigAccountList::size() const { return accounts->size(); diff --git a/kde/src/conf/dlgaccounts.cpp b/kde/src/conf/dlgaccounts.cpp index 3663af47736dc810b673126e3d16f17f9bdd6038..78cef06507bd33291b23fe1cbc1a96df082b652b 100755 --- a/kde/src/conf/dlgaccounts.cpp +++ b/kde/src/conf/dlgaccounts.cpp @@ -76,6 +76,7 @@ void Private_AddCodecDialog::emitNewCodec() { emit addCodec(codecTable->item(codecTable->currentRow(),3)->text()); } +///Constructor DlgAccounts::DlgAccounts(KConfigDialog* parent) : QWidget(parent),accountList(NULL) { @@ -153,13 +154,14 @@ DlgAccounts::DlgAccounts(KConfigDialog* parent) connect(radioButton_pa_custom, SIGNAL(clicked(bool)) , this , SLOT(enablePublished())); } //DlgAccounts +///Destructor DlgAccounts::~DlgAccounts() { accountList->disconnect(); if (accountList) delete accountList; } - +///Save the account list, necessary for new and removed accounts void DlgAccounts::saveAccountList() { ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); @@ -221,7 +223,7 @@ void DlgAccounts::disconnectAccountsChangedSignal() this, SLOT(updateAccountStates())); } - +///Save an account using the values from the widgets void DlgAccounts::saveAccount(QListWidgetItem * item) { QString protocolsTab[] = ACCOUNT_TYPES_TAB; @@ -506,6 +508,7 @@ void DlgAccounts::loadAccount(QListWidgetItem * item) frame2_editAccounts->setEnabled(true); } //loadAccount +///Load an account void DlgAccounts::loadAccountList() { accountList->updateAccounts(); @@ -519,6 +522,7 @@ void DlgAccounts::loadAccountList() frame2_editAccounts->setEnabled(false); } +///Add an account to the list void DlgAccounts::addAccountToAccountList(AccountView* account) { QListWidgetItem * item = account->getItem(); @@ -528,14 +532,14 @@ void DlgAccounts::addAccountToAccountList(AccountView* account) listWidget_accountList->setItemWidget(item, widget); } +///Called when one of the child widget is modified void DlgAccounts::changedAccountList() { accountListHasChanged = true; emit updateButtons(); } - - +///Callback when the account change void DlgAccounts::accountListChanged( QListWidgetItem * current, QListWidgetItem * previous ) { kDebug() << "on_listWidget_accountList_currentItemChanged"; @@ -663,13 +667,13 @@ void DlgAccounts::updateStatusLabel(AccountView* account) edit7_state->setText( "<FONT COLOR=\"" + account->getStateColorName() + "\">" + status + "</FONT>" ); } +///Have the account changed bool DlgAccounts::hasChanged() { - bool res = accountListHasChanged; - return res; + return accountListHasChanged; } - +///Save settings void DlgAccounts::updateSettings() { if(accountListHasChanged) { @@ -679,6 +683,7 @@ void DlgAccounts::updateSettings() } } +///Reload void DlgAccounts::updateWidgets() { loadAccountList(); @@ -686,6 +691,7 @@ void DlgAccounts::updateWidgets() accountListHasChanged = false; } +///Get the codecs void DlgAccounts::loadCodecList() { ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); diff --git a/kde/src/conf/dlgaccounts.h b/kde/src/conf/dlgaccounts.h index 574e6d451c49d70aedeff35b8a10777f92b81fb2..c8782145fc4f3179ca16df8ead98eecfc0546bdf 100755 --- a/kde/src/conf/dlgaccounts.h +++ b/kde/src/conf/dlgaccounts.h @@ -68,6 +68,7 @@ class RingToneListItem : public QWidget { Q_OBJECT friend class DlgAccounts; + ///Constructor RingToneListItem(QString path, QString name) : QWidget(0),m_Path(path) { QHBoxLayout* l = new QHBoxLayout(this); l->setContentsMargins(0,0,0,0); @@ -82,15 +83,18 @@ class RingToneListItem : public QWidget connect(m_pPlayPB,SIGNAL(clicked()),this,SLOT(playRingtone())); } protected: + ///Show the button when the cursor is over the item virtual void enterEvent ( QEvent * event ) { Q_UNUSED(event) m_pPlayPB->setVisible(true); } + ///Hide the button when the mouse leave the button virtual void leaveEvent ( QEvent * event ) { Q_UNUSED(event) m_pPlayPB->setVisible(false); } private slots: + ///Play the ringtone file when the button is clicked void playRingtone() { CallManagerInterface& callManager = CallManagerInterfaceSingleton::getInstance(); callManager.startRecordedFilePlayback(m_Path); @@ -179,6 +183,7 @@ private slots: signals: + ///Update the Ok and Apply button style void updateButtons(); }; diff --git a/kde/src/conf/dlgaddressbook.cpp b/kde/src/conf/dlgaddressbook.cpp index cd6666a2d6327463fff74a8e7c0a62dbe784cbe3..a337eddf69e3325018740c3cfab28b115c3be3ee 100755 --- a/kde/src/conf/dlgaddressbook.cpp +++ b/kde/src/conf/dlgaddressbook.cpp @@ -22,6 +22,7 @@ #include "klib/ConfigurationSkeleton.h" +///Constructor DlgAddressBook::DlgAddressBook(QWidget *parent) : QWidget(parent) { @@ -50,16 +51,18 @@ DlgAddressBook::DlgAddressBook(QWidget *parent) } } //DlgAddressBook +///Destructor DlgAddressBook::~DlgAddressBook() { } - +///Reload the widget void DlgAddressBook::updateWidgets() { } +///Save the settings void DlgAddressBook::updateSettings() { QStringList list; diff --git a/kde/src/klib/AkonadiBackend.cpp b/kde/src/klib/AkonadiBackend.cpp index 5014f3907bf1cac6202512700743221a2d99b6ef..754333f510f393efe3e2393ea683b1a09f2c4027 100644 --- a/kde/src/klib/AkonadiBackend.cpp +++ b/kde/src/klib/AkonadiBackend.cpp @@ -278,34 +278,4 @@ void AkonadiBackend::collectionsReceived( const Akonadi::Collection::List& list ContactList AkonadiBackend::update_slot() { return m_pContacts;//update(m_Collection); -} - -/***************************************************************************** - * * - * Helpers * - * * - ****************************************************************************/ - -///Return the extension/user of an URI (<sip:12345@exemple.com>) -QString AkonadiBackend::getUserFromPhone(QString phoneNumber) -{ - if (phoneNumber.indexOf("@") != -1) { - QString user = phoneNumber.split("@")[0]; - if (user.indexOf(":") != -1) { - return user.split(":")[1]; - } - else { - return user; - } - } - return phoneNumber; -} //getUserFromPhone - -///Return the domaine of an URI (<sip:12345@exemple.com>) -QString AkonadiBackend::getHostNameFromPhone(QString phoneNumber) -{ - if (phoneNumber.indexOf("@") != -1) { - return phoneNumber.split("@")[1].left(phoneNumber.split("@")[1].size()-1); - } - return ""; } \ No newline at end of file diff --git a/kde/src/klib/AkonadiBackend.h b/kde/src/klib/AkonadiBackend.h index 1ddebe16ecf428f80202e8bc820b6b14d7e891b8..5bab4eb03f00641eca6c9e8e42e53426764e3078 100644 --- a/kde/src/klib/AkonadiBackend.h +++ b/kde/src/klib/AkonadiBackend.h @@ -61,10 +61,6 @@ public: private: AkonadiBackend(QObject* parent); - //Helper - QString getUserFromPhone(QString phoneNumber); - QString getHostNameFromPhone(QString phoneNumber); - //Attributes static AkonadiBackend* m_pInstance ; static CallModel<>* m_pModel ; diff --git a/kde/src/lib/CallModel.h b/kde/src/lib/CallModel.h index a30e8b5fa401353b5d774b3bbb72ad892f105d27..fd9a4075071085edbb8f6207190f9aca57d33f72 100644 --- a/kde/src/lib/CallModel.h +++ b/kde/src/lib/CallModel.h @@ -185,6 +185,7 @@ class LIB_EXPORT CallModel : public CallModelBase { //Struct struct InternalStruct; typedef QList<InternalStruct*> InternalCallList; + ///InternalStruct: internal representation of a call struct InternalStruct { CallWidget call ; Call* call_real ; diff --git a/kde/src/lib/Contact.h b/kde/src/lib/Contact.h index 83c119b83bd7511e51a88718931f13f6e4ff8533..ab9d67795fffc6ebf5e252328aa0184276ea121f 100644 --- a/kde/src/lib/Contact.h +++ b/kde/src/lib/Contact.h @@ -42,13 +42,17 @@ namespace KABC { class LIB_EXPORT Contact : public QObject{ Q_OBJECT public: + ///PhoneNumber: represent a phone number class PhoneNumber { public: + ///Constructor PhoneNumber(QString number, QString type) : m_Number(number),m_Type(type){} + ///return the phone number QString& getNumber() { return m_Number ; } + ///Return the phone number type QString& getType() { return m_Type ; } diff --git a/kde/src/lib/ContactBackend.cpp b/kde/src/lib/ContactBackend.cpp index 8b5fb60f46cac30eee333efa22e4a0aa7971a57f..1dbb4cda7124f343269460e8cda70f4fd6bcba55 100644 --- a/kde/src/lib/ContactBackend.cpp +++ b/kde/src/lib/ContactBackend.cpp @@ -33,6 +33,7 @@ ContactBackend::ContactBackend(QObject* parent) : QObject(parent) } +///Destructor ContactBackend::~ContactBackend() { foreach (Contact* c,m_ContactByUid) { @@ -45,3 +46,33 @@ ContactList ContactBackend::update() { return update_slot(); } + +/***************************************************************************** + * * + * Helpers * + * * + ****************************************************************************/ + +///Return the extension/user of an URI (<sip:12345@exemple.com>) +QString ContactBackend::getUserFromPhone(QString phoneNumber) +{ + if (phoneNumber.indexOf("@") != -1) { + QString user = phoneNumber.split("@")[0]; + if (user.indexOf(":") != -1) { + return user.split(":")[1]; + } + else { + return user; + } + } + return phoneNumber; +} //getUserFromPhone + +///Return the domaine of an URI (<sip:12345@exemple.com>) +QString ContactBackend::getHostNameFromPhone(QString phoneNumber) +{ + if (phoneNumber.indexOf("@") != -1) { + return phoneNumber.split("@")[1].left(phoneNumber.split("@")[1].size()-1); + } + return ""; +} \ No newline at end of file diff --git a/kde/src/lib/ContactBackend.h b/kde/src/lib/ContactBackend.h index c62c3fb9906fb37328bbb49013e050bda908cd8b..e663df9a3db0efe2a74c4e9d6dbf1af11e472d5d 100644 --- a/kde/src/lib/ContactBackend.h +++ b/kde/src/lib/ContactBackend.h @@ -41,12 +41,25 @@ class LIB_EXPORT ContactBackend : public QObject { public: ContactBackend(QObject* parent); virtual ~ContactBackend(); + + ///Get a contact using a phone number + ///@param resolveDNS interpret the number as is (false) or parse it to extract the domain and number (true) virtual Contact* getContactByPhone ( const QString& phoneNumber , bool resolveDNS = false) = 0; + + ///Return a contact (or nullptr) according to the contact unique identifier virtual Contact* getContactByUid ( const QString& uid ) = 0; + ///Edit 'contact', the implementation may be a GUI or somehting else virtual void editContact ( Contact* contact ) = 0; + ///Add a new contact to the backend virtual void addNewContact ( Contact* contact ) = 0; protected: virtual ContactList update_slot ( ) = 0; + + //Helper + QString getUserFromPhone(QString phoneNumber); + QString getHostNameFromPhone(QString phoneNumber); + + //Attributes QHash<QString,Contact*> m_ContactByPhone ; QHash<QString,Contact*> m_ContactByUid ; public slots: diff --git a/kde/src/lib/Item.h b/kde/src/lib/Item.h index 5086ddffa17afb85b513eccdbf94323a70aa7991..c4ccd7a7ab41b2749ff50495a229db8d35fdb205 100644 --- a/kde/src/lib/Item.h +++ b/kde/src/lib/Item.h @@ -61,17 +61,22 @@ public: // delete itemWidget; } + ///Return the QListWidgetItem QListWidgetItem* getItem() { return item; } + ///Return the Qwidget hosted by the QListWidgetItem WIDGET_TYPE* getItemWidget() { return itemWidget; } + ///Return the QListWidgetItem (const) const QListWidgetItem* getItem() const { return item; } + + ///Return the Qwidget hosted by the QListWidgetItem (const) const WIDGET_TYPE* getItemWidget() const { return itemWidget; } diff --git a/kde/src/widgets/ContactDock.h b/kde/src/widgets/ContactDock.h index 38f5b64f5a07ca39eb0ffb11ecf917f34322fb52..538d7a1cc1163f3cf9ae09a3235d0baacb37fa15 100644 --- a/kde/src/widgets/ContactDock.h +++ b/kde/src/widgets/ContactDock.h @@ -92,6 +92,7 @@ private slots: class ContactTree : public CategorizedTreeWidget { Q_OBJECT public: + ///Constructor ContactTree(QWidget* parent) : CategorizedTreeWidget(parent) {} virtual QMimeData* mimeData( const QList<QTreeWidgetItem *> items) const; bool dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action); diff --git a/kde/src/widgets/Dialpad.h b/kde/src/widgets/Dialpad.h index 576f341ddd4c5b701c083f62dd61285b2e2cfed4..1a819f1cdf38f370009bdbd628917fa5fc30b713 100755 --- a/kde/src/widgets/Dialpad.h +++ b/kde/src/widgets/Dialpad.h @@ -32,14 +32,17 @@ class DialpadButton : public QPushButton { Q_OBJECT public: + ///Constructor DialpadButton(QWidget* parent, const QString& value): QPushButton(parent),m_Value(value) { connect(this,SIGNAL(clicked()),this,SLOT(sltClicked())); } private slots: + ///Called on button click void sltClicked() { emit typed(m_Value); } private: QString m_Value; signals: + ///Emmited to add a number/letter to the string void typed(QString&); };