KVIrc  4.9.2
DeveloperAPIs
KvsObject_pixmap.h
Go to the documentation of this file.
1 #ifndef _CLASS_PIXMAP_H_
2 #define _CLASS_PIXMAP_H_
3 //=============================================================================
4 //
5 // File : KvsObject_pixmap.h
6 // Creation date : Fri Mar 18 14:30:48 CEST 2005
7 // by Tonino Imbesi(Grifisx) and Alessandro Carbone(Noldor)
8 //
9 // This file is part of the KVIrc IRC client distribution
10 // Copyright (C) 2005-2008 Alessandro Carbone (elfonol at gmail dot com)
11 //
12 // This program is FREE software. You can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the HOPE that it will be USEFUL,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 // See the GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program. If not, write to the Free Software Foundation,
24 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 //
26 //=============================================================================
27 
28 #include <qpixmap.h>
29 #include <qimage.h>
30 #include <KviAnimatedPixmap.h>
31 #include "KviCString.h"
32 
33 #include "object_macros.h"
34 
36 {
37  Q_OBJECT
38  // Q_PROPERTY(QPixmap pixmap READ getPixmap)
39 public:
41  enum Type
42  {
46  };
48  void setInternalPixmap(QPixmap * pPixmap);
49  void setInternalImage(QImage * pImage);
50 
51  QImage * getImage()
52  {
53  if(!m_pImage)
54  m_pImage = new QImage();
55  if(m_currentType == Pixmap)
56  {
57  if(m_pPixmap)
58  {
59  *m_pImage = m_pPixmap->toImage();
60  delete m_pPixmap;
61  m_pPixmap = 0;
62  }
63  }
65  return m_pImage;
66  }
67 
68  QPixmap * getPixmap()
69  {
70  if(!m_pPixmap)
71  m_pPixmap = new QPixmap();
72  if(m_currentType == Image)
73  {
74  if(m_pImage)
75  {
76  *m_pPixmap = m_pPixmap->fromImage(*m_pImage);
77  delete m_pImage;
78  m_pImage = 0;
79  }
80  }
82  return m_pPixmap;
83  }
84 
85 protected:
87  QPixmap * m_pPixmap;
88  QImage * m_pImage;
89 signals:
90  void aboutToDie();
91 
92 protected:
96  //bool rotate(KviKvsObjectFunctionCall *c);
112 protected slots:
113  void frameChanged();
114 };
115 
116 #endif // !_CLASS_PIXMAP_H_
Definition: KviAnimatedPixmap.h:67
bool loadAnimation(KviKvsObjectFunctionCall *c)
bool scale(KviKvsObjectFunctionCall *c)
char s char s char s s s s s char char c s *s c s s s d c s *s d c d d d d c
Definition: KviIrcNumericCodes.h:391
Definition: KvsObject_pixmap.h:43
QPixmap * getPixmap()
Definition: KvsObject_pixmap.h:68
bool rotate(KviKvsObjectFunctionCall *c)
Definition: KvsObject_pixmap.h:45
QPixmap * m_pPixmap
Definition: KvsObject_pixmap.h:87
bool width(KviKvsObjectFunctionCall *c)
Definition: KviKvsObjectFunctionCall.h:33
Definition: KviKvsObject.h:50
bool pixel(KviKvsObjectFunctionCall *c)
bool frameChangedEvent(KviKvsObjectFunctionCall *c)
Type
Definition: KvsObject_pixmap.h:41
bool load(KviKvsObjectFunctionCall *c)
void frameChanged()
Definition: KvsObject_pixmap.cpp:709
KviAnimatedPixmap * m_pAnimatedPixmap
Definition: KvsObject_pixmap.h:86
bool loadFromMemoryBuffer(KviKvsObjectFunctionCall *c)
bool toGrayScale(KviKvsObjectFunctionCall *c)
QImage * getImage()
Definition: KvsObject_pixmap.h:51
bool startAnimation(KviKvsObjectFunctionCall *c)
Definition: KvsObject_pixmap.h:44
void setInternalImage(QImage *pImage)
Definition: KvsObject_pixmap.cpp:618
#define KVSO_DECLARE_OBJECT(__className)
Definition: object_macros.h:33
bool setPixel(KviKvsObjectFunctionCall *c)
bool grabWidget(KviKvsObjectFunctionCall *c)
bool height(KviKvsObjectFunctionCall *c)
Type m_currentType
Definition: KvsObject_pixmap.h:47
Definition: KvsObject_pixmap.h:35
bool stopAnimation(KviKvsObjectFunctionCall *c)
bool mirrored(KviKvsObjectFunctionCall *c)
void setInternalPixmap(QPixmap *pPixmap)
Definition: KvsObject_pixmap.cpp:609
bool fill(KviKvsObjectFunctionCall *c)
bool save(KviKvsObjectFunctionCall *c)
QImage * m_pImage
Definition: KvsObject_pixmap.h:88
bool resize(KviKvsObjectFunctionCall *c)