/* * 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 CONFIGHANDLER_H #define CONFIGHANDLER_H #include #include #include "Utils.h" #include "ConfigValue.h" // General LostIRC options. class Options : public baseConfig { public: Options(const char *filename); Value nickcompletion_char; Value buffer_size; Value window_width; Value window_height; Value window_x; Value window_y; Value realname; Value nick; Value ircuser; Value dccip; Value dccport; Value highlight_words; Value font; Value strip_colors; Value strip_boldandunderline; Value logging; Value encoding; Value hidenicklist; Value hidemenu; Value hidestatusbar; Value colorscheme; }; // Color definitions used by frontend. class Colors1 : public baseConfig { public: Colors1(const char *filename); Value bgcolor; Value color0; Value color1; Value color2; Value color3; Value color4; Value color5; Value color6; Value color7; Value color8; Value color9; Value color10; Value color11; Value color12; Value color13; Value color14; Value color15; Value color16; Value color17; Value color18; Value color19; }; class Colors2 : public baseConfig { public: Colors2(const char *filename); Value bgcolor; Value color0; Value color1; Value color2; Value color3; Value color4; Value color5; Value color6; Value color7; Value color8; Value color9; Value color10; Value color11; Value color12; Value color13; Value color14; Value color15; Value color16; Value color17; Value color18; Value color19; }; // The different events which can occur. class Events : public baseConfig { public: Events(const char *filename); Value privmsg; Value privmsg_highlight; Value privmsg_self; Value action; Value action_highlight; Value dcc_receive; Value servermsg1; Value servermsg2; Value clientmsg; Value ctcp; Value ctcp_multi; Value ctcp_reply; Value topicchange; Value topicis; Value topictime; Value noticepriv; Value noticepubl; Value error; Value away; Value banlist; Value unknown; Value join; Value part; Value part2; Value quit; Value quit2; Value nick; Value mode; Value cmode; Value wallops; Value kicked; Value opped; Value deopped; Value admined; Value deadmined; Value ownered; Value deownered; Value voiced; Value devoiced; Value halfopped; Value halfdeopped; Value banned; Value unbanned; Value invited; Value connecting; Value names; Value killed; Value whois_user; Value whois_channels; Value whois_server; Value whois_generic; }; struct Server { Server() : port(6667), auto_connect(false) { } Glib::ustring hostname; int port; Glib::ustring nick; Glib::ustring password; std::vector cmds; bool auto_connect; }; // The "auto-join servers" configuration interface. class Servers { std::vector _servers; public: Servers(const char *file); ~Servers(); void addServer(Server* a) { _servers.push_back(a); } void removeServer(Server* a); // return "auto-join list" const std::vector& getServers() { return _servers; } bool hasAutoConnects(); // write server list bool writeServersFile(); private: bool readServersFile(); Glib::ustring filename; }; #endif