Mana
Loading...
Searching...
No Matches
customserverdialog.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2011-2012 The Mana Developers
4 *
5 * This file is part of The Mana Client.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
23#include "gui/widgets/window.h"
24
25#include <guichan/actionlistener.hpp>
26#include <guichan/keylistener.hpp>
27#include <guichan/listmodel.hpp>
28
29#include <memory>
30
31class Button;
32class DropDown;
33class ServerDialog;
34class TextField;
35
39class TypeListModel : public gcn::ListModel
40{
41 public:
43
47 int getNumberOfElements() override { return 2; }
48
52 std::string getElementAt(int elementIndex) override;
53};
54
61 public gcn::ActionListener,
62 public gcn::KeyListener
63{
64 public:
65 CustomServerDialog(ServerDialog *parent, int index = -1);
67
71 void action(const gcn::ActionEvent &event) override;
72
73 void keyPressed(gcn::KeyEvent &keyEvent) override;
74
75 private:
82#ifdef MANASERV_SUPPORT
83 DropDown *mTypeField;
84 std::unique_ptr<TypeListModel> mTypeListModel;
85#endif
87 // The index of the entry to modify, -1 when only adding a new entry.
88 int mIndex;
89};
Button widget.
Definition button.h:38
The custom server addition dialog.
TextField * mServerAddressField
TextField * mDescriptionField
~CustomServerDialog() override
void action(const gcn::ActionEvent &event) override
Called when receiving actions from the widgets.
void keyPressed(gcn::KeyEvent &keyEvent) override
ServerDialog * mServerDialog
A drop down box from which you can select different values.
Definition dropdown.h:34
The server choice dialog.
A text field.
Definition textfield.h:72
Server Type List Model.
std::string getElementAt(int elementIndex) override
Used to get an element from the list.
int getNumberOfElements() override
Used to get number of line in the list.
A window.
Definition window.h:59