LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
pixmaploader.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2010-2012 Hewlett-Packard Development Company, L.P.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * LICENSE@@@ */
18 
19 
20 
21 
22 #ifndef PIXMAPLOADER_H_
23 #define PIXMAPLOADER_H_
24 
25 #include "pixmapfilmstripobject.h"
26 
27 #include <QObject>
28 #include <QPointer>
29 #include <QString>
30 #include <QList>
31 #include <QPixmap>
32 #include <QRect>
33 
34 namespace PixmapObjectType
35 {
36  enum Enum
37  {
42  };
43 }
44 
45 namespace PixmapObjectTilingType
46 {
47  enum Enum
48  {
51  };
52 }
53 
54 class PixmapObject;
55 class Pixmap9TileObject;
56 class Pixmap3HTileObject;
57 class Pixmap3VTileObject;
58 
60 {
61  Q_OBJECT
62 public:
63 
64  static PixmapObjectLoader * instance(); //not a strict singleton class; supports private loaders in addition to a master one
65  // it isn't guarded though through the usual singleton pattern mechanisms so it can be nuked...beware
67  virtual ~PixmapObjectLoader();
68 
69  virtual PixmapObject * quickLoad(const QString & fileName, const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor,QObject * p_setOwner=0);
70  virtual PixmapObject * quickLoad(const QString & fileName, const QSize& size, bool limitOnly = true, const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor,QObject * p_setOwner=0);
71 
72  //quickLoadNineTiled: uses the Scale tiling method for edge and center tiles
73  virtual Pixmap9TileObject * quickLoadNineTiled(const QString & fileName,const quint32 topIn,const quint32 bottomIn,
74  const quint32 leftIn,const quint32 rightIn,
75  const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor,QObject * p_setOwner=0);
76 
77  virtual Pixmap3HTileObject * quickLoadThreeHorizTiled(const QString& filename,const quint32 topIn,const quint32 bottomIn,
78  const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor,QObject * p_setOwner=0);
79  virtual Pixmap3VTileObject * quickLoadThreeVertTiled(const QString& filename,const quint32 leftIn,const quint32 rightIn,
80  const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor,QObject * p_setOwner=0);
81 
82  virtual QList<PixmapObject *> loadMulti(const QList<QRect>& coordinateRects, const QString& fileName ,
83  const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor,QObject * p_setOwner=0);
84 
85  virtual PixmapFilmstripObject * quickLoadFilmstrip(const QSize& frameSize,quint32 numFrames,FrameDirection::Enum direction,
86  const QString & fileName,
87  const QPoint& startOffset = QPoint(0,0),
88  const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor,QObject * p_setOwner=0);
89 
90 
91 protected:
92 
93  static QPointer<PixmapObjectLoader> s_qp_instance;
94 };
95 
96 #endif /* PIXMAPLOADER_H_ */