anatomist 6.0.4
3D neuroimaging data viewer
qWinFactory.h
Go to the documentation of this file.
1/* This software and supporting documentation are distributed by
2 * Institut Federatif de Recherche 49
3 * CEA/NeuroSpin, Batiment 145,
4 * 91191 Gif-sur-Yvette cedex
5 * France
6 *
7 * This software is governed by the CeCILL-B license under
8 * French law and abiding by the rules of distribution of free software.
9 * You can use, modify and/or redistribute the software under the
10 * terms of the CeCILL-B license as circulated by CEA, CNRS
11 * and INRIA at the following URL "http://www.cecill.info".
12 *
13 * As a counterpart to the access to the source code and rights to copy,
14 * modify and redistribute granted by the license, users are provided only
15 * with a limited warranty and the software's author, the holder of the
16 * economic rights, and the successive licensors have only limited
17 * liability.
18 *
19 * In this respect, the user's attention is drawn to the risks associated
20 * with loading, using, modifying and/or developing or reproducing the
21 * software by the user in light of its specific status of free software,
22 * that may mean that it is complicated to manipulate, and that also
23 * therefore means that it is reserved for developers and experienced
24 * professionals having in-depth computer knowledge. Users are therefore
25 * encouraged to load and test the software's suitability as regards their
26 * requirements in conditions enabling the security of their systems and/or
27 * data to be ensured and, more generally, to use and operate it in the
28 * same conditions as regards security.
29 *
30 * The fact that you are presently reading this means that you have had
31 * knowledge of the CeCILL-B license and that you accept its terms.
32 */
33
34
35#ifndef ANATOMIST_WINDOW_QWINFACTORY_H
36#define ANATOMIST_WINDOW_QWINFACTORY_H
37
39#include <qpixmap.h>
40#include <qstring.h>
41#include <qobject.h>
42
43
47class QAWindowFactory : public QObject, public anatomist::AWindowFactory
48{
49 Q_OBJECT
50
51public:
52 struct PixList
53 {
55 PixList( const QPixmap & s, const QPixmap & l, const QPixmap & a )
56 : psmall( s ), plarge( l ), pactive( a ) {}
57
58 QPixmap psmall;
60 QPixmap plarge;
62 QPixmap pactive;
63 };
64
65 struct Descrip
66 {
68 Descrip( const QString & b, const QString & l )
69 : brief( b ), longer( l ) {}
70
71 QString brief;
73 QString longer;
74 };
75
76 static const std::map<int, PixList> & pixmaps() { return( _pixmaps ); }
77 static const std::map<int, Descrip> & description()
78 { return( _description ); }
79 static const PixList & pixmaps( int type ) { return( _pixmaps[ type ] ); }
80 static const PixList & pixmaps( const std::string & type )
81 { return( _pixmaps[ typeID( type ) ] ); }
82 static const Descrip & description( int type )
83 { return( _description[ type ] ); }
84 static const Descrip & description( const std::string & type )
85 { return( _description[ typeID( type ) ] ); }
86 static void setPixmaps( int type, const PixList & pix )
87 { _pixmaps[ type ] = pix; }
88 static void setPixmaps( const std::string & type, const PixList & pix )
89 { _pixmaps[ typeID( type ) ] = pix; }
90 static void loadDefaultPixmaps( int type );
91 static void loadDefaultPixmaps( const std::string & type )
93 static void setDescription( int type, const Descrip & des )
94 { _description[ type ] = des; }
95 static void setDescription( const std::string & type, const Descrip & des )
96 { _description[ typeID( type ) ] = des; }
97
98protected:
99 static std::map<int, PixList> _pixmaps;
100 static std::map<int, Descrip> _description;
101};
102
103
104
105#endif
Specialized AWindowFactory storing Qt specific information about windows (QPixmaps,...
Definition qWinFactory.h:48
static const PixList & pixmaps(const std::string &type)
Definition qWinFactory.h:80
static void loadDefaultPixmaps(int type)
static void setPixmaps(int type, const PixList &pix)
Definition qWinFactory.h:86
static const std::map< int, Descrip > & description()
Definition qWinFactory.h:77
static const Descrip & description(int type)
Definition qWinFactory.h:82
static void setDescription(const std::string &type, const Descrip &des)
Definition qWinFactory.h:95
static void loadDefaultPixmaps(const std::string &type)
Definition qWinFactory.h:91
static std::map< int, PixList > _pixmaps
Definition qWinFactory.h:99
static const std::map< int, PixList > & pixmaps()
Definition qWinFactory.h:76
static const PixList & pixmaps(int type)
Definition qWinFactory.h:79
static std::map< int, Descrip > _description
static const Descrip & description(const std::string &type)
Definition qWinFactory.h:84
static void setDescription(int type, const Descrip &des)
Definition qWinFactory.h:93
static void setPixmaps(const std::string &type, const PixList &pix)
Definition qWinFactory.h:88
Window creator: (string) type -> new window.
Definition winFactory.h:60
static const std::map< std::string, int > & typeID()
Definition winFactory.h:82
QString brief
Brief description - short, in a few words.
Definition qWinFactory.h:71
Descrip(const QString &b, const QString &l)
Definition qWinFactory.h:68
QString longer
Longer description - a few lines max.
Definition qWinFactory.h:73
QPixmap plarge
Large pixmap (control window toolbar)
Definition qWinFactory.h:60
PixList(const QPixmap &s, const QPixmap &l, const QPixmap &a)
Definition qWinFactory.h:55
QPixmap pactive
Active large pixmap (control window toolbar)
Definition qWinFactory.h:62
QPixmap psmall
Small pixmap (windows list in control window)
Definition qWinFactory.h:58