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

kopete/libkopete

  • sources
  • kde-4.14
  • kdenetwork
  • kopete
  • libkopete
kopeteavatarmanager.h
Go to the documentation of this file.
1 /*
2  kopeteavatarmanager.h - Global avatar manager
3 
4  Copyright (c) 2007 by MichaĆ«l Larouche <larouche@kde.org>
5 
6  Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org>
7 
8  *************************************************************************
9  * *
10  * This library is free software; you can redistribute it and/or *
11  * modify it under the terms of the GNU Lesser General Public *
12  * License as published by the Free Software Foundation; either *
13  * version 2 of the License, or (at your option) any later version. *
14  * *
15  *************************************************************************
16 */
17 #ifndef KOPETE_AVATARMANAGER_H
18 #define KOPETE_AVATARMANAGER_H
19 
20 #include <QtCore/QObject>
21 #include <QtCore/QList>
22 #include <QtGui/QImage>
23 #include <kjob.h>
24 #include "kopete_export.h"
25 
26 class QImage;
27 
28 namespace Kopete
29 {
30 
31 class Contact;
106 class KOPETE_EXPORT AvatarManager : public QObject
107 {
108  Q_OBJECT
109 public:
113  enum AvatarCategoryType
114  {
115  User=1,
116  Contact,
117  All = User | Contact
118  };
119  Q_DECLARE_FLAGS(AvatarCategory, AvatarCategoryType)
120 
121 
127  typedef struct AvatarEntry
128  {
129  QString name;
130  QString path;
131  QImage image;
132  QByteArray data;
133  QString dataPath;
134  Kopete::Contact *contact;
135  AvatarManager::AvatarCategory category;
136  } AvatarEntry;
137 
138 public:
143  ~AvatarManager();
144 
149  static AvatarManager *self();
150 
151 Q_SIGNALS:
161  void avatarAdded(Kopete::AvatarManager::AvatarEntry newEntry);
162 
172  void avatarRemoved(Kopete::AvatarManager::AvatarEntry entryRemoved);
173 
174 public Q_SLOTS:
183  Kopete::AvatarManager::AvatarEntry add(Kopete::AvatarManager::AvatarEntry newEntry);
184 
189  bool remove(Kopete::AvatarManager::AvatarEntry entryToRemove);
190 
195  bool exists(Kopete::AvatarManager::AvatarEntry avatarToCheck);
196 
201  bool exists(const QString &avatarName);
202 
203 private:
209  AvatarManager(QObject *parent = 0);
210 
211 private:
212  static AvatarManager *s_self;
213 
214  class Private;
215  Private * const d;
216 };
217 
218 Q_DECLARE_OPERATORS_FOR_FLAGS(Kopete::AvatarManager::AvatarCategory)
219 
220 
247 // TODO: Use new Kopete::Task or KCompositeJob
248 class KOPETE_EXPORT AvatarQueryJob : public KJob
249 {
250  Q_OBJECT
251 public:
252  AvatarQueryJob(QObject *parent = 0);
253  ~AvatarQueryJob();
254 
260  void setQueryFilter(Kopete::AvatarManager::AvatarCategory category);
261 
265  virtual void start();
266 
271  QList<Kopete::AvatarManager::AvatarEntry> avatarList() const;
272 
273 private:
274  class Private;
275  Private * const d;
276 };
277 
278 }
279 
280 #endif
KOPETE_EXPORT
#define KOPETE_EXPORT
Definition: kopete_export.h:27
Kopete::AvatarManager::AvatarEntry::contact
Kopete::Contact * contact
contact is used when adding a new contact avatar. AvatarManager use it to create the final url...
Definition: kopeteavatarmanager.h:134
Kopete::AvatarManager::AvatarEntry::category
AvatarManager::AvatarCategory category
category in which the avatar belong
Definition: kopeteavatarmanager.h:135
Kopete::AvatarManager::AvatarEntry::dataPath
QString dataPath
path is the full path to the data on disk
Definition: kopeteavatarmanager.h:133
Kopete::AvatarManager::AvatarEntry::image
QImage image
image is used when adding a new avatar, AvatarManager will write the image on disk.
Definition: kopeteavatarmanager.h:131
QByteArray
Kopete::AvatarQueryJob
Job to query avatar on disk.
Definition: kopeteavatarmanager.h:248
Kopete::AvatarManager::AvatarEntry::name
QString name
name is a friendly name to identity the avatar
Definition: kopeteavatarmanager.h:129
QObject
kopete_export.h
QString
QList< Kopete::AvatarManager::AvatarEntry >
Kopete::Contact
Definition: kopetecontact.h:58
Kopete::AvatarManager::AvatarEntry::data
QByteArray data
original data used to construct the image
Definition: kopeteavatarmanager.h:132
QImage
Kopete::AvatarManager::AvatarEntry
A single entry in AvatarManager.
Definition: kopeteavatarmanager.h:127
NetworkStatus::User
Definition: networkstatuscommon.h:11
Kopete::AvatarManager::AvatarCategoryType
AvatarCategoryType
Available avatar category.
Definition: kopeteavatarmanager.h:113
Kopete::AvatarManager::AvatarEntry::path
QString path
path is the full path to the image on disk
Definition: kopeteavatarmanager.h:130
Kopete::AvatarManager::Contact
Avatar from a contact.
Definition: kopeteavatarmanager.h:116
NetworkStatus::All
Definition: networkstatuscommon.h:11
KJob
Kopete::AvatarManager
Manage the avatar storage.
Definition: kopeteavatarmanager.h:106
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/libkopete

Skip menu "kopete/libkopete"
  • 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