00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
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
00024 #define ABISYM(x) x ## VERSION_INT
00025
00030 class CORE_EXPORT QgsApplication: public QApplication
00031 {
00032 Q_OBJECT
00033 public:
00035 QgsApplication( int & argc, char ** argv, bool GUIenabled, QString customConfigPath = QString() );
00036 virtual ~QgsApplication();
00037
00043 static void init( QString customConfigPath = QString() );
00044
00046 virtual bool event( QEvent * event );
00047
00049 virtual bool notify( QObject * receiver, QEvent * event );
00050
00052 static void setFileOpenEventReceiver( QObject * receiver );
00053
00063 static void setThemeName( const QString theThemeName );
00064
00071 static const QString themeName() ;
00072
00074 static const QString authorsFilePath();
00075
00080 static const QString contributorsFilePath();
00081
00084 static const QString sponsorsFilePath();
00085
00088 static const QString donorsFilePath();
00089
00094 static const QString translatorsFilePath();
00095
00098 Q_DECL_DEPRECATED static const QString developerPath();
00099
00101 static const QString helpAppPath();
00102
00104 static const QString i18nPath();
00105
00107 static const QString qgisMasterDbFilePath();
00108
00110 static const QString qgisSettingsDirPath();
00111
00113 static const QString qgisUserDbFilePath();
00114
00116 static const QString splashPath();
00117
00119 static const QString iconsPath();
00120
00122 static const QString srsDbFilePath();
00123
00126 static const QStringList svgPaths();
00127
00130 Q_DECL_DEPRECATED static const QString svgPath();
00131
00133 static const QString prefixPath();
00134
00136 static const QString pluginPath();
00137
00139 static const QString pkgDataPath();
00140
00142 static const QString activeThemePath();
00143
00145 static const QString defaultThemePath();
00146
00150 static QString iconPath( QString iconFile );
00151
00153 static const QString userStyleV2Path();
00154
00156 static const QString defaultStyleV2Path();
00157
00160 static const QString libraryPath();
00161
00164 static const QString libexecPath();
00165
00167 static void setPrefixPath( const QString thePrefixPath, bool useDefaultPaths = false );
00168
00170 static void setPluginPath( const QString thePluginPath );
00171
00173 static void setPkgDataPath( const QString thePkgDataPath );
00174
00176 static void setDefaultSvgPaths( const QStringList& pathList );
00177
00179 static void initQgis();
00180
00182 static void exitQgis();
00183
00185 typedef enum ENDIAN
00186 {
00187 XDR = 0,
00188 NDR = 1
00189 }
00190 endian_t;
00191
00193 static endian_t endian();
00194
00203 static QString reportStyleSheet();
00206 static QString showSettings();
00213 static void registerOgrDrivers();
00214
00217 static QString absolutePathToRelativePath( QString apath, QString targetPath );
00220 static QString relativePathToAbsolutePath( QString rpath, QString targetPath );
00221
00224 static bool isRunningFromBuildDir() { return ABISYM( mRunningFromBuildDir ); }
00225 #ifdef _MSC_VER
00226 static QString cfgIntDir() { return ABISYM( mCfgIntDir ); }
00227 #endif
00228
00230 static QString buildSourcePath() { return ABISYM( mBuildSourcePath ); }
00233 static QString buildOutputPath() { return ABISYM( mBuildOutputPath ); }
00234
00240 static void skipGdalDriver( QString theDriver );
00241
00247 static void restoreGdalDriver( QString theDriver );
00248
00253 static QStringList skippedGdalDrivers( ) { return ABISYM( mGdalSkipList ); };
00254
00260 static void applyGdalSkippedDrivers();
00261
00262 signals:
00263 void preNotify( QObject * receiver, QEvent * event, bool * done );
00264
00265 private:
00266 static QObject* ABISYM( mFileOpenEventReceiver );
00267 static QStringList ABISYM( mFileOpenEventList );
00268
00269 static QString ABISYM( mPrefixPath );
00270 static QString ABISYM( mPluginPath );
00271 static QString ABISYM( mPkgDataPath );
00272 static QString ABISYM( mLibraryPath );
00273 static QString ABISYM( mLibexecPath );
00274 static QString ABISYM( mThemeName );
00275 static QStringList ABISYM( mDefaultSvgPaths );
00276
00277 static QString ABISYM( mConfigPath );
00278
00280 static bool ABISYM( mRunningFromBuildDir );
00282 static QString ABISYM( mBuildSourcePath );
00283 #ifdef _MSC_VER
00284
00285 static QString ABISYM( mCfgIntDir );
00286 #endif
00287
00288 static QString ABISYM( mBuildOutputPath );
00292 static QStringList ABISYM( mGdalSkipList );
00293 };
00294
00295 #endif