make webinterface translatable. there are around 20 short strings, all with context...
[kdenetwork.git] / kopete / libkopete / kopeteinfoevent.cpp
blob1bba0cea015864a32bf7e47413f7c7f9dd040617
1 /*
2 kopeteinfoevent.cpp - Kopete Info Event
4 Copyright (c) 2008 by Roman Jarosz <kedgedev@centrum.cz>
5 Kopete (c) 2008 by the Kopete developers <kopete-devel@kde.org>
7 *************************************************************************
8 * *
9 * This library is free software; you can redistribute it and/or *
10 * modify it under the terms of the GNU Lesser General Public *
11 * License as published by the Free Software Foundation; either *
12 * version 2 of the License, or (at your option) any later version. *
13 * *
14 *************************************************************************
16 #include "kopeteinfoevent.h"
17 #include "kopeteinfoeventmanager.h"
19 #include <QStringList>
21 #include <kdebug.h>
23 namespace Kopete {
25 class InfoEvent::Private
27 public:
28 QMap<uint, QString> actions;
29 QString title;
30 QString text;
31 QString additionalText;
32 bool closed;
35 InfoEvent::InfoEvent( QObject *parent )
36 : QObject( parent ), d( new Private )
38 d->closed = false;
41 InfoEvent::~InfoEvent()
43 if ( !d->closed )
44 emit eventClosed( this );
46 delete d;
49 void InfoEvent::sendEvent()
51 InfoEventManager::self()->addEvent( this );
54 QString InfoEvent::title() const
56 return d->title;
59 void InfoEvent::setTitle( const QString& title )
61 d->title = title;
64 QString InfoEvent::text() const
66 return d->text;
69 void InfoEvent::setText( const QString& text )
71 d->text = text;
74 QString InfoEvent::additionalText() const
76 return d->additionalText;
79 void InfoEvent::setAdditionalText( const QString& text )
81 d->additionalText = text;
84 QMap<uint, QString> InfoEvent::actions() const
86 return d->actions;
89 void InfoEvent::addAction( uint actionId, const QString& actionText )
91 d->actions[actionId] = actionText;
94 void InfoEvent::activate( uint actionId )
96 emit actionActivated( actionId );
99 void InfoEvent::close()
101 if ( d->closed )
103 kDebug( 14010 ) << "Closing more the once!!!";
104 return;
107 d->closed = true;
108 emit eventClosed( this );
109 deleteLater();
114 #include "kopeteinfoevent.moc"