• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

parley

  • sources
  • kde-4.14
  • kdeedu
  • parley
  • src
  • practice
imagecache.h
Go to the documentation of this file.
1 /***************************************************************************
2  Copyright 2010 Daniel Laidig <laidig@kde.org>
3  ***************************************************************************/
4 
5 /***************************************************************************
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  ***************************************************************************/
13 
14 #ifndef PRACTICE_IMAGECACHE_H
15 #define PRACTICE_IMAGECACHE_H
16 
17 #include <QHash>
18 #include <QStringList>
19 #include <QDateTime>
20 #include <QImage>
21 
22 class QSize;
23 class QDebug;
24 
25 namespace Practice
26 {
27 
28 class ImageCache
29 {
30 public:
31  ImageCache() {}
32  // set a list of filenames which should be checked for timestamps
33  void setFilenames(const QStringList& filename);
34 
35  void updateImage(const QString& id, const QImage& image);
36  QSize imageSize(const QString& id);
37  QImage getImage(const QString& id);
38  bool isEmpty() {
39  return m_images.isEmpty();
40  }
41 
42  void setSaveFilename(const QString& filename) {
43  m_saveFilename = filename;
44  }
45  void openCache();
46  void saveCache();
47 
48  friend QDebug operator<<(QDebug dbg, const Practice::ImageCache &c);
49 private:
50  QHash<QString, QImage> m_images;
51  QList<QDateTime> m_timestamps;
52  QStringList m_filenames;
53  QString m_saveFilename;
54 };
55 
56 QDebug operator<<(QDebug dbg, const Practice::ImageCache &c);
57 
58 }
59 
60 
61 
62 #endif // PRACTICE_IMAGECACHE_H
Practice::ImageCache::setSaveFilename
void setSaveFilename(const QString &filename)
Definition: imagecache.h:42
Practice::ImageCache::ImageCache
ImageCache()
Definition: imagecache.h:31
QHash< QString, QImage >
Practice::ImageCache
Definition: imagecache.h:28
QString
Practice::operator<<
QDebug operator<<(QDebug dbg, const Practice::ImageCache &c)
Definition: imagecache.cpp:101
QList< QDateTime >
Practice::ImageCache::operator<<
friend QDebug operator<<(QDebug dbg, const Practice::ImageCache &c)
QStringList
Practice::ImageCache::saveCache
void saveCache()
Definition: imagecache.cpp:91
Practice::ImageCache::imageSize
QSize imageSize(const QString &id)
Definition: imagecache.cpp:44
Practice::ImageCache::updateImage
void updateImage(const QString &id, const QImage &image)
Definition: imagecache.cpp:39
QSize
Practice::ImageCache::getImage
QImage getImage(const QString &id)
Definition: imagecache.cpp:52
Practice::ImageCache::isEmpty
bool isEmpty()
Definition: imagecache.h:38
QImage
Practice::ImageCache::openCache
void openCache()
Definition: imagecache.cpp:60
QDebug
QHash::isEmpty
bool isEmpty() const
Practice::ImageCache::setFilenames
void setFilenames(const QStringList &filename)
Definition: imagecache.cpp:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal