• 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.12
  • kdenetwork
  • kopete
  • kopete
  • contactlist
contactlistmodel.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_CONTACTLISTMODEL_H
20 #define KOPETE_UI_CONTACTLISTMODEL_H
21 
22 #include <QAbstractItemModel>
23 #include <QPair>
24 #include <QHash>
25 
26 #include <kopete_export.h>
27 
28 class QDomDocument;
29 class QDomElement;
30 
31 namespace Kopete {
32 
33 class Group;
34 class MetaContact;
35 class MessageEvent;
36 
37 namespace UI {
38 
42 class KOPETE_CONTACT_LIST_EXPORT ContactListModel : public QAbstractItemModel
43 {
44 Q_OBJECT
45 public:
46  ContactListModel(QObject* parent = 0);
47 
48  void init();
49 
50  virtual int columnCount ( const QModelIndex & parent = QModelIndex() ) const;
51 
52  /* drag-n-drop stuff */
53  virtual Qt::DropActions supportedDropActions() const;
54  virtual QMimeData* mimeData(const QModelIndexList &indexes) const;
55  virtual QStringList mimeTypes() const;
56  virtual bool setData(const QModelIndex &index, const QVariant &value, const int role);
57 
58  bool loadModelSettings( const QString& modelType );
59  bool saveModelSettings( const QString& modelType );
60 
61 public Q_SLOTS:
62  virtual void addMetaContact( Kopete::MetaContact* );
63  virtual void removeMetaContact( Kopete::MetaContact* );
64 
65  virtual void addGroup( Kopete::Group* );
66  virtual void removeGroup( Kopete::Group* );
67 
68  virtual void addMetaContactToGroup( Kopete::MetaContact*, Kopete::Group* );
69  virtual void removeMetaContactFromGroup( Kopete::MetaContact*, Kopete::Group* );
70  virtual void moveMetaContactToGroup( Kopete::MetaContact*, Kopete::Group*, Kopete::Group*);
71 
72 protected Q_SLOTS:
73  virtual void appearanceConfigChanged() = 0;
74  virtual void handleContactDataChange( Kopete::MetaContact* ) = 0;
75  virtual void loadContactList();
76  void handleContactDataChange();
77  void newMessageEvent( Kopete::MessageEvent *event );
78  void newMessageEventDone( Kopete::MessageEvent *event );
79 
80 protected:
81  bool dropUrl( const QMimeData *data, int row, const QModelIndex &parent, Qt::DropAction action );
82  typedef QPair<Kopete::Group*, Kopete::MetaContact*> GroupMetaContactPair;
83  virtual bool dropMetaContacts( int row, const QModelIndex &parent, Qt::DropAction action, const QList<GroupMetaContactPair> &items );
84 
85  QVariant metaContactData( const Kopete::MetaContact* mc, int role ) const;
86  QVariant metaContactImage( const Kopete::MetaContact* mc ) const;
87  QString metaContactTooltip( const Kopete::MetaContact* metaContact ) const;
88 
89  virtual void loadModelSettingsImpl( QDomElement& rootElement ) = 0;
90  virtual void saveModelSettingsImpl( QDomDocument& doc, QDomElement& rootElement ) = 0;
91 
92  bool m_manualGroupSorting;
93  bool m_manualMetaContactSorting;
94 
95 private:
96  QHash< const Kopete::MetaContact*, QSet<Kopete::MessageEvent*> > m_newMessageMetaContactSet;
97 };
98 }
99 
100 }
101 
102 #endif
103 //kate: tab-width 4
Kopete::UI::ContactListModel::GroupMetaContactPair
QPair< Kopete::Group *, Kopete::MetaContact * > GroupMetaContactPair
Definition: contactlistmodel.h:82
QObject
Kopete::Items::MetaContact
Definition: kopeteitembase.h:57
Kopete::Items::Group
Definition: kopeteitembase.h:57
Kopete::UI::ContactListModel::m_manualGroupSorting
bool m_manualGroupSorting
Definition: contactlistmodel.h:92
Kopete::UI::ContactListModel
Definition: contactlistmodel.h:42
QAbstractItemModel
Kopete::UI::ContactListModel::m_manualMetaContactSorting
bool m_manualMetaContactSorting
Definition: contactlistmodel.h:93
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:40 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