• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kopete/kopete

  • sources
  • kde-4.14
  • kdenetwork
  • kopete
  • kopete
  • contactlist
contactlisttreemodel.h
Go to the documentation of this file.
1 /*
2  Kopete Contactlist Model
3 
4  Copyright (c) 2007 by Aleix Pol <aleixpol@gmail.com>
5  Copyright 2009 by Roman Jarosz <kedgedev@gmail.com>
6 
7  Kopete (c) 2002-2009 by the Kopete developers <kopete-devel@kde.org>
8 
9  *************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  *************************************************************************
17 */
18 
19 #ifndef KOPETE_UI_CONTACTLISTTREEMODEL_H
20 #define KOPETE_UI_CONTACTLISTTREEMODEL_H
21 
22 #include "contactlistmodel.h"
23 
24 #include <kopete_export.h>
25 
26 namespace Kopete {
27 
28 class Group;
29 class MetaContact;
30 class ContactListElement;
31 
32 namespace UI {
33 
34 class MetaContactModelItem;
35 class GroupModelItem;
36 class ContactListModelItem;
40 class KOPETE_CONTACT_LIST_EXPORT ContactListTreeModel : public ContactListModel
41 {
42 Q_OBJECT
43 public:
44  ContactListTreeModel(QObject* parent = 0);
45  ~ContactListTreeModel();
46 
47  virtual bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole );
48  virtual QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const;
49  virtual QModelIndex index ( int row, int column, const QModelIndex & parent = QModelIndex() ) const;
50 
51  virtual QModelIndex parent ( const QModelIndex & index ) const;
52  virtual int rowCount ( const QModelIndex & parent = QModelIndex() ) const;
53  virtual bool hasChildren ( const QModelIndex & parent = QModelIndex() ) const;
54 
55  virtual Qt::ItemFlags flags(const QModelIndex &index) const;
56 
57  virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action,
58  int row, int column, const QModelIndex &parent );
59 
60 public Q_SLOTS:
61  virtual void addMetaContact( Kopete::MetaContact* );
62  virtual void removeMetaContact( Kopete::MetaContact* );
63 
64  virtual void addGroup( Kopete::Group* );
65  virtual void removeGroup( Kopete::Group* );
66 
67  virtual void addMetaContactToGroup( Kopete::MetaContact*, Kopete::Group* );
68  virtual void removeMetaContactFromGroup( Kopete::MetaContact*, Kopete::Group* );
69 
70 protected Q_SLOTS:
71  virtual void handleContactDataChange(Kopete::MetaContact*);
72  virtual void appearanceConfigChanged();
73  virtual void loadContactList();
74 
75 protected:
76  virtual void loadModelSettingsImpl( QDomElement& rootElement );
77  virtual void saveModelSettingsImpl( QDomDocument& doc, QDomElement& rootElement );
78 
79  virtual bool dropMetaContacts( int row, const QModelIndex &parent, Qt::DropAction action, const QList<GroupMetaContactPair> &items );
80 
81 private:
82  ContactListModelItem* itemFor( const QModelIndex& index ) const;
83  QModelIndex indexFor( ContactListModelItem* modelItem ) const;
84  QModelIndexList indexListFor ( Kopete::ContactListElement* ) const;
85 
86  int countConnected( GroupModelItem* gmi ) const;
87  QVariant metaContactImage( Kopete::MetaContact* mc ) const;
88  QString metaContactTooltip( Kopete::MetaContact* metaContact ) const;
89 
90  QHash<GroupMetaContactPair, int> m_addContactPosition;
91 
92  GroupModelItem* m_topLevelGroup;
93  QHash<Kopete::Group*, GroupModelItem*> m_groups;
94  QMap<GroupMetaContactPair, MetaContactModelItem*> m_metaContacts;
95 };
96 
97 }
98 
99 }
100 
101 #endif
102 //kate: tab-width 4
QModelIndex
QMap
contactlistmodel.h
Kopete::UI::ContactListModelItem
Definition: contactlisttreemodel_p.h:34
QMimeData
Kopete::Items::MetaContact
Definition: kopeteitembase.h:57
Kopete::Items::Group
Definition: kopeteitembase.h:57
QHash< GroupMetaContactPair, int >
QObject
Kopete::UI::ContactListModel
Definition: contactlistmodel.h:42
QString
QList
QDomDocument
Kopete::UI::ContactListTreeModel
Definition: contactlisttreemodel.h:40
QDomElement
Kopete::UI::GroupModelItem
Definition: contactlisttreemodel_p.h:95
QVariant
Qt::ItemFlags
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/kopete

Skip menu "kopete/kopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal