Show invite menu in wlm chat window immediately
[kdenetwork.git] / kopete / libkopete / ui / avatarselectorwidget.h
blobe05b83a17ce79e32654d963e339b9177fd1ace76
1 /*
2 avatarselectorwidget.h - Widget to manage and select user avatar
4 Copyright (c) 2007 by Michaël Larouche <larouche@kde.org>
5 2007 Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net>
7 Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org>
9 *************************************************************************
10 * *
11 * This library is free software; you can redistribute it and/or *
12 * modify it under the terms of the GNU Lesser General Public *
13 * License as published by the Free Software Foundation; either *
14 * version 2 of the License, or (at your option) any later version. *
15 * *
16 *************************************************************************
18 #ifndef KOPETE_AVATARSELECTORWIDGET_H
19 #define KOPETE_AVATARSELECTORWIDGET_H
21 #include <QtGui/QWidget>
23 // Kopete includes
24 #include <kopete_export.h>
25 #include <kopeteavatarmanager.h>
27 class QListWidgetItem;
28 class KJob;
30 namespace Kopete
33 namespace UI
36 /**
37 * @brief Widget to select and manager user avatar.
39 * Do not use this widget alone, use AvatarSelectorDialog instead.
41 * @sa AvatarSelectorDialog
42 * @author Michaël Larouche <larouche@kde.org>
44 class KOPETE_EXPORT AvatarSelectorWidget : public QWidget
46 Q_OBJECT
47 public:
48 /**
49 * @brief Create a new AvatarSelectorWidget
50 * @param parent parent widget
52 AvatarSelectorWidget(QWidget *parent = 0);
53 /**
54 * @brief Destructor
56 virtual ~AvatarSelectorWidget();
58 /**
59 * @brief Get the selected AvatarEntry
61 * This is a convience method to retrieve the AvatarEntry
62 * from current selected avatar.
64 * @return AvatarEntry of current selected avatar in list.
66 Kopete::AvatarManager::AvatarEntry selectedEntry() const;
68 /**
69 * @brief Set the avatar currently being used
71 * This is used to select the avatar in the avatar list
73 void setCurrentAvatar(const QString &path);
75 private Q_SLOTS:
76 /**
77 * @internal
78 * Add Avatar button was clicked
80 void buttonAddAvatarClicked();
82 /**
83 * @internal
84 * Remove Avatar button was clicked
86 void buttonRemoveAvatarClicked();
88 /**
89 * @internal
90 * Avatar query job was finished
92 void queryJobFinished(KJob *job);
94 /**
95 * @internal
96 * A new avatar was added into storage
97 * @param newEntry new avatar Entry
99 void avatarAdded(Kopete::AvatarManager::AvatarEntry newEntry);
102 * @internal
103 * An avatar has been removed from storage
104 * @param entryRemoved Avatar entry removed
106 void avatarRemoved(Kopete::AvatarManager::AvatarEntry entryRemoved);
109 * @internal
110 * A new item was selected in lists
111 * @param item new selected QListWidgetItem
113 void listSelectionChanged(QListWidgetItem *item);
115 private:
116 Q_DISABLE_COPY(AvatarSelectorWidget)
118 class Private;
119 Private * const d;
126 #endif