Scribus
Open source desktop publishing at your fingertips
iconmanager.h
1 /***************************************************************************
2  copyright : (C) 2015 by Craig Bradney
3  email : mrb@scribus.info
4 ***************************************************************************/
5 
6 /***************************************************************************
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 ***************************************************************************/
14 #ifndef ICONMANAGER_H
15 #define ICONMANAGER_H
16 
17 
18 #include <QMap>
19 #include <QObject>
20 #include <QString>
21 
22 #include "prefsstructs.h"
23 #include "scribusapi.h"
24 #include "scpixmapcache.h"
25 
26 class PrefsFile;
27 class ScribusMainWindow;
28 
29 
34 class SCRIBUS_API IconManager : public QObject
35 {
36 
37  Q_OBJECT
38 
39  public:
40  IconManager(QObject *parent = 0);
41  ~IconManager();
42 
47  static IconManager* instance();
52  static void deleteInstance();
53  bool setup();
54  QCursor loadCursor(const QString nam, int hotX = -1, int hotY = -1, bool forceUseColor=false);
55  QIcon loadIcon(const QString nam, bool forceUseColor=false);
56  QPixmap loadPixmap(const QString nam, bool forceUseColor=false);
57  QString pathForIcon(const QString nam);
58  QStringList pathList();
59  QStringList nameList(QString language);
60  void iconToGrayscale(QPixmap *pm);
61  bool setActiveFromPrefs(QString prefsSet);
62  QString activeSetBasename() { return m_activeSetBasename; }
63  QString baseNameForTranslation(QString transName);
64 
65  public slots:
66  void languageChange();
67 
68  private:
75  static IconManager* _instance;
76  QMap<QString, ScIconSetData> m_iconSets;
77  ScPixmapCache<QString> m_pxCache;
78  QString m_activeSetBasename;
79  QString m_activeSetVersion;
80  QString m_backupSetBasename;
81  QString m_backupSetVersion;
82 
83  bool initIcons();
84  void readIconConfigFiles();
85 
86 
87  signals:
88  void prefsChanged();
89 };
90 
91 #endif
Manage Scribus icons here, and here alone.
Definition: iconmanager.h:34
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: scribus.h:123
Definition: prefsfile.h:38