/* * Copyright (C) 2002-2004 Morten Brix Pedersen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include #include #include #include #include #include #include #include "Prefs.h" #include "DCCList.h" #include "ServerWindow.h" #include "MainNotebook.h" #include "StatusBar.h" class MainWindow : public Gtk::Window, public FrontEnd { virtual bool on_key_press_event(GdkEventKey* e); LostIRCApp _app; MainNotebook _notebook; Glib::RefPtr _uimanager; std::auto_ptr _prefswin; std::auto_ptr _dccwin; std::auto_ptr _serverwin; std::auto_ptr _helpwin; std::auto_ptr _aboutwin; void openPrefs(); void openDccWindow(); void openServerWindow(); void openHelpIntro(); void hideHelpIntro(int response); void openAboutWindow(); void hideAboutWindow(int response); void setupMenus(); void closeCurrentTab(); void hideNickList(); void initializeTagTable(); void addToTable(Glib::ustring name, Glib::RefPtr table, const Glib::ustring& colorname); public: MainWindow(bool autoconnect = 0); virtual ~MainWindow(); MainNotebook& getNotebook() { return _notebook; } Glib::RefPtr getUIManager() { return _uimanager; } Tab* newServerTab(); void hideMenu(); void hideStatusbar(); StatusBar _statusbar; // Some of these should be private eventually. Glib::RefPtr _tag_table1; Glib::RefPtr _tag_table2; Glib::RefPtr _current_tag_table; Glib::ustring background_color; // Methods implemented for the abstract base class 'FrontEnd' void displayMessage(const Glib::ustring& msg, FE::Destination d, ServerConnection *conn = 0, bool shouldHighlight = true); void displayMessage(const Glib::ustring& msg, ChannelBase& to, ServerConnection *conn, bool shouldHighlight = true); void join(const Glib::ustring& nick, Channel& chan, ServerConnection *conn); void part(const Glib::ustring& nick, Channel& chan, ServerConnection *conn); void kick(const Glib::ustring& from, Channel& chan, const Glib::ustring& kicker, const Glib::ustring& msg, ServerConnection *conn); void quit(const Glib::ustring& nick, std::vector chans, ServerConnection *conn); void nick(const Glib::ustring& from, const Glib::ustring& to, std::vector chans, ServerConnection *conn); void CUMode(const Glib::ustring& nick, Channel& chan, const std::vector& users, ServerConnection *conn); void names(Channel& c, ServerConnection *conn); void highlight(ChannelBase& chan, ServerConnection *conn); void away(bool away, ServerConnection *conn); void connected(ServerConnection *conn); void newTab(ServerConnection *conn); void disconnected(ServerConnection *conn); void newDCC(DCC *dcc); void dccStatusChanged(DCC *dcc); void localeError(bool tried_custom_encoding); }; extern MainWindow* AppWin; #endif