2020-01-18 09:38:21 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
|
|
* list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2019-03-15 12:14:23 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "IRCClient.h"
|
2019-03-16 01:15:19 +01:00
|
|
|
#include "IRCWindow.h"
|
2020-02-06 20:33:02 +01:00
|
|
|
#include <LibGUI/Widget.h>
|
|
|
|
#include <LibGUI/Window.h>
|
2019-03-15 12:14:23 +01:00
|
|
|
|
2020-02-02 15:07:41 +01:00
|
|
|
class IRCAppWindow : public GUI::Window {
|
2020-02-23 09:29:35 +01:00
|
|
|
C_OBJECT(IRCAppWindow);
|
2020-05-28 14:11:51 +02:00
|
|
|
|
2019-03-15 12:14:23 +01:00
|
|
|
public:
|
|
|
|
virtual ~IRCAppWindow() override;
|
|
|
|
|
2019-07-13 11:54:01 +02:00
|
|
|
static IRCAppWindow& the();
|
|
|
|
|
|
|
|
void set_active_window(IRCWindow&);
|
|
|
|
|
2019-03-15 12:14:23 +01:00
|
|
|
private:
|
2020-04-22 21:57:45 +00:00
|
|
|
IRCAppWindow(String server, int port);
|
2020-02-23 09:29:35 +01:00
|
|
|
|
2019-03-15 12:14:23 +01:00
|
|
|
void setup_client();
|
2019-03-16 01:10:48 +01:00
|
|
|
void setup_actions();
|
|
|
|
void setup_menus();
|
2019-03-15 12:14:23 +01:00
|
|
|
void setup_widgets();
|
2019-03-20 04:21:58 +01:00
|
|
|
void update_title();
|
2020-04-02 13:19:15 +00:00
|
|
|
void update_gui_actions();
|
2019-03-15 12:14:23 +01:00
|
|
|
|
2020-02-23 12:07:13 +01:00
|
|
|
NonnullRefPtr<IRCWindow> create_window(void* owner, IRCWindow::Type, const String& name);
|
2020-02-23 09:29:35 +01:00
|
|
|
NonnullRefPtr<IRCClient> m_client;
|
2020-02-02 15:07:41 +01:00
|
|
|
RefPtr<GUI::StackWidget> m_container;
|
|
|
|
RefPtr<GUI::TableView> m_window_list;
|
|
|
|
RefPtr<GUI::Action> m_join_action;
|
2020-04-01 10:52:35 +00:00
|
|
|
RefPtr<GUI::Action> m_list_channels_action;
|
2020-02-02 15:07:41 +01:00
|
|
|
RefPtr<GUI::Action> m_part_action;
|
2020-04-02 10:03:42 +00:00
|
|
|
RefPtr<GUI::Action> m_cycle_channel_action;
|
2020-02-02 15:07:41 +01:00
|
|
|
RefPtr<GUI::Action> m_whois_action;
|
|
|
|
RefPtr<GUI::Action> m_open_query_action;
|
|
|
|
RefPtr<GUI::Action> m_close_query_action;
|
|
|
|
RefPtr<GUI::Action> m_change_nick_action;
|
2020-04-01 10:52:35 +00:00
|
|
|
RefPtr<GUI::Action> m_change_topic_action;
|
2020-04-02 10:03:42 +00:00
|
|
|
RefPtr<GUI::Action> m_invite_user_action;
|
2020-04-05 10:36:35 +00:00
|
|
|
RefPtr<GUI::Action> m_banlist_action;
|
2020-04-02 10:03:42 +00:00
|
|
|
RefPtr<GUI::Action> m_voice_user_action;
|
|
|
|
RefPtr<GUI::Action> m_devoice_user_action;
|
2020-04-08 17:12:37 +00:00
|
|
|
RefPtr<GUI::Action> m_hop_user_action;
|
|
|
|
RefPtr<GUI::Action> m_dehop_user_action;
|
2020-04-02 10:03:42 +00:00
|
|
|
RefPtr<GUI::Action> m_op_user_action;
|
|
|
|
RefPtr<GUI::Action> m_deop_user_action;
|
2020-04-01 10:52:35 +00:00
|
|
|
RefPtr<GUI::Action> m_kick_user_action;
|
2019-03-15 12:14:23 +01:00
|
|
|
};
|