| 1 | // -*- c-basic-offset: 2 -*- |
|---|
| 2 | /* |
|---|
| 3 | * This file is part of Licq, an instant messaging client for UNIX. |
|---|
| 4 | * Copyright (C) 1999-2006 Licq developers |
|---|
| 5 | * |
|---|
| 6 | * Licq is free software; you can redistribute it and/or modify |
|---|
| 7 | * it under the terms of the GNU General Public License as published by |
|---|
| 8 | * the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | * (at your option) any later version. |
|---|
| 10 | * |
|---|
| 11 | * Licq is distributed in the hope that it will be useful, |
|---|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | * GNU General Public License for more details. |
|---|
| 15 | * |
|---|
| 16 | * You should have received a copy of the GNU General Public License |
|---|
| 17 | * along with Licq; if not, write to the Free Software |
|---|
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| 19 | */ |
|---|
| 20 | |
|---|
| 21 | #ifndef FLOATYVIEW_H |
|---|
| 22 | #define FLOATYVIEW_H |
|---|
| 23 | |
|---|
| 24 | #include "userviewbase.h" |
|---|
| 25 | |
|---|
| 26 | class ICQUser; |
|---|
| 27 | |
|---|
| 28 | namespace LicqQtGui |
|---|
| 29 | { |
|---|
| 30 | class FloatyView; |
|---|
| 31 | |
|---|
| 32 | typedef QVector<FloatyView*> UserFloatyList; |
|---|
| 33 | |
|---|
| 34 | /** |
|---|
| 35 | * Separate window that shows a single user |
|---|
| 36 | */ |
|---|
| 37 | class FloatyView : public UserViewBase |
|---|
| 38 | { |
|---|
| 39 | Q_OBJECT |
|---|
| 40 | |
|---|
| 41 | public: |
|---|
| 42 | /** |
|---|
| 43 | * Constructor |
|---|
| 44 | * |
|---|
| 45 | * @param contactList The contact list instance |
|---|
| 46 | * @param licqUser The daemon contact to create floaty for |
|---|
| 47 | * @param parent Parent object |
|---|
| 48 | */ |
|---|
| 49 | FloatyView(ContactListModel* contactList, const ICQUser* licqUser, QWidget* parent = 0); |
|---|
| 50 | |
|---|
| 51 | /** |
|---|
| 52 | * Destructor |
|---|
| 53 | */ |
|---|
| 54 | virtual ~FloatyView(); |
|---|
| 55 | |
|---|
| 56 | /** |
|---|
| 57 | * Return the user protocol id |
|---|
| 58 | */ |
|---|
| 59 | unsigned long ppid() const { return myPpid; } |
|---|
| 60 | |
|---|
| 61 | /** |
|---|
| 62 | * Return the user id |
|---|
| 63 | */ |
|---|
| 64 | QString id() const { return myId; } |
|---|
| 65 | |
|---|
| 66 | /** |
|---|
| 67 | * Find the floaty for a user |
|---|
| 68 | * |
|---|
| 69 | * @param id User id |
|---|
| 70 | * @param ppid Protocol id |
|---|
| 71 | * @return The floaty for the user or null if no floaty exists for the user |
|---|
| 72 | */ |
|---|
| 73 | static FloatyView* findFloaty(QString id, unsigned long ppid); |
|---|
| 74 | |
|---|
| 75 | // List of existing floaties |
|---|
| 76 | static UserFloatyList floaties; |
|---|
| 77 | |
|---|
| 78 | private: |
|---|
| 79 | /** |
|---|
| 80 | * Mouse was moved |
|---|
| 81 | * |
|---|
| 82 | * @param event Mouse event |
|---|
| 83 | */ |
|---|
| 84 | virtual void mouseMoveEvent(QMouseEvent* event); |
|---|
| 85 | |
|---|
| 86 | QString myId; |
|---|
| 87 | unsigned long myPpid; |
|---|
| 88 | |
|---|
| 89 | private slots: |
|---|
| 90 | /** |
|---|
| 91 | * Gets called when contact list config was updated |
|---|
| 92 | */ |
|---|
| 93 | void configUpdated(); |
|---|
| 94 | }; |
|---|
| 95 | |
|---|
| 96 | } // namespace LicqQtGui |
|---|
| 97 | |
|---|
| 98 | #endif |
|---|