| 1 |
/* |
| 2 |
Copyright (C) 2009-2010 wxLauncher Team |
| 3 |
|
| 4 |
This program is free software; you can redistribute it and/or |
| 5 |
modify it under the terms of the GNU General Public License |
| 6 |
as published by the Free Software Foundation; either version 2 |
| 7 |
of the License, or (at your option) any later version. |
| 8 |
|
| 9 |
This program is distributed in the hope that it will be useful, |
| 10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
GNU General Public License for more details. |
| 13 |
|
| 14 |
You should have received a copy of the GNU General Public License |
| 15 |
along with this program; if not, write to the Free Software |
| 16 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifndef TCMANAGER_H |
| 20 |
#define TCMANAGER_H |
| 21 |
|
| 22 |
#include <wx/wx.h> |
| 23 |
#include <wx/clntdata.h> |
| 24 |
#include <wx/filename.h> |
| 25 |
|
| 26 |
#include "apis/EventHandlers.h" |
| 27 |
|
| 28 |
/** Selected TC has changed. */ |
| 29 |
LAUNCHER_DECLARE_EVENT_TYPE(EVT_TC_CHANGED); |
| 30 |
/** Selected binary has changed. */ |
| 31 |
LAUNCHER_DECLARE_EVENT_TYPE(EVT_TC_BINARY_CHANGED); |
| 32 |
/** Active mod has changed. */ |
| 33 |
LAUNCHER_DECLARE_EVENT_TYPE(EVT_TC_ACTIVE_MOD_CHANGED); |
| 34 |
/** Selected FRED binary has changed. */ |
| 35 |
LAUNCHER_DECLARE_EVENT_TYPE(EVT_TC_FRED_BINARY_CHANGED); |
| 36 |
|
| 37 |
class TCManager: public wxEvtHandler { |
| 38 |
public: |
| 39 |
~TCManager(); |
| 40 |
|
| 41 |
static void Initialize(); |
| 42 |
static void DeInitialize(); |
| 43 |
static bool IsInitialized(); |
| 44 |
static TCManager* Get(); |
| 45 |
private: |
| 46 |
TCManager(); |
| 47 |
static TCManager *manager; |
| 48 |
|
| 49 |
public: |
| 50 |
void CurrentProfileChanged(wxCommandEvent &event); |
| 51 |
// Events |
| 52 |
public: |
| 53 |
static void RegisterTCChanged(wxEvtHandler *handler); |
| 54 |
static void UnRegisterTCChanged(wxEvtHandler *handler); |
| 55 |
static void RegisterTCBinaryChanged(wxEvtHandler *handler); |
| 56 |
static void UnRegisterTCBinaryChanged(wxEvtHandler *handler); |
| 57 |
static void RegisterTCActiveModChanged(wxEvtHandler *handler); |
| 58 |
static void UnRegisterTCActiveModChanged(wxEvtHandler *handler); |
| 59 |
static void RegisterTCFredBinaryChanged(wxEvtHandler *handler); |
| 60 |
static void UnRegisterTCFredBinaryChanged(wxEvtHandler *handler); |
| 61 |
static void GenerateTCChanged(); |
| 62 |
static void GenerateTCBinaryChanged(); |
| 63 |
static void GenerateTCActiveModChanged(); |
| 64 |
static void GenerateTCFredBinaryChanged(); |
| 65 |
private: |
| 66 |
static EventHandlers TCChangedHandlers, |
| 67 |
TCBinaryChangedHandlers, |
| 68 |
TCActiveModChangedHandlers, |
| 69 |
TCFredBinaryChangedHandlers; |
| 70 |
DECLARE_EVENT_TABLE(); |
| 71 |
}; |
| 72 |
#endif |