libqutim  0.3.1.0
iconloader.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** qutIM - instant messenger
00004 **
00005 ** Copyright © 2011 Ruslan Nigmatullin <euroelessar@yandex.ru>
00006 **
00007 *****************************************************************************
00008 **
00009 ** $QUTIM_BEGIN_LICENSE$
00010 ** This program is free software: you can redistribute it and/or modify
00011 ** it under the terms of the GNU General Public License as published by
00012 ** the Free Software Foundation, either version 3 of the License, or
00013 ** (at your option) any later version.
00014 **
00015 ** This program is distributed in the hope that it will be useful,
00016 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00018 ** See the GNU General Public License for more details.
00019 **
00020 ** You should have received a copy of the GNU General Public License
00021 ** along with this program.  If not, see http://www.gnu.org/licenses/.
00022 ** $QUTIM_END_LICENSE$
00023 **
00024 ****************************************************************************/
00025 
00026 #ifndef ICONLOADER_H
00027 #define ICONLOADER_H
00028 
00029 #include "libqutim_global.h"
00030 
00031 class QIcon;
00032 class QMovie;
00033 
00034 namespace qutim_sdk_0_3
00035 {
00036 class IconWrapperPrivate;
00037 class LIBQUTIM_EXPORT IconWrapper
00038 {
00039 public:
00040     enum StdSize
00041     {
00042         StdSize16  = 16,
00043         StdSize22  = 22,
00044         StdSize32  = 32,
00045         StdSize28  = 28,
00046         StdSize64  = 64,
00047         StdSize128 = 128
00048     };
00049 
00050     virtual ~IconWrapper();
00051 
00052     virtual QIcon doLoadIcon(const QString &name) = 0;
00053     virtual QMovie *doLoadMovie(const QString &name) = 0;
00054     virtual QString doIconPath(const QString &name, uint iconSize) = 0;
00055     virtual QString doMoviePath(const QString &name, uint iconSize) = 0;
00056 };
00057 }
00058 
00059 Q_DECLARE_INTERFACE(qutim_sdk_0_3::IconWrapper, "org.qutim.IconWrapper/1.1")
00060 
00061 namespace qutim_sdk_0_3
00062 {
00063 class LIBQUTIM_EXPORT IconLoader : public QObject, protected qutim_sdk_0_3::IconWrapper
00064 {
00065     Q_OBJECT
00066     Q_INTERFACES(qutim_sdk_0_3::IconWrapper)
00067     Q_CLASSINFO("Service", "IconLoader")
00068 public:
00069     enum StdSize
00070     {
00071         StdSize16  = 16,
00072         StdSize22  = 22,
00073         StdSize32  = 32,
00074         StdSize28  = 28,
00075         StdSize64  = 64,
00076         StdSize128 = 128
00077     };
00078     IconLoader();
00079     virtual ~IconLoader();
00080 
00081     static QIcon loadIcon(const QString &name);
00082     static QMovie *loadMovie(const QString &name);
00083     static QString iconPath(const QString &name, uint iconSize);
00084     static QString moviePath(const QString &name, uint iconSize);
00085 
00086 protected:
00087     void virtual_hook(int id, void *data);
00088     friend class IconWrapperPrivate;
00089 };
00090 }
00091 
00092 #endif // ICONLOADER_H
00093