src/core/main.h
00001 //------------------------------------------------------------------------------
00002 // main.h
00003 //------------------------------------------------------------------------------
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018 // 02110-1301, USA.
00019 //
00020 //------------------------------------------------------------------------------
00021 // Copyright (C) 2009 "Blzut3" <admin@maniacsvault.net>
00022 //------------------------------------------------------------------------------
00023 
00024 #ifndef __MAIN_H__
00025 #define __MAIN_H__
00026 
00027 #include "ini/ini.h"
00028 #include "ip2c/ip2c.h"
00029 #include "plugins/pluginloader.h"
00030 #include "datapaths.h"
00031 #include "refresher.h"
00032 #include <QApplication>
00033 #include <QObject>
00034 #include <QStringList>
00035 
00039 class MAIN_EXPORT Main : public QObject
00040 {
00041         public:
00042                 static const QString            IP2C_FILENAME;
00043 
00044                 static IP2C                                     *ip2c;
00045                 static DataPaths*                       dataPaths;
00046                 static QWidget*                         mainWindow;
00047                 static PluginLoader*            enginePlugins;
00048                 static bool                                     running; 
00049                 static RefreshingThread*        refreshingThread;
00050                 static QString                          workingDirectory;
00051 
00052                 Main(int argc, char* argv[]);
00053                 ~Main();
00054 
00060                 void                                            finalize();
00061 
00065                 int                                                     run();
00066 
00067         protected:
00068                 static const QString            DOOMSEEKER_CONFIG_FILENAME;
00069                 static const QString            DOOMSEEKER_INI_FILENAME;
00070                 static const QString            DOOMSEEKER_IRC_INI_FILENAME;
00071 
00072                 void                                            convertCfgToIni();
00073                 void                                            convertOldIniToQSettingsIni();
00074 
00075                 void                                            createMainWindow();
00076                 bool                                            createRemoteConsole();
00077 
00078                 int                                                     runTestMode();
00079 
00085                 bool                                            initDataDirectories();
00086 
00092                 int                                                     initIP2C();
00093                 void                                            initIRCConfig();
00094                 void                                            initMainConfig();
00095                 void                                            initPluginConfig();
00096 
00101                 bool                                            interpretCommandLineParameters();
00102                 void                                            preserveOldConfigBackwardsCompatibility();
00103                 void                                            setupRefreshingThread();
00104 
00105                 QApplication*                           application;
00106                 char**                                          arguments;
00107                 int                                                     argumentsCount;
00108                 bool                        bIsFirstRun;
00109                 bool                                            bPortableMode;
00110                 bool                                            bTestMode;
00111                 QStringList                             dataDirectories;
00112                 QString                                         rconPluginName; 
00113                 QString                                         rconAddress;
00114                 unsigned short                          rconPort;
00115                 bool                                            startRcon;
00116 };
00117 
00118 #endif /* __MAIN_H__ */
 All Classes Files Functions Variables Typedefs Enumerations Enumerator