Home · All Classes · All Namespaces · Modules · Functions · Files

accounts-model-item.h

00001 /*
00002  * This file is part of TelepathyQt4Yell Models
00003  *
00004  * Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00021 #ifndef _TelepathyQt4Yell_Models_accounts_model_item_h_HEADER_GUARD_
00022 #define _TelepathyQt4Yell_Models_accounts_model_item_h_HEADER_GUARD_
00023 
00024 #ifndef IN_TELEPATHY_QT4_YELL_MODELS_HEADER
00025 #error IN_TELEPATHY_QT4_YELL_MODELS_HEADER
00026 #endif
00027 
00028 #include <TelepathyQt4Yell/Models/TreeNode>
00029 
00030 #include <TelepathyQt4/Constants>
00031 #include <TelepathyQt4/Contact>
00032 #include <TelepathyQt4/Types>
00033 
00034 namespace Tpy
00035 {
00036 
00037 class TELEPATHY_QT4_YELL_MODELS_EXPORT AccountsModelItem : public TreeNode
00038 {
00039     Q_OBJECT
00040     Q_DISABLE_COPY(AccountsModelItem)
00041 
00042 public:
00043     AccountsModelItem(const Tp::AccountPtr &account);
00044     virtual ~AccountsModelItem();
00045 
00046     Q_INVOKABLE virtual QVariant data(int role) const;
00047     virtual bool setData(int role, const QVariant &value);
00048     Q_INVOKABLE Tp::AccountPtr account() const;
00049 
00050     void setEnabled(bool value);
00051 
00052     Q_INVOKABLE void setNickname(const QString &value);
00053 
00054     Q_INVOKABLE void setAutomaticPresence(int type, const QString &status, const QString &statusMessage);
00055     Q_INVOKABLE void setRequestedPresence(int type, const QString &status, const QString &statusMessage);
00056 
00057     void clearContacts();
00058 
00059 public Q_SLOTS:
00060     void addKnownContacts();
00061     void onConnectionChanged(const Tp::ConnectionPtr &connection);
00062 
00063 Q_SIGNALS:
00064     void connectionStatusChanged(const QString &accountId, int status);
00065 
00066 private Q_SLOTS:
00067     void onRemoved();
00068 
00069     void onChanged();
00070 
00071     void onStatusChanged(Tp::ConnectionStatus status);
00072 
00073     void onContactManagerStateChanged(Tp::ContactListState state);
00074     void onContactsChanged(const Tp::Contacts &added,
00075                            const Tp::Contacts &removed);
00076 
00077 private:
00078     struct Private;
00079     friend struct Private;
00080     Private *mPriv;
00081 };
00082 
00083 }
00084 
00085 #endif // _TelepathyQt4Yell_Models_accounts_model_item_h_HEADER_GUARD_


Copyright © 2008-2010 Collabora Ltd. and Nokia Corporation
Telepathy-Qt4-Yell 0.1.6