libqutim  0.3.1.0
iconloader.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** qutIM - instant messenger
4 **
5 ** Copyright © 2011 Ruslan Nigmatullin <euroelessar@yandex.ru>
6 **
7 *****************************************************************************
8 **
9 ** $QUTIM_BEGIN_LICENSE$
10 ** This program is free software: you can redistribute it and/or modify
11 ** it under the terms of the GNU General Public License as published by
12 ** the Free Software Foundation, either version 3 of the License, or
13 ** (at your option) any later version.
14 **
15 ** This program is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 ** See the GNU General Public License for more details.
19 **
20 ** You should have received a copy of the GNU General Public License
21 ** along with this program. If not, see http://www.gnu.org/licenses/.
22 ** $QUTIM_END_LICENSE$
23 **
24 ****************************************************************************/
25 
26 #ifndef ICONLOADER_H
27 #define ICONLOADER_H
28 
29 #include "libqutim_global.h"
30 
31 class QIcon;
32 class QMovie;
33 
34 namespace qutim_sdk_0_3
35 {
36 class IconWrapperPrivate;
38 {
39 public:
40  enum StdSize
41  {
42  StdSize16 = 16,
43  StdSize22 = 22,
44  StdSize32 = 32,
45  StdSize28 = 28,
46  StdSize64 = 64,
47  StdSize128 = 128
48  };
49 
50  virtual ~IconWrapper();
51 
52  virtual QIcon doLoadIcon(const QString &name) = 0;
53  virtual QMovie *doLoadMovie(const QString &name) = 0;
54  virtual QString doIconPath(const QString &name, uint iconSize) = 0;
55  virtual QString doMoviePath(const QString &name, uint iconSize) = 0;
56 };
57 }
58 
59 Q_DECLARE_INTERFACE(qutim_sdk_0_3::IconWrapper, "org.qutim.IconWrapper/1.1")
60 
61 namespace qutim_sdk_0_3
62 {
63 class LIBQUTIM_EXPORT IconLoader : public QObject, protected qutim_sdk_0_3::IconWrapper
64 {
65  Q_OBJECT
66  Q_INTERFACES(qutim_sdk_0_3::IconWrapper)
67  Q_CLASSINFO("Service", "IconLoader")
68 public:
69  enum StdSize
70  {
71  StdSize16 = 16,
72  StdSize22 = 22,
73  StdSize32 = 32,
74  StdSize28 = 28,
75  StdSize64 = 64,
76  StdSize128 = 128
77  };
78  IconLoader();
79  virtual ~IconLoader();
80 
81  static QIcon loadIcon(const QString &name);
82  static QMovie *loadMovie(const QString &name);
83  static QString iconPath(const QString &name, uint iconSize);
84  static QString moviePath(const QString &name, uint iconSize);
85 
86 protected:
87  void virtual_hook(int id, void *data);
88  friend class IconWrapperPrivate;
89 };
90 }
91 
92 #endif // ICONLOADER_H
93 

Generated by Doxygen