Always include the boost-package. Otherwise it won't get searched on a second run.
[amule.git] / src / amuleDlg.h
blob8eef3cc590b2f45d32bff9e2ef5139de619c7864
1 //
2 // This file is part of the aMule Project.
3 //
4 // Copyright (c) 2003-2011 aMule Team ( admin@amule.org / http://www.amule.org )
5 // Copyright (c) 2002-2011 Merkur ( devs@emule-project.net / http://www.emule-project.net )
6 //
7 // Any parts of this program derived from the xMule, lMule or eMule project,
8 // or contributed by third-party developers are copyrighted by their
9 // respective authors.
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 2 of the License, or
14 // (at your option) any later version.
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #ifndef AMULEDLG_H
27 #define AMULEDLG_H
30 #include <wx/archive.h>
31 #include <wx/filename.h>
32 #include <wx/frame.h> // Needed for wxFrame
33 #include <wx/imaglist.h>
34 #include <wx/timer.h>
35 #include <wx/wfstream.h>
36 #include <wx/zipstrm.h>
38 #include "Types.h" // Needed for uint32
39 #include "StatisticsDlg.h"
41 class wxTimerEvent;
42 class wxTextCtrl;
44 class CIP2Country;
45 class CTransferWnd;
46 class CServerWnd;
47 class CSharedFilesWnd;
48 class CSearchDlg;
49 class CChatWnd;
50 class CKadDlg;
51 class PrefsUnifiedDlg;
54 class CMuleTrayIcon;
56 struct PageType {
57 wxWindow* page;
58 wxString name;
61 #define MP_RESTORE 4001
62 #define MP_CONNECT 4002
63 #define MP_DISCONNECT 4003
64 #define MP_EXIT 4004
67 #define DEFAULT_SIZE_X 800
68 #define DEFAULT_SIZE_Y 600
71 enum ClientSkinEnum {
72 Client_Green_Smiley = 0,
73 Client_Red_Smiley,
74 Client_Yellow_Smiley,
75 Client_Grey_Smiley,
76 Client_White_Smiley,
77 Client_ExtendedProtocol_Smiley,
78 Client_SecIdent_Smiley,
79 Client_BadGuy_Smiley,
80 Client_CreditsGrey_Smiley,
81 Client_CreditsYellow_Smiley,
82 Client_Upload_Smiley,
83 Client_Friend_Smiley,
84 Client_eMule_Smiley,
85 Client_mlDonkey_Smiley,
86 Client_eDonkeyHybrid_Smiley,
87 Client_aMule_Smiley,
88 Client_lphant_Smiley,
89 Client_Shareaza_Smiley,
90 Client_xMule_Smiley,
91 Client_Unknown,
92 Client_InvalidRating_Smiley,
93 Client_PoorRating_Smiley,
94 Client_FairRating_Smiley,
95 Client_GoodRating_Smiley,
96 Client_ExcellentRating_Smiley,
97 Client_CommentOnly_Smiley,
98 Client_Encryption_Smiley,
99 // Add items here.
100 CLIENT_SKIN_SIZE
104 // CamuleDlg Dialogfeld
105 class CamuleDlg : public wxFrame
107 public:
108 CamuleDlg(
109 wxWindow *pParent = NULL,
110 const wxString &title = wxEmptyString,
111 wxPoint where = wxDefaultPosition,
112 wxSize dlg_size = wxSize(DEFAULT_SIZE_X,DEFAULT_SIZE_Y));
113 ~CamuleDlg();
115 void AddLogLine(const wxString& line);
116 void AddServerMessageLine(wxString& message);
117 void ResetLog(int id);
119 void ShowUserCount(const wxString& info = wxEmptyString);
120 void ShowConnectionState(bool skinChanged = false);
121 void ShowTransferRate();
123 bool StatisticsWindowActive()
124 { return (m_activewnd == static_cast<wxWindow*>(m_statisticswnd)); }
126 /* Returns the active dialog. Needed to check what to redraw. */
127 enum DialogType {
128 DT_TRANSFER_WND,
129 DT_NETWORKS_WND,
130 DT_SEARCH_WND,
131 DT_SHARED_WND,
132 DT_CHAT_WND,
133 DT_STATS_WND,
134 DT_KAD_WND // this one is still unused
136 DialogType GetActiveDialog()
137 { return m_nActiveDialog; }
138 void SetActiveDialog(DialogType type, wxWindow* dlg);
141 * Helper function for deciding if a certian dlg is visible.
143 * @return True if the dialog is visible to the user, false otherwise.
145 bool IsDialogVisible( DialogType dlg )
147 return m_nActiveDialog == dlg && m_is_safe_state /* && !IsIconized() */;
150 void ShowED2KLinksHandler( bool show );
152 void DlgShutDown();
153 void OnClose(wxCloseEvent& evt);
154 void OnBnConnect(wxCommandEvent& evt);
156 bool SafeState() { return m_is_safe_state; }
158 void LaunchUrl(const wxString &url);
160 void CreateSystray();
161 void RemoveSystray();
163 void StartGuiTimer() { gui_timer->Start(100); }
164 void StopGuiTimer() { gui_timer->Stop(); }
167 * This function ensures that _all_ list widgets are properly sorted.
169 void InitSort();
171 void SetMessageBlink(bool state) { m_BlinkMessages = state; }
172 void Create_Toolbar(bool orientation);
174 void DoNetworkRearrange();
176 CIP2Country* m_IP2Country;
177 void IP2CountryDownloadFinished(uint32 result);
178 void EnableIP2Country();
180 wxWindow* m_activewnd;
181 CTransferWnd* m_transferwnd;
182 CServerWnd* m_serverwnd;
183 CSharedFilesWnd* m_sharedfileswnd;
184 CSearchDlg* m_searchwnd;
185 CChatWnd* m_chatwnd;
186 CStatisticsDlg* m_statisticswnd;
187 CKadDlg* m_kademliawnd;
188 //! Pointer to the current preference dialog, if any.
189 PrefsUnifiedDlg* m_prefsDialog;
191 int m_srv_split_pos;
193 wxImageList m_imagelist;
194 wxImageList m_tblist;
196 protected:
197 void OnToolBarButton(wxCommandEvent& ev);
198 void OnAboutButton(wxCommandEvent& ev);
199 void OnPrefButton(wxCommandEvent& ev);
200 void OnImportButton(wxCommandEvent& ev);
201 void OnMinimize(wxIconizeEvent& evt);
202 void OnBnClickedFast(wxCommandEvent& evt);
203 void OnGUITimer(wxTimerEvent& evt);
204 void OnMainGUISizeChange(wxSizeEvent& evt);
205 void OnExit(wxCommandEvent& evt);
207 private:
208 //! Specifies if the prefs-dialog was shown before minimizing.
209 bool m_prefsVisible;
210 wxToolBar *m_wndToolbar;
211 wxTimer *gui_timer;
212 CMuleTrayIcon *m_wndTaskbarNotifier;
213 DialogType m_nActiveDialog;
214 bool m_is_safe_state;
215 bool m_BlinkMessages;
216 int m_CurrentBlinkBitmap;
217 uint32 m_last_iconizing;
218 wxFileName m_skinFileName;
219 std::vector<wxString> m_clientSkinNames;
220 bool m_GeoIPavailable;
222 WX_DECLARE_STRING_HASH_MAP(wxZipEntry*, ZipCatalog);
223 ZipCatalog cat;
225 PageType m_logpages[4];
226 PageType m_networkpages[2];
228 bool LoadGUIPrefs(bool override_pos, bool override_size);
229 bool SaveGUIPrefs();
231 void UpdateTrayIcon(int percent);
233 void Apply_Clients_Skin();
234 void Apply_Toolbar_Skin(wxToolBar *wndToolbar);
235 bool Check_and_Init_Skin();
236 void Add_Skin_Icon(const wxString &iconName, const wxBitmap &stdIcon, bool useSkins);
237 void ToogleED2KLinksHandler();
238 void SetMessagesTool();
239 void OnKeyPressed(wxKeyEvent& evt);
241 DECLARE_EVENT_TABLE()
244 #endif
246 // File_checked_for_headers