Quantum GIS API Documentation  master-ce49b66
src/core/qgsapplication.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     qgsapplication.h - Accessors for application-wide data
00003      --------------------------------------
00004     Date                 : 02-Jan-2006
00005     Copyright            : (C) 2006 by Tom Elwertowski
00006     Email                : telwertowski at users dot sourceforge dot net
00007  ***************************************************************************
00008  *                                                                         *
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; either version 2 of the License, or     *
00012  *   (at your option) any later version.                                   *
00013  *                                                                         *
00014  ***************************************************************************/
00015 #ifndef QGSAPPLICATION_H
00016 #define QGSAPPLICATION_H
00017 
00018 #include <QApplication>
00019 #include <QEvent>
00020 #include <QStringList>
00021 
00022 #include <qgis.h>
00023 #include <qgsconfig.h>
00024 
00029 class CORE_EXPORT QgsApplication: public QApplication
00030 {
00031     Q_OBJECT
00032   public:
00034     QgsApplication( int & argc, char ** argv, bool GUIenabled, QString customConfigPath = QString() );
00035     virtual ~QgsApplication();
00036 
00042     static void init( QString customConfigPath = QString() );
00043 
00045     virtual bool event( QEvent * event );
00046 
00048     virtual bool notify( QObject * receiver, QEvent * event );
00049 
00051     static void setFileOpenEventReceiver( QObject * receiver );
00052 
00062     static void setThemeName( const QString theThemeName );
00063 
00070     static const QString themeName();
00071 
00073     static const QString authorsFilePath();
00074 
00079     static const QString contributorsFilePath();
00080 
00083     static const QString sponsorsFilePath();
00084 
00087     static const QString donorsFilePath();
00088 
00093     static const QString translatorsFilePath();
00094 
00096     static const QString helpAppPath();
00097 
00099     static const QString i18nPath();
00100 
00102     static const QString qgisMasterDbFilePath();
00103 
00105     static const QString qgisSettingsDirPath();
00106 
00108     static const QString qgisUserDbFilePath();
00109 
00111     static const QString splashPath();
00112 
00114     static const QString iconsPath();
00115 
00117     static const QString srsDbFilePath();
00118 
00121     static const QStringList svgPaths();
00122 
00125     static const QMap<QString, QString> systemEnvVars() { return ABISYM( mSystemEnvVars ); }
00126 
00128     static const QString prefixPath();
00129 
00131     static const QString pluginPath();
00132 
00134     static const QString pkgDataPath();
00135 
00137     static const QString activeThemePath();
00138 
00140     static const QString defaultThemePath();
00141 
00145     static QString iconPath( QString iconFile );
00146 
00150     static QIcon getThemeIcon( const QString theName );
00151 
00155     static QPixmap getThemePixmap( const QString theName );
00156 
00158     static const QString userStyleV2Path();
00159 
00161     static const QString defaultStyleV2Path();
00162 
00165     static const QString libraryPath();
00166 
00169     static const QString libexecPath();
00170 
00172     static void setPrefixPath( const QString thePrefixPath, bool useDefaultPaths = false );
00173 
00175     static void setPluginPath( const QString thePluginPath );
00176 
00178     static void setPkgDataPath( const QString thePkgDataPath );
00179 
00181     static void setDefaultSvgPaths( const QStringList& pathList );
00182 
00184     static void initQgis();
00185 
00187     static void exitQgis();
00188 
00190     typedef enum ENDIAN
00191     {
00192       XDR = 0,  // network, or big-endian, byte order
00193       NDR = 1   // little-endian byte order
00194     }
00195     endian_t;
00196 
00198     static endian_t endian();
00199 
00208     static QString reportStyleSheet();
00209 
00212     static QString showSettings();
00213 
00220     static void registerOgrDrivers();
00221 
00224     static QString absolutePathToRelativePath( QString apath, QString targetPath );
00227     static QString relativePathToAbsolutePath( QString rpath, QString targetPath );
00228 
00231     static bool isRunningFromBuildDir() { return ABISYM( mRunningFromBuildDir ); }
00232 #ifdef _MSC_VER
00233     static QString cfgIntDir() { return ABISYM( mCfgIntDir ); }
00234 #endif
00235 
00237     static QString buildSourcePath() { return ABISYM( mBuildSourcePath ); }
00240     static QString buildOutputPath() { return ABISYM( mBuildOutputPath ); }
00241 
00247     static void skipGdalDriver( QString theDriver );
00248 
00254     static void restoreGdalDriver( QString theDriver );
00255 
00260     static QStringList skippedGdalDrivers( ) { return ABISYM( mGdalSkipList ); }
00261 
00267     static void applyGdalSkippedDrivers();
00268 
00269   signals:
00271     void preNotify( QObject * receiver, QEvent * event, bool * done );
00272 
00273   private:
00274     static QObject* ABISYM( mFileOpenEventReceiver );
00275     static QStringList ABISYM( mFileOpenEventList );
00276 
00277     static QString ABISYM( mPrefixPath );
00278     static QString ABISYM( mPluginPath );
00279     static QString ABISYM( mPkgDataPath );
00280     static QString ABISYM( mLibraryPath );
00281     static QString ABISYM( mLibexecPath );
00282     static QString ABISYM( mThemeName );
00283     static QStringList ABISYM( mDefaultSvgPaths );
00284     static QMap<QString, QString> ABISYM( mSystemEnvVars );
00285 
00286     static QString ABISYM( mConfigPath );
00287 
00289     static bool ABISYM( mRunningFromBuildDir );
00291     static QString ABISYM( mBuildSourcePath );
00292 #ifdef _MSC_VER
00293 
00294     static QString ABISYM( mCfgIntDir );
00295 #endif
00296 
00297     static QString ABISYM( mBuildOutputPath );
00301     static QStringList ABISYM( mGdalSkipList );
00302 };
00303 
00304 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines