| 1 | /*
|
|---|
| 2 | * psiiconset.h - the Psi iconset class
|
|---|
| 3 | * Copyright (C) 2001-2003 Justin Karneges, Michail Pishchagin
|
|---|
| 4 | *
|
|---|
| 5 | * This program is free software; you can redistribute it and/or
|
|---|
| 6 | * modify it under the terms of the GNU General Public License
|
|---|
| 7 | * as published by the Free Software Foundation; either version 2
|
|---|
| 8 | * of the License, or (at your option) any later version.
|
|---|
| 9 | *
|
|---|
| 10 | * This program is distributed in the hope that it will be useful,
|
|---|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 13 | * GNU General Public License for more details.
|
|---|
| 14 | *
|
|---|
| 15 | * You should have received a copy of the GNU General Public License
|
|---|
| 16 | * along with this library; if not, write to the Free Software
|
|---|
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|---|
| 18 | *
|
|---|
| 19 | */
|
|---|
| 20 |
|
|---|
| 21 | #ifndef PSIICONSET_H
|
|---|
| 22 | #define PSIICONSET_H
|
|---|
| 23 |
|
|---|
| 24 | #include <qptrlist.h>
|
|---|
| 25 | #include <qmap.h>
|
|---|
| 26 |
|
|---|
| 27 | #include "iconset.h"
|
|---|
| 28 | #include "im.h"
|
|---|
| 29 |
|
|---|
| 30 | class PsiEvent;
|
|---|
| 31 | class UserListItem;
|
|---|
| 32 | struct Options;
|
|---|
| 33 |
|
|---|
| 34 | class PsiIconset
|
|---|
| 35 | {
|
|---|
| 36 | public:
|
|---|
| 37 | PsiIconset();
|
|---|
| 38 | ~PsiIconset();
|
|---|
| 39 |
|
|---|
| 40 | bool loadSystem();
|
|---|
| 41 | bool loadAll();
|
|---|
| 42 |
|
|---|
| 43 | bool optionsChanged(const Options *old); // returns 'true' if Psi needs to be restarted
|
|---|
| 44 |
|
|---|
| 45 | QDict<Iconset> roster;
|
|---|
| 46 | QPtrList<Iconset> emoticons;
|
|---|
| 47 | const Iconset &system() const;
|
|---|
| 48 | void stripFirstAnimFrame(Iconset *);
|
|---|
| 49 | static void removeAnimation(Iconset *);
|
|---|
| 50 |
|
|---|
| 51 | Icon *event2icon(PsiEvent *);
|
|---|
| 52 |
|
|---|
| 53 | // these two can possibly fail (and return 0)
|
|---|
| 54 | Icon *statusPtr(int);
|
|---|
| 55 | Icon *statusPtr(const XMPP::Status &);
|
|---|
| 56 |
|
|---|
| 57 | // these two return empty Icon on failure and are safe
|
|---|
| 58 | Icon status(int);
|
|---|
| 59 | Icon status(const XMPP::Status &);
|
|---|
| 60 |
|
|---|
| 61 | // JID-enabled status functions
|
|---|
| 62 | Icon *statusPtr(const XMPP::Jid &, int);
|
|---|
| 63 | Icon *statusPtr(const XMPP::Jid &, const XMPP::Status &);
|
|---|
| 64 |
|
|---|
| 65 | Icon status(const XMPP::Jid &, int);
|
|---|
| 66 | Icon status(const XMPP::Jid &, const XMPP::Status &);
|
|---|
| 67 |
|
|---|
| 68 | // functions to get status icon by transport name
|
|---|
| 69 | Icon *transportStatusPtr(QString name, int);
|
|---|
| 70 | Icon *transportStatusPtr(QString name, const XMPP::Status &);
|
|---|
| 71 |
|
|---|
| 72 | Icon transportStatus(QString name, int);
|
|---|
| 73 | Icon transportStatus(QString name, const XMPP::Status &);
|
|---|
| 74 |
|
|---|
| 75 | Icon *statusPtr(UserListItem *);
|
|---|
| 76 | Icon status(UserListItem *);
|
|---|
| 77 |
|
|---|
| 78 | private:
|
|---|
| 79 | class Private;
|
|---|
| 80 | Private *d;
|
|---|
| 81 | };
|
|---|
| 82 |
|
|---|
| 83 | #endif
|
|---|