Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
qgsapplication.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsapplication.h - Accessors for application-wide data
3  --------------------------------------
4  Date : 02-Jan-2006
5  Copyright : (C) 2006 by Tom Elwertowski
6  Email : telwertowski at users dot sourceforge dot net
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 /* $Id$ */
16 #ifndef QGSAPPLICATION_H
17 #define QGSAPPLICATION_H
18 
19 #include <QApplication>
20 #include <QEvent>
21 
22 #include <qgis.h>
23 
24 #define ABISYM(x) x ## VERSION_INT
25 
30 class CORE_EXPORT QgsApplication: public QApplication
31 {
32  Q_OBJECT
33  public:
35  QgsApplication( int & argc, char ** argv, bool GUIenabled, QString customConfigPath = QString() );
36  virtual ~QgsApplication();
37 
39  virtual bool event( QEvent * event );
40 
42  virtual bool notify( QObject * receiver, QEvent * event );
43 
45  static void setFileOpenEventReceiver( QObject * receiver );
46 
56  static void setThemeName( const QString theThemeName );
57 
64  static const QString themeName() ;
65 
67  static const QString authorsFilePath();
68 
73  static const QString contributorsFilePath();
74 
77  static const QString sponsorsFilePath();
78 
81  static const QString donorsFilePath();
82 
87  static const QString translatorsFilePath();
88 
90  static const QString developerPath();
91 
93  static const QString helpAppPath();
94 
96  static const QString i18nPath();
97 
99  static const QString qgisMasterDbFilePath();
100 
102  static const QString qgisSettingsDirPath();
103 
105  static const QString qgisUserDbFilePath();
106 
108  static const QString splashPath();
109 
111  static const QString iconsPath();
112 
114  static const QString srsDbFilePath();
115 
118  static const QStringList svgPaths();
119 
122  Q_DECL_DEPRECATED static const QString svgPath();
123 
125  static const QString prefixPath();
126 
128  static const QString pluginPath();
129 
131  static const QString pkgDataPath();
132 
134  static const QString activeThemePath();
135 
137  static const QString defaultThemePath();
138 
142  static QString iconPath( QString iconFile );
143 
145  static const QString userStyleV2Path();
146 
148  static const QString defaultStyleV2Path();
149 
151  static void setPrefixPath( const QString thePrefixPath, bool useDefaultPaths = false );
152 
154  static void setPluginPath( const QString thePluginPath );
155 
157  static void setPkgDataPath( const QString thePkgDataPath );
158 
160  static void setDefaultSvgPaths( const QStringList& pathList );
161 
163  static void initQgis();
164 
166  static void exitQgis();
167 
169  typedef enum ENDIAN
170  {
171  XDR = 0, // network, or big-endian, byte order
172  NDR = 1 // little-endian byte order
173  }
174  endian_t;
175 
177  static endian_t endian();
178 
187  static QString reportStyleSheet();
190  static QString showSettings();
197  static void registerOgrDrivers();
198 
201  static QString absolutePathToRelativePath( QString apath, QString targetPath );
204  static QString relativePathToAbsolutePath( QString rpath, QString targetPath );
205 
206  private:
207  static QObject* ABISYM( mFileOpenEventReceiver );
208  static QStringList ABISYM( mFileOpenEventList );
209 
210  static QString ABISYM( mPrefixPath );
211  static QString ABISYM( mPluginPath );
212  static QString ABISYM( mPkgDataPath );
213  static QString ABISYM( mThemeName );
214  static QStringList ABISYM( mDefaultSvgPaths );
215 
216  static QString ABISYM( mConfigPath );
217 };
218 
219 #endif