• 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
  • ui
kopetecontactaction.cpp
Go to the documentation of this file.
1 /*
2  kopetecontactaction.cpp - KAction for selecting a Kopete::Contact
3 
4  Copyright (c) 2003 by Martijn Klingens <klingens@kde.org>
5 
6  Kopete (c) 2003 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 
18 #include "kopetecontactaction.h"
19 #include "kicon.h"
20 #include "kopetemetacontact.h"
21 #include "kopetecontact.h"
22 #include "kopeteonlinestatus.h"
23 #include <kactioncollection.h>
24 
25 Q_DECLARE_METATYPE(Kopete::Contact*)
26 
27 namespace Kopete
28 {
29 namespace UI
30 {
31 
32 ContactAction::ContactAction( Kopete::Contact *contact, KActionCollection* parent )
33 : KAction( KIcon( contact->onlineStatus().iconFor( contact ) ),
34  contact->metaContact()->displayName(), parent )
35 {
36  setData( QVariant::fromValue( contact ) );
37  connect( this, SIGNAL(triggered(bool)),
38  this, SLOT(slotTriggered(bool)) );
39  parent->addAction( contact->contactId(), this );
40 }
41 
42 void ContactAction::slotTriggered( bool checked )
43 {
44  Kopete::Contact* contact = data().value<Kopete::Contact*>();
45  const QString &id = contact->contactId();
46  emit triggered( contact, checked );
47  emit triggered( id, checked );
48 }
49 
50 }
51 }
52 #include "kopetecontactaction.moc"
53 
54 // vim: set noet ts=4 sts=4 sw=4:
kopetemetacontact.h
Kopete::Contact::contactId
QString contactId
Definition: kopetecontact.h:70
kopeteonlinestatus.h
Kopete::UI::ContactAction::triggered
void triggered(Kopete::Contact *, bool checked)
Emitted when the action is triggered.
kopetecontactaction.h
QString
Kopete::Contact
Definition: kopetecontact.h:58
QVariant::fromValue
QVariant fromValue(const T &value)
KAction
kopetecontact.h
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