• 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
kopeteonlinestatus.h
Go to the documentation of this file.
1 /*
2  kopeteonlinestatus.h - Kopete Online Status
3 
4  Copyright (c) 2003 by Martijn Klingens <klingens@kde.org>
5  Copyright (c) 2003 by Duncan Mac-Vicar Prett <duncan@kde.org>
6  Copyright (c) 2003 by Will Stephenson <wstephenson@kde.org>
7  Copyright (c) 2004 by Olivier Goffart <ogoffart@kde.org>
8 
9  Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
10 
11  *************************************************************************
12  * *
13  * This library is free software; you can redistribute it and/or *
14  * modify it under the terms of the GNU Lesser General Public *
15  * License as published by the Free Software Foundation; either *
16  * version 2 of the License, or (at your option) any later version. *
17  * *
18  *************************************************************************
19 */
20 
21 #ifndef kopeteonlinestatus_h
22 #define kopeteonlinestatus_h
23 
24 #include "kopete_export.h"
25 
26 #include <kdemacros.h>
27 #include <ksharedptr.h>
28 #include <kiconloader.h>
29 
30 #include <QtCore/QObject>
31 #include <QtCore/QFlags>
32 #include <QtGui/QIcon>
33 
34 #include "kopeteonlinestatusmanager.h"
35 
36 class QString;
37 class QPixmap;
38 class QColor;
39 
40 namespace Kopete
41 {
42  class OnlineStatusManager;
43 
44  class Identity;
45  class Protocol;
46  class Account;
47  class Contact;
48 
68 class KOPETE_EXPORT OnlineStatus
69 {
70 public:
78  enum StatusType
79  {
90  Unknown=0,
98  Offline=10,
104  Connecting=20,
110  Invisible=30,
117  Away=40,
123  Busy=45,
129  Online=50
130  };
131  // note than Unknown is first, because the metacontact algorithm to detect
132  // the metacontact status from the contact status starts from Unknown, and
133  // takes a contact only if its status is greater
134 
141  enum ReservedInternalStatus
142  {
147  AccountOffline = 0x80000001
148  };
149 
150 
159  OnlineStatus();
160 
161 
187  OnlineStatus( StatusType status, unsigned weight, Protocol *protocol,
188  unsigned internalStatus, const QStringList &overlayIcons, const QString &description );
189 
228  OnlineStatus( StatusType status, unsigned weight, Protocol *protocol, unsigned internalStatus, const QStringList &overlayIcon,
229  const QString &description, const QString& caption, OnlineStatusManager::Categories categories = 0x0 , OnlineStatusManager::Options options = 0x0 );
230 
231 
239  OnlineStatus( StatusType status ); /* implicit */
240 
247  OnlineStatus( const OnlineStatus &other );
248 
252  ~OnlineStatus();
253 
257  StatusType status() const;
258 
262  unsigned internalStatus() const;
263 
267  unsigned weight() const;
268 
272  QStringList overlayIcons() const;
273 
277  QString description() const;
278 
282  Protocol* protocol() const;
283 
287  QString caption() const;
288 
294  OnlineStatusManager::Categories categories() const;
295 
301  OnlineStatusManager::Options options() const;
302 
307  bool isDefinitelyOnline() const;
308 
309 
310 
311 
321  QIcon iconFor( const Contact *contact ) const;
322 
330  KDE_DEPRECATED QPixmap iconFor( const Contact *contact, int size ) const
331  { return iconFor(contact).pixmap(size); }
332 
345  QString mimeSourceFor( const Contact *contact, int size = 16 ) const;
346 
358  QIcon iconFor( const Account *account ) const;
359 
369  KDE_DEPRECATED QPixmap iconFor( const Account *account, int size ) const
370  { return iconFor(account).pixmap(size); }
371 
385  QString mimeSourceFor( const Account *account, int size = 16 ) const;
386 
396  QPixmap iconFor( const QString &mimeSource ) const;
397 
403  QPixmap protocolIcon(const KIconLoader::StdSizes size) const;
404 
410  KDE_DEPRECATED QPixmap protocolIcon() const;
411 
415  OnlineStatus & operator=( const OnlineStatus &other );
416 
423  bool operator==( const OnlineStatus &other ) const;
424 
430  bool operator!=( const OnlineStatus &other ) const;
431 
438  bool operator>( const OnlineStatus &other ) const;
439 
445  bool operator<( const OnlineStatus &other ) const;
446 
453  static QString statusTypeToString(OnlineStatus::StatusType status);
454 
461  static OnlineStatus::StatusType statusStringToType(const QString& string);
462 
463 
464 
465 private:
466 
467  class Private;
468  KSharedPtr<Private> d;
469 
470  QString mimeSource( const QString& icon, int size, QColor color, bool idle) const;
471 
472 
473 };
474 
475 } //END namespace Kopete
476 
477 #endif
478 
479 
KOPETE_EXPORT
#define KOPETE_EXPORT
Definition: kopete_export.h:27
Kopete::OnlineStatus
Definition: kopeteonlinestatus.h:68
status
OnlineStatus::StatusType status
Definition: kopeteonlinestatus.cpp:103
Kopete::OnlineStatus::ReservedInternalStatus
ReservedInternalStatus
Reserved internal status values.
Definition: kopeteonlinestatus.h:141
Kopete::Protocol
base class of every protocol.
Definition: kopeteprotocol.h:62
Kopete::OnlineStatus::iconFor
KDE_DEPRECATED QPixmap iconFor(const Contact *contact, int size) const
Return a status icon generated for the given Contact This is an overloaded member function...
Definition: kopeteonlinestatus.h:330
NetworkStatus::Online
Definition: networkstatuscommon.h:9
kopete_export.h
QString
QColor
Kopete::Contact
Definition: kopetecontact.h:58
QStringList
QPixmap
NetworkStatus::Offline
Definition: networkstatuscommon.h:9
Kopete::OnlineStatus::StatusType
StatusType
The available global states.
Definition: kopeteonlinestatus.h:78
Kopete::Account
The Kopete::Account class handles one account.
Definition: kopeteaccount.h:72
kopeteonlinestatusmanager.h
QIcon
Kopete::OnlineStatus::iconFor
KDE_DEPRECATED QPixmap iconFor(const Account *account, int size) const
Return a status icon generated for the given Account This is an overloaded member function...
Definition: kopeteonlinestatus.h:369
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