From aa3f63fd497558a02feb3ddbc44f31eac091f39b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 10 Oct 2017 22:14:45 +0300 Subject: Remove most unused files. --- src/listeners/actionlistener.h | 108 ---------------- src/listeners/actorspritelistener.h | 51 -------- src/listeners/arrowslistener.cpp | 38 ------ src/listeners/arrowslistener.h | 40 ------ src/listeners/assertlistener.cpp | 41 ------ src/listeners/assertlistener.h | 47 ------- src/listeners/attributelistener.cpp | 40 ------ src/listeners/attributelistener.h | 46 ------- src/listeners/awaylistener.cpp | 48 -------- src/listeners/awaylistener.h | 39 ------ src/listeners/banklistener.cpp | 38 ------ src/listeners/banklistener.h | 40 ------ src/listeners/baselistener.hpp | 70 ----------- src/listeners/buyingstoremodelistener.cpp | 38 ------ src/listeners/buyingstoremodelistener.h | 40 ------ src/listeners/buyingstoreslotslistener.cpp | 38 ------ src/listeners/buyingstoreslotslistener.h | 40 ------ src/listeners/charrenamelistener.cpp | 48 -------- src/listeners/charrenamelistener.h | 54 -------- src/listeners/configlistener.h | 57 --------- src/listeners/debugmessagelistener.cpp | 38 ------ src/listeners/debugmessagelistener.h | 42 ------- src/listeners/errorlistener.cpp | 39 ------ src/listeners/errorlistener.h | 44 ------- src/listeners/focuslistener.h | 115 ----------------- src/listeners/gamemodifierlistener.cpp | 38 ------ src/listeners/gamemodifierlistener.h | 40 ------ src/listeners/guiconfiglistener.h | 61 --------- src/listeners/guitableactionlistener.cpp | 64 ---------- src/listeners/guitableactionlistener.h | 53 -------- src/listeners/inputactionremotelistener.cpp | 50 -------- src/listeners/inputactionremotelistener.h | 51 -------- src/listeners/inputactionreplaylistener.cpp | 66 ---------- src/listeners/inputactionreplaylistener.h | 55 --------- src/listeners/insertcardlistener.h | 54 -------- src/listeners/inventorylistener.h | 45 ------- src/listeners/keylistener.h | 118 ------------------ src/listeners/mouselistener.h | 185 ---------------------------- src/listeners/openurllistener.h | 52 -------- src/listeners/pincodelistener.cpp | 40 ------ src/listeners/pincodelistener.h | 42 ------- src/listeners/playerdeathlistener.cpp | 38 ------ src/listeners/playerdeathlistener.h | 40 ------ src/listeners/playerlistener.cpp | 51 -------- src/listeners/playerlistener.h | 56 --------- src/listeners/playerpostdeathlistener.h | 65 ---------- src/listeners/playerrelationslistener.h | 47 ------- src/listeners/renamelistener.cpp | 80 ------------ src/listeners/renamelistener.h | 51 -------- src/listeners/requestadoptchildlistener.h | 46 ------- src/listeners/requesttradelistener.h | 58 --------- src/listeners/selectionlistener.h | 112 ----------------- src/listeners/shoprenamelistener.cpp | 45 ------- src/listeners/shoprenamelistener.h | 48 -------- src/listeners/skillwarplistener.cpp | 48 -------- src/listeners/skillwarplistener.h | 52 -------- src/listeners/statlistener.cpp | 40 ------ src/listeners/statlistener.h | 46 ------- src/listeners/tablemodellistener.h | 54 -------- src/listeners/textskilllistener.cpp | 63 ---------- src/listeners/textskilllistener.h | 55 --------- src/listeners/tooltiplistener.cpp | 62 ---------- src/listeners/tooltiplistener.h | 51 -------- src/listeners/updatestatuslistener.cpp | 38 ------ src/listeners/updatestatuslistener.h | 40 ------ src/listeners/uploadlistener.cpp | 32 ----- src/listeners/uploadlistener.h | 44 ------- src/listeners/vendingmodelistener.cpp | 38 ------ src/listeners/vendingmodelistener.h | 40 ------ src/listeners/vendingslotslistener.cpp | 38 ------ src/listeners/vendingslotslistener.h | 40 ------ src/listeners/weightlistener.h | 50 -------- src/listeners/widgetdeathlistener.h | 105 ---------------- src/listeners/widgetlistener.h | 135 -------------------- src/listeners/wrongdatanoticelistener.cpp | 44 ------- src/listeners/wrongdatanoticelistener.h | 49 -------- 76 files changed, 4154 deletions(-) delete mode 100644 src/listeners/actionlistener.h delete mode 100644 src/listeners/actorspritelistener.h delete mode 100644 src/listeners/arrowslistener.cpp delete mode 100644 src/listeners/arrowslistener.h delete mode 100644 src/listeners/assertlistener.cpp delete mode 100644 src/listeners/assertlistener.h delete mode 100644 src/listeners/attributelistener.cpp delete mode 100644 src/listeners/attributelistener.h delete mode 100644 src/listeners/awaylistener.cpp delete mode 100644 src/listeners/awaylistener.h delete mode 100644 src/listeners/banklistener.cpp delete mode 100644 src/listeners/banklistener.h delete mode 100644 src/listeners/baselistener.hpp delete mode 100644 src/listeners/buyingstoremodelistener.cpp delete mode 100644 src/listeners/buyingstoremodelistener.h delete mode 100644 src/listeners/buyingstoreslotslistener.cpp delete mode 100644 src/listeners/buyingstoreslotslistener.h delete mode 100644 src/listeners/charrenamelistener.cpp delete mode 100644 src/listeners/charrenamelistener.h delete mode 100644 src/listeners/configlistener.h delete mode 100644 src/listeners/debugmessagelistener.cpp delete mode 100644 src/listeners/debugmessagelistener.h delete mode 100644 src/listeners/errorlistener.cpp delete mode 100644 src/listeners/errorlistener.h delete mode 100644 src/listeners/focuslistener.h delete mode 100644 src/listeners/gamemodifierlistener.cpp delete mode 100644 src/listeners/gamemodifierlistener.h delete mode 100644 src/listeners/guiconfiglistener.h delete mode 100644 src/listeners/guitableactionlistener.cpp delete mode 100644 src/listeners/guitableactionlistener.h delete mode 100644 src/listeners/inputactionremotelistener.cpp delete mode 100644 src/listeners/inputactionremotelistener.h delete mode 100644 src/listeners/inputactionreplaylistener.cpp delete mode 100644 src/listeners/inputactionreplaylistener.h delete mode 100644 src/listeners/insertcardlistener.h delete mode 100644 src/listeners/inventorylistener.h delete mode 100644 src/listeners/keylistener.h delete mode 100644 src/listeners/mouselistener.h delete mode 100644 src/listeners/openurllistener.h delete mode 100644 src/listeners/pincodelistener.cpp delete mode 100644 src/listeners/pincodelistener.h delete mode 100644 src/listeners/playerdeathlistener.cpp delete mode 100644 src/listeners/playerdeathlistener.h delete mode 100644 src/listeners/playerlistener.cpp delete mode 100644 src/listeners/playerlistener.h delete mode 100644 src/listeners/playerpostdeathlistener.h delete mode 100644 src/listeners/playerrelationslistener.h delete mode 100644 src/listeners/renamelistener.cpp delete mode 100644 src/listeners/renamelistener.h delete mode 100644 src/listeners/requestadoptchildlistener.h delete mode 100644 src/listeners/requesttradelistener.h delete mode 100644 src/listeners/selectionlistener.h delete mode 100644 src/listeners/shoprenamelistener.cpp delete mode 100644 src/listeners/shoprenamelistener.h delete mode 100644 src/listeners/skillwarplistener.cpp delete mode 100644 src/listeners/skillwarplistener.h delete mode 100644 src/listeners/statlistener.cpp delete mode 100644 src/listeners/statlistener.h delete mode 100644 src/listeners/tablemodellistener.h delete mode 100644 src/listeners/textskilllistener.cpp delete mode 100644 src/listeners/textskilllistener.h delete mode 100644 src/listeners/tooltiplistener.cpp delete mode 100644 src/listeners/tooltiplistener.h delete mode 100644 src/listeners/updatestatuslistener.cpp delete mode 100644 src/listeners/updatestatuslistener.h delete mode 100644 src/listeners/uploadlistener.cpp delete mode 100644 src/listeners/uploadlistener.h delete mode 100644 src/listeners/vendingmodelistener.cpp delete mode 100644 src/listeners/vendingmodelistener.h delete mode 100644 src/listeners/vendingslotslistener.cpp delete mode 100644 src/listeners/vendingslotslistener.h delete mode 100644 src/listeners/weightlistener.h delete mode 100644 src/listeners/widgetdeathlistener.h delete mode 100644 src/listeners/widgetlistener.h delete mode 100644 src/listeners/wrongdatanoticelistener.cpp delete mode 100644 src/listeners/wrongdatanoticelistener.h (limited to 'src/listeners') diff --git a/src/listeners/actionlistener.h b/src/listeners/actionlistener.h deleted file mode 100644 index 4303ddda3..000000000 --- a/src/listeners/actionlistener.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * - * - * Per Larsson a.k.a finalman - * Olof Naessén a.k.a jansem/yakslem - * - * Visit: http://guichan.sourceforge.net - * - * License: (BSD) - * 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. - * 3. Neither the name of Guichan nor the names of its contributors may - * be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 - * OWNER 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. - */ - -#ifndef LISTENERS_ACTIONLISTENER_H -#define LISTENERS_ACTIONLISTENER_H - -#include "events/actionevent.h" - -/** - * Interface for listening for action events from widgets. - * - * @see Widget::addActionListener, Widget::removeActionListener, - * ActionEvent - * @author Olof Naessén - * @author Per Larsson - */ -class ActionListener notfinal -{ - public: - A_DELETE_COPY(ActionListener) - - /** - * Destructor. - */ - virtual ~ActionListener() - { } - - /** - * Called when an action is recieved from a widget. It is used - * to be able to recieve a notification that an action has - * occured. - * - * @param actionEvent The event of the action. - */ - virtual void action(const ActionEvent &actionEvent) = 0; - - protected: - /** - * Constructor. - * - * You should not be able to make an instance of ActionListener, - * therefore its constructor is protected. - */ - ActionListener() - { } -}; - -#endif // LISTENERS_ACTIONLISTENER_H diff --git a/src/listeners/actorspritelistener.h b/src/listeners/actorspritelistener.h deleted file mode 100644 index 4f4bcd799..000000000 --- a/src/listeners/actorspritelistener.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_ACTORSPRITELISTENER_H -#define LISTENERS_ACTORSPRITELISTENER_H - -#include "localconsts.h" - -class ActorSprite; - -class ActorSpriteListener notfinal -{ - public: - ActorSpriteListener() - { } - - A_DELETE_COPY(ActorSpriteListener) - - /** - * Destructor. - */ - virtual ~ActorSpriteListener() - { } - - /** - * Called when the ActorSprite has been destroyed. The listener will - * have to be registered first. - * @param actorSprite the ActorSprite being destroyed. - */ - virtual void actorSpriteDestroyed(const ActorSprite &actorSprite) = 0; -}; - -#endif // LISTENERS_ACTORSPRITELISTENER_H diff --git a/src/listeners/arrowslistener.cpp b/src/listeners/arrowslistener.cpp deleted file mode 100644 index 3a647f6c1..000000000 --- a/src/listeners/arrowslistener.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/arrowslistener.h" - -#include "utils/foreach.h" - -#include "debug.h" - -defineListener(ArrowsListener) - -void ArrowsListener::distributeEvent() -{ - FOR_EACH (STD_VECTOR::iterator, - it, mListeners) - { - ArrowsListener *const listener = *it; - if (listener != nullptr) - listener->arrowsChanged(); - } -} diff --git a/src/listeners/arrowslistener.h b/src/listeners/arrowslistener.h deleted file mode 100644 index 5dfa68d6e..000000000 --- a/src/listeners/arrowslistener.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_ARROWSLISTENER_H -#define LISTENERS_ARROWSLISTENER_H - -#include "listeners/baselistener.hpp" - -#include "localconsts.h" - -class ArrowsListener notfinal -{ - public: - A_DELETE_COPY(ArrowsListener) - - virtual void arrowsChanged() = 0; - - static void distributeEvent(); - - defineListenerHeader(ArrowsListener) -}; - -#endif // LISTENERS_ARROWSLISTENER_H diff --git a/src/listeners/assertlistener.cpp b/src/listeners/assertlistener.cpp deleted file mode 100644 index 7df99d1fe..000000000 --- a/src/listeners/assertlistener.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2016-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/assertlistener.h" - -#include "debug.h" - -AssertListener *assertListener = nullptr; - -AssertListener::AssertListener() : - DebugMessageListener(), - mMessages() -{ -} - -void AssertListener::debugMessage(const std::string &msg) -{ - mMessages.push_back(msg); -} - -const StringVect &AssertListener::getMessages() const -{ - return mMessages; -} diff --git a/src/listeners/assertlistener.h b/src/listeners/assertlistener.h deleted file mode 100644 index 81712e7e2..000000000 --- a/src/listeners/assertlistener.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2016-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_ASSERTLISTENER_H -#define LISTENERS_ASSERTLISTENER_H - -#include "listeners/debugmessagelistener.h" - -#include "utils/stringvector.h" - -#include "localconsts.h" - -class AssertListener final : public DebugMessageListener -{ - public: - AssertListener(); - - A_DELETE_COPY(AssertListener) - - void debugMessage(const std::string &msg) override final; - - const StringVect &getMessages() const; - - private: - StringVect mMessages; -}; - -extern AssertListener *assertListener; - -#endif // LISTENERS_ASSERTLISTENER_H diff --git a/src/listeners/attributelistener.cpp b/src/listeners/attributelistener.cpp deleted file mode 100644 index 696f9a120..000000000 --- a/src/listeners/attributelistener.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/attributelistener.h" - -#include "utils/foreach.h" - -#include "debug.h" - -defineListener(AttributeListener) - -void AttributeListener::distributeEvent(const AttributesT id, - const int64_t oldVal, - const int64_t newVal) -{ - FOR_EACH (STD_VECTOR::iterator, - it, mListeners) - { - AttributeListener *const listener = *it; - if (listener != nullptr) - listener->attributeChanged(id, oldVal, newVal); - } -} diff --git a/src/listeners/attributelistener.h b/src/listeners/attributelistener.h deleted file mode 100644 index 87b634af2..000000000 --- a/src/listeners/attributelistener.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_ATTRIBUTELISTENER_H -#define LISTENERS_ATTRIBUTELISTENER_H - -#include "enums/being/attributes.h" - -#include "listeners/baselistener.hpp" - -#include "localconsts.h" - -class AttributeListener notfinal -{ - public: - A_DELETE_COPY(AttributeListener) - - virtual void attributeChanged(const AttributesT id, - const int64_t oldVal, - const int64_t newVal) = 0; - - static void distributeEvent(const AttributesT id, - const int64_t oldVal, - const int64_t newVal); - - defineListenerHeader(AttributeListener) -}; - -#endif // LISTENERS_ATTRIBUTELISTENER_H diff --git a/src/listeners/awaylistener.cpp b/src/listeners/awaylistener.cpp deleted file mode 100644 index 3261fe403..000000000 --- a/src/listeners/awaylistener.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/awaylistener.h" - -#include "gamemodifiers.h" -#include "settings.h" - -#include "being/localplayer.h" - -#include "gui/windows/outfitwindow.h" - -#include "listeners/updatestatuslistener.h" - -#include "debug.h" - -void AwayListener::action(const ActionEvent &event) -{ - if (event.getId() == "ok" && - localPlayer != nullptr && - settings.awayMode) - { - GameModifiers::changeAwayMode(true); - localPlayer->updateStatus(); - if (outfitWindow != nullptr) - outfitWindow->unwearAwayOutfit(); - UpdateStatusListener::distributeEvent(); - } -} diff --git a/src/listeners/awaylistener.h b/src/listeners/awaylistener.h deleted file mode 100644 index 08fa908c7..000000000 --- a/src/listeners/awaylistener.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_AWAYLISTENER_H -#define LISTENERS_AWAYLISTENER_H - -#include "listeners/actionlistener.h" - -#include "localconsts.h" - -class AwayListener final : public ActionListener -{ - public: - AwayListener() - { } - - A_DELETE_COPY(AwayListener) - - void action(const ActionEvent &event) override final; -}; - -#endif // LISTENERS_AWAYLISTENER_H diff --git a/src/listeners/banklistener.cpp b/src/listeners/banklistener.cpp deleted file mode 100644 index 8dfe1d808..000000000 --- a/src/listeners/banklistener.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/banklistener.h" - -#include "utils/foreach.h" - -#include "debug.h" - -defineListener(BankListener) - -void BankListener::distributeEvent(const int money) -{ - FOR_EACH (STD_VECTOR::iterator, - it, mListeners) - { - BankListener *const listener = *it; - if (listener != nullptr) - listener->bankMoneyChanged(money); - } -} diff --git a/src/listeners/banklistener.h b/src/listeners/banklistener.h deleted file mode 100644 index a71d13d05..000000000 --- a/src/listeners/banklistener.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_BANKLISTENER_H -#define LISTENERS_BANKLISTENER_H - -#include "listeners/baselistener.hpp" - -#include "localconsts.h" - -class BankListener notfinal -{ - public: - A_DELETE_COPY(BankListener) - - virtual void bankMoneyChanged(const int money) = 0; - - static void distributeEvent(const int money); - - defineListenerHeader(BankListener) -}; - -#endif // LISTENERS_BANKLISTENER_H diff --git a/src/listeners/baselistener.hpp b/src/listeners/baselistener.hpp deleted file mode 100644 index 7afb429d5..000000000 --- a/src/listeners/baselistener.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_BASELISTENER_HPP -#define LISTENERS_BASELISTENER_HPP - -#include "utils/vector.h" - -#define defineListener(name) \ - STD_VECTOR name::mListeners; \ - \ - name::name() \ - { \ - addListener(this); \ - } \ - \ - name::~name() \ - { \ - removeListener(this); \ - } \ - \ - void name::addListener(name *const listener) \ - { \ - if (listener) \ - mListeners.push_back(listener); \ - } \ - \ - void name::removeListener(const name *const listener) \ - { \ - STD_VECTOR::iterator it = mListeners.begin(); \ - while (it != mListeners.end()) \ - { \ - if (*it == listener) \ - it = mListeners.erase(it); \ - else \ - ++ it; \ - } \ - } - -#define defineListenerHeader(name) \ - public: \ - name(); \ - \ - virtual ~name(); \ - \ - static void addListener(name *const listener); \ - \ - static void removeListener(const name *const listener); \ - \ - private: \ - static STD_VECTOR mListeners; - -#endif // LISTENERS_BASELISTENER_HPP diff --git a/src/listeners/buyingstoremodelistener.cpp b/src/listeners/buyingstoremodelistener.cpp deleted file mode 100644 index 7ce95033c..000000000 --- a/src/listeners/buyingstoremodelistener.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/buyingstoremodelistener.h" - -#include "utils/foreach.h" - -#include "debug.h" - -defineListener(BuyingStoreModeListener) - -void BuyingStoreModeListener::distributeEvent(const bool b) -{ - FOR_EACH (STD_VECTOR::iterator, - it, mListeners) - { - BuyingStoreModeListener *const listener = *it; - if (listener != nullptr) - listener->buyingStoreEnabled(b); - } -} diff --git a/src/listeners/buyingstoremodelistener.h b/src/listeners/buyingstoremodelistener.h deleted file mode 100644 index 5da4e901e..000000000 --- a/src/listeners/buyingstoremodelistener.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_BUYINGSTOREMODELISTENER_H -#define LISTENERS_BUYINGSTOREMODELISTENER_H - -#include "listeners/baselistener.hpp" - -#include "localconsts.h" - -class BuyingStoreModeListener notfinal -{ - public: - A_DELETE_COPY(BuyingStoreModeListener) - - virtual void buyingStoreEnabled(const bool b) = 0; - - static void distributeEvent(const bool b); - - defineListenerHeader(BuyingStoreModeListener) -}; - -#endif // LISTENERS_BUYINGSTOREMODELISTENER_H diff --git a/src/listeners/buyingstoreslotslistener.cpp b/src/listeners/buyingstoreslotslistener.cpp deleted file mode 100644 index 5afeaaa48..000000000 --- a/src/listeners/buyingstoreslotslistener.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/buyingstoreslotslistener.h" - -#include "utils/foreach.h" - -#include "debug.h" - -defineListener(BuyingStoreSlotsListener) - -void BuyingStoreSlotsListener::distributeEvent(const int slots) -{ - FOR_EACH (STD_VECTOR::iterator, - it, mListeners) - { - BuyingStoreSlotsListener *const listener = *it; - if (listener != nullptr) - listener->buyingStoreSlotsChanged(slots); - } -} diff --git a/src/listeners/buyingstoreslotslistener.h b/src/listeners/buyingstoreslotslistener.h deleted file mode 100644 index d508069c3..000000000 --- a/src/listeners/buyingstoreslotslistener.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_BUYINGSTORESLOTSLISTENER_H -#define LISTENERS_BUYINGSTORESLOTSLISTENER_H - -#include "listeners/baselistener.hpp" - -#include "localconsts.h" - -class BuyingStoreSlotsListener notfinal -{ - public: - A_DELETE_COPY(BuyingStoreSlotsListener) - - virtual void buyingStoreSlotsChanged(const int slots) = 0; - - static void distributeEvent(const int slots); - - defineListenerHeader(BuyingStoreSlotsListener) -}; - -#endif // LISTENERS_BUYINGSTORESLOTSLISTENER_H diff --git a/src/listeners/charrenamelistener.cpp b/src/listeners/charrenamelistener.cpp deleted file mode 100644 index 0ac83b39c..000000000 --- a/src/listeners/charrenamelistener.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/charrenamelistener.h" - -#include "gui/windows/editdialog.h" - -#include "net/charserverhandler.h" - -#include "debug.h" - -CharRenameListener charRenameListener; - -CharRenameListener::CharRenameListener() : - ActionListener(), - mDialog(nullptr), - mId(BeingId_zero) -{ -} - -void CharRenameListener::action(const ActionEvent &event) -{ - if (event.getId() != "OK") - return; - if (mDialog != nullptr) - { - if (charServerHandler != nullptr) - charServerHandler->renameCharacter(mId, mDialog->getMsg()); - mDialog = nullptr; - } -} diff --git a/src/listeners/charrenamelistener.h b/src/listeners/charrenamelistener.h deleted file mode 100644 index c66fe7c5d..000000000 --- a/src/listeners/charrenamelistener.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_CHARRENAMELISTENER_H -#define LISTENERS_CHARRENAMELISTENER_H - -#include "enums/simpletypes/beingid.h" - -#include "listeners/actionlistener.h" - -#include "localconsts.h" - -class EditDialog; - -class CharRenameListener final : public ActionListener -{ - public: - CharRenameListener(); - - A_DELETE_COPY(CharRenameListener) - - void action(const ActionEvent &event) override final; - - void setId(const BeingId id) - { mId = id; } - - void setDialog(EditDialog *const dialog) - { mDialog = dialog; } - - protected: - EditDialog *mDialog; - BeingId mId; -}; - -extern CharRenameListener charRenameListener; - -#endif // LISTENERS_CHARRENAMELISTENER_H diff --git a/src/listeners/configlistener.h b/src/listeners/configlistener.h deleted file mode 100644 index 76250eea6..000000000 --- a/src/listeners/configlistener.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_CONFIGLISTENER_H -#define LISTENERS_CONFIGLISTENER_H - -#include - -#include "localconsts.h" - -/** - * The listener interface for receiving notifications about changes to - * configuration options. - * - * \ingroup CORE - */ -class ConfigListener notfinal -{ - public: - ConfigListener() - { } - - A_DELETE_COPY(ConfigListener) - - /** - * Destructor. - */ - virtual ~ConfigListener() - { } - - /** - * Called when an option changed. The config listener will have to be - * registered to the option name first. - */ - virtual void optionChanged(const std::string &name) = 0; -}; - -#endif // LISTENERS_CONFIGLISTENER_H diff --git a/src/listeners/debugmessagelistener.cpp b/src/listeners/debugmessagelistener.cpp deleted file mode 100644 index b759e7c14..000000000 --- a/src/listeners/debugmessagelistener.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/debugmessagelistener.h" - -#include "utils/foreach.h" - -#include "debug.h" - -defineListener(DebugMessageListener) - -void DebugMessageListener::distributeEvent(const std::string &msg) -{ - FOR_EACH (STD_VECTOR::iterator, - it, mListeners) - { - DebugMessageListener *const listener = *it; - if (listener != nullptr) - listener->debugMessage(msg); - } -} diff --git a/src/listeners/debugmessagelistener.h b/src/listeners/debugmessagelistener.h deleted file mode 100644 index 2e981cfbf..000000000 --- a/src/listeners/debugmessagelistener.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_DEBUGMESSAGELISTENER_H -#define LISTENERS_DEBUGMESSAGELISTENER_H - -#include "listeners/baselistener.hpp" - -#include - -#include "localconsts.h" - -class DebugMessageListener notfinal -{ - public: - A_DELETE_COPY(DebugMessageListener) - - virtual void debugMessage(const std::string &msg) = 0; - - static void distributeEvent(const std::string &msg); - - defineListenerHeader(DebugMessageListener) -}; - -#endif // LISTENERS_DEBUGMESSAGELISTENER_H diff --git a/src/listeners/errorlistener.cpp b/src/listeners/errorlistener.cpp deleted file mode 100644 index 17f30fbf9..000000000 --- a/src/listeners/errorlistener.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/errorlistener.h" - -#include "client.h" -#include "settings.h" - -#include "utils/process.h" - -#include "debug.h" - -ErrorListener errorListener; - -void ErrorListener::action(const ActionEvent &event) -{ - if (event.getId() == "yes") - openBrowser(settings.supportUrl); - client->setState(State::CHOOSE_SERVER); -} diff --git a/src/listeners/errorlistener.h b/src/listeners/errorlistener.h deleted file mode 100644 index 6573e8107..000000000 --- a/src/listeners/errorlistener.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_ERRORLISTENER_H -#define LISTENERS_ERRORLISTENER_H - -#include "listeners/actionlistener.h" - -#include "localconsts.h" - -class ErrorListener final : public ActionListener -{ - public: - ErrorListener() : - ActionListener() - { } - - A_DELETE_COPY(ErrorListener) - - void action(const ActionEvent &event) override final; -}; - -extern ErrorListener errorListener; - -#endif // LISTENERS_ERRORLISTENER_H diff --git a/src/listeners/focuslistener.h b/src/listeners/focuslistener.h deleted file mode 100644 index 013d8137b..000000000 --- a/src/listeners/focuslistener.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * - * - * Per Larsson a.k.a finalman - * Olof Naessén a.k.a jansem/yakslem - * - * Visit: http://guichan.sourceforge.net - * - * License: (BSD) - * 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. - * 3. Neither the name of Guichan nor the names of its contributors may - * be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 - * OWNER 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. - */ - -#ifndef LISTENERS_FOCUSLISTENER_H -#define LISTENERS_FOCUSLISTENER_H - -#include "events/event.h" - -#include "localconsts.h" - -/** - * Interface for listening for focus events from widgets. - * - * @see Widget::addFocusListener, Widget::removeFocusListener - * @author Olof Naessén - */ -class FocusListener notfinal -{ - public: - A_DELETE_COPY(FocusListener) - - /** - * Destructor. - */ - virtual ~FocusListener() - { } - - /** - * Called when a widget gains focus. - * - * @param event Discribes the event. - */ - virtual void focusGained(const Event &event A_UNUSED) - { } - - /** - * Called when a widget loses focus. - * - * @param event Discribes the event. - */ - virtual void focusLost(const Event &event A_UNUSED) - { } - - protected: - /** - * Constructor. - * - * You should not be able to make an instance of FocusListener, - * therefore its constructor is protected. - */ - FocusListener() - { } -}; - -#endif // LISTENERS_FOCUSLISTENER_H diff --git a/src/listeners/gamemodifierlistener.cpp b/src/listeners/gamemodifierlistener.cpp deleted file mode 100644 index ad17b186b..000000000 --- a/src/listeners/gamemodifierlistener.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/gamemodifierlistener.h" - -#include "utils/foreach.h" - -#include "debug.h" - -defineListener(GameModifierListener) - -void GameModifierListener::distributeEvent() -{ - FOR_EACH (STD_VECTOR::iterator, - it, mListeners) - { - GameModifierListener *const listener = *it; - if (listener != nullptr) - listener->gameModifiersChanged(); - } -} diff --git a/src/listeners/gamemodifierlistener.h b/src/listeners/gamemodifierlistener.h deleted file mode 100644 index 86635f5df..000000000 --- a/src/listeners/gamemodifierlistener.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_GAMEMODIFIERLISTENER_H -#define LISTENERS_GAMEMODIFIERLISTENER_H - -#include "listeners/baselistener.hpp" - -#include "localconsts.h" - -class GameModifierListener notfinal -{ - public: - A_DELETE_COPY(GameModifierListener) - - virtual void gameModifiersChanged() = 0; - - static void distributeEvent(); - - defineListenerHeader(GameModifierListener) -}; - -#endif // LISTENERS_GAMEMODIFIERLISTENER_H diff --git a/src/listeners/guiconfiglistener.h b/src/listeners/guiconfiglistener.h deleted file mode 100644 index 9d0788b38..000000000 --- a/src/listeners/guiconfiglistener.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_GUICONFIGLISTENER_H -#define LISTENERS_GUICONFIGLISTENER_H - -#include "configuration.h" - -#include "gui/gui.h" - -#include "listeners/configlistener.h" - -#include "localconsts.h" - -class GuiConfigListener final : public ConfigListener -{ - public: - explicit GuiConfigListener(Gui *const g) : - mGui(g) - {} - - A_DELETE_COPY(GuiConfigListener) - - virtual ~GuiConfigListener() - { - CHECKLISTENERS - } - - void optionChanged(const std::string &name) override final - { - if (mGui == nullptr) - return; - if (name == "customcursor") - mGui->setUseCustomCursor(config.getBoolValue("customcursor")); - else if (name == "doubleClick") - mGui->setDoubleClick(config.getBoolValue("doubleClick")); - } - private: - Gui *mGui; -}; - -#endif // LISTENERS_GUICONFIGLISTENER_H diff --git a/src/listeners/guitableactionlistener.cpp b/src/listeners/guitableactionlistener.cpp deleted file mode 100644 index 2abcaaf6e..000000000 --- a/src/listeners/guitableactionlistener.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/guitableactionlistener.h" - -#include "gui/widgets/guitable.h" - -#include "debug.h" - -GuiTableActionListener::GuiTableActionListener(GuiTable *const restrict table, - Widget *const restrict widget, - const int row, - const int column) : - ActionListener(), - mTable(table), - mRow(row), - mColumn(column), - mWidget(widget) -{ - if ((widget != nullptr) && (table != nullptr)) - { - widget->addActionListener(this); - widget->setParent(table); - widget->setWindow(table->getWindow()); - } -} - -GuiTableActionListener::~GuiTableActionListener() -{ - if (mWidget != nullptr) - { - mWidget->removeActionListener(this); - mWidget->setWindow(nullptr); - mWidget->setParent(nullptr); - } -} - -void GuiTableActionListener::action(const ActionEvent &actionEvent A_UNUSED) -{ - if (mTable != nullptr) - { - mTable->setSelected(mRow, mColumn); - mTable->distributeActionEvent(); - } -} diff --git a/src/listeners/guitableactionlistener.h b/src/listeners/guitableactionlistener.h deleted file mode 100644 index 08ec04d62..000000000 --- a/src/listeners/guitableactionlistener.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_GUITABLEACTIONLISTENER_H -#define LISTENERS_GUITABLEACTIONLISTENER_H - -#include "listeners/actionlistener.h" - -#include "localconsts.h" - -class GuiTable; - -class GuiTableActionListener final : public ActionListener -{ - public: - GuiTableActionListener(GuiTable *const restrict table, - Widget *const restrict widget, - const int row, - const int column); - - A_DELETE_COPY(GuiTableActionListener) - - ~GuiTableActionListener(); - - void action(const ActionEvent& actionEvent) override final; - - protected: - GuiTable *mTable; - int mRow; - int mColumn; - Widget *mWidget; -}; - -#endif // LISTENERS_GUITABLEACTIONLISTENER_H diff --git a/src/listeners/inputactionremotelistener.cpp b/src/listeners/inputactionremotelistener.cpp deleted file mode 100644 index 2a7da94b5..000000000 --- a/src/listeners/inputactionremotelistener.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/inputactionremotelistener.h" - -#include "input/inputmanager.h" - -#include "debug.h" - -InputActionRemoteListener inputActionRemoteListener; - -InputActionRemoteListener::InputActionRemoteListener() : - ActionListener(), - mCommand(), - mArgs() -{ -} - -void InputActionRemoteListener::action(const ActionEvent &event) -{ - if (event.getId() != "yes") - { - mCommand.clear(); - mArgs.clear(); - return; - } - - inputManager.executeRemoteChatCommand(mCommand, - mArgs, - nullptr); - mCommand.clear(); - mArgs.clear(); -} diff --git a/src/listeners/inputactionremotelistener.h b/src/listeners/inputactionremotelistener.h deleted file mode 100644 index c259ce3cf..000000000 --- a/src/listeners/inputactionremotelistener.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_INPUTACTIONREMOTELISTENER_H -#define LISTENERS_INPUTACTIONREMOTELISTENER_H - -#include "listeners/actionlistener.h" - -#include "localconsts.h" - -class InputActionRemoteListener final : public ActionListener -{ - public: - InputActionRemoteListener(); - - A_DELETE_COPY(InputActionRemoteListener) - - void action(const ActionEvent &event) override final; - - void setCommand(const std::string &command, - const std::string &args) - { - mCommand = command; - mArgs = args; - } - - protected: - std::string mCommand; - std::string mArgs; -}; - -extern InputActionRemoteListener inputActionRemoteListener; - -#endif // LISTENERS_INPUTACTIONREMOTELISTENER_H diff --git a/src/listeners/inputactionreplaylistener.cpp b/src/listeners/inputactionreplaylistener.cpp deleted file mode 100644 index 8efa2bb19..000000000 --- a/src/listeners/inputactionreplaylistener.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/inputactionreplaylistener.h" - -#include "gui/windows/editdialog.h" - -#include "gui/widgets/createwidget.h" - -#include "input/inputmanager.h" - -#include "debug.h" - -InputActionReplayListener inputActionReplayListener; - -InputActionReplayListener::InputActionReplayListener() : - ActionListener(), - mDialog(nullptr), - mAction(InputAction::NO_VALUE) -{ -} - -void InputActionReplayListener::openDialog(const std::string &caption, - const std::string &text, - const InputActionT action0) -{ - CREATEWIDGETV(mDialog, EditDialog, - caption, text, "OK"); - mDialog->addActionListener(this); - mAction = action0; -} - -void InputActionReplayListener::action(const ActionEvent &event) -{ - if (event.getId() != "OK") - { - mDialog = nullptr; - mAction = InputAction::NO_VALUE; - return; - } - if (mDialog != nullptr) - { - inputManager.executeChatCommand(mAction, - mDialog->getMsg(), - nullptr); - mDialog = nullptr; - } - mAction = InputAction::NO_VALUE; -} diff --git a/src/listeners/inputactionreplaylistener.h b/src/listeners/inputactionreplaylistener.h deleted file mode 100644 index a22b52da4..000000000 --- a/src/listeners/inputactionreplaylistener.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_INPUTACTIONREPLAYLISTENER_H -#define LISTENERS_INPUTACTIONREPLAYLISTENER_H - -#include "enums/input/inputaction.h" - -#include "listeners/actionlistener.h" - -#include "localconsts.h" - -class EditDialog; - -class InputActionReplayListener final : public ActionListener -{ - public: - InputActionReplayListener(); - - A_DELETE_COPY(InputActionReplayListener) - - void action(const ActionEvent &event) override final; - - void setDialog(EditDialog *const dialog) - { mDialog = dialog; } - - void openDialog(const std::string &caption, - const std::string &text, - const InputActionT action0); - - protected: - EditDialog *mDialog; - InputActionT mAction; -}; - -extern InputActionReplayListener inputActionReplayListener; - -#endif // LISTENERS_INPUTACTIONREPLAYLISTENER_H diff --git a/src/listeners/insertcardlistener.h b/src/listeners/insertcardlistener.h deleted file mode 100644 index db963332a..000000000 --- a/src/listeners/insertcardlistener.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_INSERTCARDLISTENER_H -#define LISTENERS_INSERTCARDLISTENER_H - -#include "listeners/actionlistener.h" - -#include "net/inventoryhandler.h" - -#include "localconsts.h" - -struct InsertCardListener final : public ActionListener -{ - InsertCardListener() : - ActionListener(), - cardIndex(0), - itemIndex(0) - { - } - - A_DELETE_COPY(InsertCardListener) - - public: - void action(const ActionEvent &event) override final - { - if (event.getId() == "yes" && (inventoryHandler != nullptr)) - inventoryHandler->insertCard(cardIndex, itemIndex); - } - - int cardIndex; - int itemIndex; -}; - -#endif // LISTENERS_INSERTCARDLISTENER_H diff --git a/src/listeners/inventorylistener.h b/src/listeners/inventorylistener.h deleted file mode 100644 index c8ca86dcb..000000000 --- a/src/listeners/inventorylistener.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_INVENTORYLISTENER_H -#define LISTENERS_INVENTORYLISTENER_H - -#include "localconsts.h" - -class Inventory; - -class InventoryListener notfinal -{ - public: - A_DELETE_COPY(InventoryListener) - - virtual ~InventoryListener() - { } - - virtual void slotsChanged(const Inventory *const inventory) = 0; - - protected: - InventoryListener() - { } -}; - -#endif // LISTENERS_INVENTORYLISTENER_H diff --git a/src/listeners/keylistener.h b/src/listeners/keylistener.h deleted file mode 100644 index e89e6d9d1..000000000 --- a/src/listeners/keylistener.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * - * - * Per Larsson a.k.a finalman - * Olof Naessén a.k.a jansem/yakslem - * - * Visit: http://guichan.sourceforge.net - * - * License: (BSD) - * 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. - * 3. Neither the name of Guichan nor the names of its contributors may - * be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 - * OWNER 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. - */ - -#ifndef LISTENERS_KEYLISTENER_H -#define LISTENERS_KEYLISTENER_H - -#include "events/keyevent.h" - -#include "localconsts.h" - -class Key; - -/** - * Interface for listening for key events from widgets. - * - * @see Widget::addKeyListener, Widget::removeKeyListener - */ -class KeyListener notfinal -{ - public: - A_DELETE_COPY(KeyListener) - - /** - * Destructor. - */ - virtual ~KeyListener() - { } - - /** - * Called if a key is pressed when the widget has keyboard focus. - * If a key is held down the widget will generate multiple key - * presses. - * - * @param event Discribes the event. - */ - virtual void keyPressed(KeyEvent &event A_UNUSED) - { } - - /** - * Called if a key is released when the widget has keyboard focus. - * - * @param event Discribes the event. - */ - virtual void keyReleased(KeyEvent &event A_UNUSED) - { } - - protected: - /** - * Constructor. - * - * You should not be able to make an instance of KeyListener, - * therefore its constructor is protected. - */ - KeyListener() - { } -}; - -#endif // LISTENERS_KEYLISTENER_H diff --git a/src/listeners/mouselistener.h b/src/listeners/mouselistener.h deleted file mode 100644 index cebc89e60..000000000 --- a/src/listeners/mouselistener.h +++ /dev/null @@ -1,185 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * - * - * Per Larsson a.k.a finalman - * Olof Naessén a.k.a jansem/yakslem - * - * Visit: http://guichan.sourceforge.net - * - * License: (BSD) - * 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. - * 3. Neither the name of Guichan nor the names of its contributors may - * be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 - * OWNER 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. - */ - -#ifndef LISTENERS_MOUSELISTENER_H -#define LISTENERS_MOUSELISTENER_H - -#include "events/mouseevent.h" - -#include "localconsts.h" - -/** - * Interface for listening for mouse events from widgets. - * - * @see Widget::addMouseListener, Widget::removeMouseListener - */ -class MouseListener notfinal -{ - public: - A_DELETE_COPY(MouseListener) - - /** - * Destructor. - */ - virtual ~MouseListener() - { } - - /** - * Called when the mouse has entered into the widget area. - * - * @param event Describes the event. - */ - virtual void mouseEntered(MouseEvent &event A_UNUSED) - { - } - - /** - * Called when the mouse has exited the widget area. - * - * @param event Describes the event. - */ - virtual void mouseExited(MouseEvent &event A_UNUSED) - { - } - - /** - * Called when a mouse button has been pressed on the widget area. - * - * NOTE: A mouse press is NOT equal to a mouse click. - * Use mouseClickMessage to check for mouse clicks. - * - * @param event Describes the event. - */ - virtual void mousePressed(MouseEvent &event A_UNUSED) - { - } - - /** - * Called when a mouse button has been released on the widget area. - * - * @param event Describes the event. - */ - virtual void mouseReleased(MouseEvent &event A_UNUSED) - { - } - - /** - * Called when a mouse button is pressed and released (clicked) on - * the widget area. - * - * @param event Describes the event. - */ - virtual void mouseClicked(MouseEvent &event A_UNUSED) - { - } - - /** - * Called when the mouse wheel has moved up on the widget area. - * - * @param event Describes the event. - */ - virtual void mouseWheelMovedUp(MouseEvent &event A_UNUSED) - { - } - - /** - * Called when the mouse wheel has moved down on the widget area. - * - * @param event Describes the event. - */ - virtual void mouseWheelMovedDown(MouseEvent &event A_UNUSED) - { - } - - /** - * Called when the mouse has moved in the widget area and no mouse button - * has been pressed (i.e no widget is being dragged). - * - * @param event Describes the event. - */ - virtual void mouseMoved(MouseEvent &event A_UNUSED) - { - } - - /** - * Called when the mouse has moved and the mouse has previously been - * pressed on the widget. - * - * @param event Describes the event. - */ - virtual void mouseDragged(MouseEvent &event A_UNUSED) - { - } - - protected: - /** - * Constructor. - * - * You should not be able to make an instance of MouseListener, - * therefore its constructor is protected. - */ - MouseListener() - { } -}; - -#endif // LISTENERS_MOUSELISTENER_H diff --git a/src/listeners/openurllistener.h b/src/listeners/openurllistener.h deleted file mode 100644 index cb836c67e..000000000 --- a/src/listeners/openurllistener.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_OPENURLLISTENER_H -#define LISTENERS_OPENURLLISTENER_H - -#include "listeners/actionlistener.h" - -#include "utils/process.h" - -#include "localconsts.h" - -struct OpenUrlListener final : public ActionListener -{ - OpenUrlListener() : - ActionListener(), - url() - { - } - - A_DELETE_COPY(OpenUrlListener) - - public: - void action(const ActionEvent &event) override final - { - if (event.getId() == "yes") - openBrowser(url); - } - - std::string url; -}; - -#endif // LISTENERS_OPENURLLISTENER_H diff --git a/src/listeners/pincodelistener.cpp b/src/listeners/pincodelistener.cpp deleted file mode 100644 index 5b3c757d1..000000000 --- a/src/listeners/pincodelistener.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/pincodelistener.h" - -#include "net/charserverhandler.h" - -#include "gui/windows/editdialog.h" - -#include "debug.h" - -PincodeListener pincodeListener; - -void PincodeListener::action(const ActionEvent &event) -{ - const EditDialog *const dialog = dynamic_cast( - event.getSource()); - if (dialog != nullptr) - { - const std::string pincode = dialog->getMsg(); - charServerHandler->setNewPincode(pincode); - } -} diff --git a/src/listeners/pincodelistener.h b/src/listeners/pincodelistener.h deleted file mode 100644 index 45bce5be3..000000000 --- a/src/listeners/pincodelistener.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_PINCODELISTENER_H -#define LISTENERS_PINCODELISTENER_H - -#include "listeners/actionlistener.h" - -#include "localconsts.h" - -class PincodeListener final : public ActionListener -{ - public: - PincodeListener() : - ActionListener() - { } - - A_DELETE_COPY(PincodeListener) - - void action(const ActionEvent &event) override final; -}; - -extern PincodeListener pincodeListener; - -#endif // LISTENERS_PINCODELISTENER_H diff --git a/src/listeners/playerdeathlistener.cpp b/src/listeners/playerdeathlistener.cpp deleted file mode 100644 index 5a20d64e9..000000000 --- a/src/listeners/playerdeathlistener.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/playerdeathlistener.h" - -#include "utils/foreach.h" - -#include "debug.h" - -defineListener(PlayerDeathListener) - -void PlayerDeathListener::distributeEvent() -{ - FOR_EACH (STD_VECTOR::iterator, - it, mListeners) - { - PlayerDeathListener *const listener = *it; - if (listener != nullptr) - listener->playerDeath(); - } -} diff --git a/src/listeners/playerdeathlistener.h b/src/listeners/playerdeathlistener.h deleted file mode 100644 index 2e9ea99a9..000000000 --- a/src/listeners/playerdeathlistener.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_PLAYERDEATHLISTENER_H -#define LISTENERS_PLAYERDEATHLISTENER_H - -#include "listeners/baselistener.hpp" - -#include "localconsts.h" - -class PlayerDeathListener notfinal -{ - public: - A_DELETE_COPY(PlayerDeathListener) - - virtual void playerDeath() = 0; - - static void distributeEvent(); - - defineListenerHeader(PlayerDeathListener) -}; - -#endif // LISTENERS_PLAYERDEATHLISTENER_H diff --git a/src/listeners/playerlistener.cpp b/src/listeners/playerlistener.cpp deleted file mode 100644 index 62a749b6e..000000000 --- a/src/listeners/playerlistener.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/playerlistener.h" - -#include "actormanager.h" - -#include "being/being.h" - -#include "gui/windows/textdialog.h" - -#include "debug.h" - -PlayerListener::PlayerListener() : - ActionListener(), - mNick(), - mDialog(nullptr), - mType(ActorType::Unknown) -{ -} - -void PlayerListener::action(const ActionEvent &event) -{ - if (event.getId() == "ok" && !mNick.empty() && (mDialog != nullptr)) - { - std::string comment = mDialog->getText(); - Being *const being = actorManager->findBeingByName( - mNick, static_cast(mType)); - if (being != nullptr) - being->setComment(comment); - Being::saveComment(mNick, comment, mType); - } - mDialog = nullptr; -} diff --git a/src/listeners/playerlistener.h b/src/listeners/playerlistener.h deleted file mode 100644 index 0f2992bb5..000000000 --- a/src/listeners/playerlistener.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_PLAYERLISTENER_H -#define LISTENERS_PLAYERLISTENER_H - -#include "enums/being/actortype.h" - -#include "listeners/actionlistener.h" - -#include "localconsts.h" - -class TextDialog; - -class PlayerListener final : public ActionListener -{ - public: - PlayerListener(); - - A_DELETE_COPY(PlayerListener) - - void action(const ActionEvent &event) override final; - - void setNick(const std::string &name) - { mNick = name; } - - void setDialog(TextDialog *const dialog) - { mDialog = dialog; } - - void setType(const ActorTypeT type) - { mType = type; } - - private: - std::string mNick; - TextDialog *mDialog; - ActorTypeT mType; -}; - -#endif // LISTENERS_PLAYERLISTENER_H diff --git a/src/listeners/playerpostdeathlistener.h b/src/listeners/playerpostdeathlistener.h deleted file mode 100644 index 2a5f86235..000000000 --- a/src/listeners/playerpostdeathlistener.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_PLAYERPOSTDEATHLISTENER_H -#define LISTENERS_PLAYERPOSTDEATHLISTENER_H - -#include "being/localplayer.h" - -#include "gui/dialogsmanager.h" -#include "gui/popupmanager.h" - -#include "gui/windows/npcdialog.h" - -#include "net/playerhandler.h" - -#include "localconsts.h" - -extern OkDialog *deathNotice; - -/** - * Listener used for handling death message. - */ -struct PlayerPostDeathListener final : public ActionListener -{ - PlayerPostDeathListener() : - ActionListener() - { } - - A_DELETE_COPY(PlayerPostDeathListener) - - void action(const ActionEvent &event A_UNUSED) override final - { - if (playerHandler != nullptr) - playerHandler->respawn(); - deathNotice = nullptr; - - DialogsManager::closeDialogs(); - PopupManager::closePopupMenu(); - - NpcDialog::clearDialogs(); - if (localPlayer != nullptr) - localPlayer->respawn(); - } -}; - -#endif // LISTENERS_PLAYERPOSTDEATHLISTENER_H diff --git a/src/listeners/playerrelationslistener.h b/src/listeners/playerrelationslistener.h deleted file mode 100644 index ced919964..000000000 --- a/src/listeners/playerrelationslistener.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_PLAYERRELATIONSLISTENER_H -#define LISTENERS_PLAYERRELATIONSLISTENER_H - -#include - -#include "localconsts.h" - -class PlayerRelationsListener notfinal -{ - public: - A_DELETE_COPY(PlayerRelationsListener) - - virtual ~PlayerRelationsListener() - { } - - virtual void updatedPlayer(const std::string &name) = 0; - - virtual void updateAll() = 0; - - protected: - PlayerRelationsListener() - { } -}; - -#endif // LISTENERS_PLAYERRELATIONSLISTENER_H diff --git a/src/listeners/renamelistener.cpp b/src/listeners/renamelistener.cpp deleted file mode 100644 index b8bc19883..000000000 --- a/src/listeners/renamelistener.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/renamelistener.h" - -#include "gui/viewport.h" - -#include "gui/windows/socialwindow.h" -#include "gui/windows/textdialog.h" - -#include "resources/map/map.h" -#include "resources/map/mapitem.h" -#include "resources/map/speciallayer.h" - -#include "debug.h" - -RenameListener::RenameListener() : - ActionListener(), - mMapItemX(0), - mMapItemY(0), - mDialog(nullptr) -{ -} - -void RenameListener::setMapItem(const MapItem *const mapItem) -{ - if (mapItem != nullptr) - { - mMapItemX = mapItem->getX(); - mMapItemY = mapItem->getY(); - } - else - { - mMapItemX = 0; - mMapItemY = 0; - } -} - -void RenameListener::action(const ActionEvent &event) -{ - if (event.getId() == "ok" && (viewport != nullptr) && (mDialog != nullptr)) - { - const Map *const map = viewport->getMap(); - if (map == nullptr) - return; - - const SpecialLayer *const sl = map->getSpecialLayer(); - MapItem *item = nullptr; - if (sl != nullptr) - { - item = sl->getTile(mMapItemX, mMapItemY); - if (item != nullptr) - item->setComment(mDialog->getText()); - } - item = map->findPortalXY(mMapItemX, mMapItemY); - if (item != nullptr) - item->setComment(mDialog->getText()); - - if (socialWindow != nullptr) - socialWindow->updatePortalNames(); - } - mDialog = nullptr; -} diff --git a/src/listeners/renamelistener.h b/src/listeners/renamelistener.h deleted file mode 100644 index 87355116a..000000000 --- a/src/listeners/renamelistener.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_RENAMELISTENER_H -#define LISTENERS_RENAMELISTENER_H - -#include "listeners/actionlistener.h" - -#include "localconsts.h" - -class MapItem; -class TextDialog; - -class RenameListener final : public ActionListener -{ - public: - RenameListener(); - - A_DELETE_COPY(RenameListener) - - void action(const ActionEvent &event) override final; - - void setMapItem(const MapItem *const mapItem); - - void setDialog(TextDialog *dialog) - { mDialog = dialog; } - - private: - int mMapItemX; - int mMapItemY; - TextDialog *mDialog; -}; - -#endif // LISTENERS_RENAMELISTENER_H diff --git a/src/listeners/requestadoptchildlistener.h b/src/listeners/requestadoptchildlistener.h deleted file mode 100644 index e69759ed9..000000000 --- a/src/listeners/requestadoptchildlistener.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_REQUESTADOPTCHILDLISTENER_H -#define LISTENERS_REQUESTADOPTCHILDLISTENER_H - -#include "gui/windows/confirmdialog.h" - -#include "net/familyhandler.h" - -#include "localconsts.h" - -struct RequestAdoptChildListener final : public ActionListener -{ - public: - RequestAdoptChildListener() : - ActionListener() - { } - - A_DELETE_COPY(RequestAdoptChildListener) - - void action(const ActionEvent &event) override final - { - const std::string &eventId = event.getId(); - familyHandler->askForChildReply(eventId == "yes"); - } -}; - -#endif // LISTENERS_REQUESTADOPTCHILDLISTENER_H diff --git a/src/listeners/requesttradelistener.h b/src/listeners/requesttradelistener.h deleted file mode 100644 index 577d75c3c..000000000 --- a/src/listeners/requesttradelistener.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_REQUESTTRADELISTENER_H -#define LISTENERS_REQUESTTRADELISTENER_H - -#include "being/playerrelations.h" - -#include "gui/windows/confirmdialog.h" - -#include "net/tradehandler.h" - -#include "localconsts.h" - -extern std::string tradePartnerName; -extern ConfirmDialog *confirmDlg; - -/** - * Listener for request trade dialogs - */ -struct RequestTradeListener final : public ActionListener -{ - public: - RequestTradeListener() - { } - - A_DELETE_COPY(RequestTradeListener) - - void action(const ActionEvent &event) override final - { - confirmDlg = nullptr; - const std::string &eventId = event.getId(); - if (eventId == "ignore") - playerRelations.ignoreTrade(tradePartnerName); - tradeHandler->respond(eventId == "yes"); - } -}; - -#endif // LISTENERS_REQUESTTRADELISTENER_H diff --git a/src/listeners/selectionlistener.h b/src/listeners/selectionlistener.h deleted file mode 100644 index ab4d0478b..000000000 --- a/src/listeners/selectionlistener.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * - * - * Per Larsson a.k.a finalman - * Olof Naessén a.k.a jansem/yakslem - * - * Visit: http://guichan.sourceforge.net - * - * License: (BSD) - * 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. - * 3. Neither the name of Guichan nor the names of its contributors may - * be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 - * OWNER 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. - */ - -#ifndef LISTENERS_SELECTIONLISTENER_H -#define LISTENERS_SELECTIONLISTENER_H - -#include "events/selectionevent.h" - -#include "localconsts.h" - -/** - * Interface for listening for selection events from widgets. - * - * @see ListBox::addSelectionListener, - * ListBox::removeSelectionListener, - * DropDown::addSelectionListener, - * DropDown::removeSelectionListener - * @author Olof Naessén - */ -class SelectionListener notfinal -{ - public: - /** - * Destructor. - */ - virtual ~SelectionListener() - { } - - /** - * Called when the value of a selection has been changed in a Widget. - * It is used to be able to recieve a notification that a value has - * been changed. - * - * @param event The event of the value change. - */ - virtual void valueChanged(const SelectionEvent &event A_UNUSED) - { } - - protected: - /** - * Constructor. - * - * You should not be able to make an instance of SelectionListener, - * therefore its constructor is protected. - */ - SelectionListener() - { } - - A_DELETE_COPY(SelectionListener) -}; - -#endif // LISTENERS_SELECTIONLISTENER_H diff --git a/src/listeners/shoprenamelistener.cpp b/src/listeners/shoprenamelistener.cpp deleted file mode 100644 index 60ca7945e..000000000 --- a/src/listeners/shoprenamelistener.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/shoprenamelistener.h" - -#include "gui/windows/editdialog.h" -#include "gui/windows/shopwindow.h" - -#include "debug.h" - -ShopRenameListener shopRenameListener; - -ShopRenameListener::ShopRenameListener() : - ActionListener(), - mDialog(nullptr) -{ -} - -void ShopRenameListener::action(const ActionEvent &event) -{ - if (event.getId() != "OK") - return; - if (mDialog != nullptr) - { - shopWindow->setShopName(mDialog->getMsg()); - mDialog = nullptr; - } -} diff --git a/src/listeners/shoprenamelistener.h b/src/listeners/shoprenamelistener.h deleted file mode 100644 index d57fd785a..000000000 --- a/src/listeners/shoprenamelistener.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_SHOPRENAMELISTENER_H -#define LISTENERS_SHOPRENAMELISTENER_H - -#include "listeners/actionlistener.h" - -#include "localconsts.h" - -class EditDialog; - -class ShopRenameListener final : public ActionListener -{ - public: - ShopRenameListener(); - - A_DELETE_COPY(ShopRenameListener) - - void action(const ActionEvent &event) override final; - - void setDialog(EditDialog *const dialog) - { mDialog = dialog; } - - protected: - EditDialog *mDialog; -}; - -extern ShopRenameListener shopRenameListener; - -#endif // LISTENERS_SHOPRENAMELISTENER_H diff --git a/src/listeners/skillwarplistener.cpp b/src/listeners/skillwarplistener.cpp deleted file mode 100644 index d8f66f9a8..000000000 --- a/src/listeners/skillwarplistener.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/skillwarplistener.h" - -#include "gui/windows/textselectdialog.h" - -#include "net/skillhandler.h" - -#include "debug.h" - -SkillWarpListener skillWarpListener; - -SkillWarpListener::SkillWarpListener() : - ActionListener(), - mDialog(nullptr), - mSkillId(0) -{ -} - -void SkillWarpListener::action(const ActionEvent &event) -{ - if (event.getId() != "OK") - return; - if ((mDialog != nullptr) && (skillHandler != nullptr)) - { - skillHandler->useMap(mSkillId, - mDialog->getText()); - } - mDialog = nullptr; -} diff --git a/src/listeners/skillwarplistener.h b/src/listeners/skillwarplistener.h deleted file mode 100644 index 04517c27c..000000000 --- a/src/listeners/skillwarplistener.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_SKILLWARPLISTENER_H -#define LISTENERS_SKILLWARPLISTENER_H - -#include "listeners/actionlistener.h" - -#include "localconsts.h" - -class TextSelectDialog; - -class SkillWarpListener final : public ActionListener -{ - public: - SkillWarpListener(); - - A_DELETE_COPY(SkillWarpListener) - - void action(const ActionEvent &event) override final; - - void setDialog(TextSelectDialog *const dialog) - { mDialog = dialog; } - - void setSkill(const int skillId) - { mSkillId = skillId; } - - protected: - TextSelectDialog *mDialog; - int mSkillId; -}; - -extern SkillWarpListener skillWarpListener; - -#endif // LISTENERS_SKILLWARPLISTENER_H diff --git a/src/listeners/statlistener.cpp b/src/listeners/statlistener.cpp deleted file mode 100644 index 7d973d6aa..000000000 --- a/src/listeners/statlistener.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/statlistener.h" - -#include "utils/foreach.h" - -#include "debug.h" - -defineListener(StatListener) - -void StatListener::distributeEvent(const AttributesT id, - const int oldVal1, - const int oldVal2) -{ - FOR_EACH (STD_VECTOR::iterator, - it, mListeners) - { - StatListener *const listener = *it; - if (listener != nullptr) - listener->statChanged(id, oldVal1, oldVal2); - } -} diff --git a/src/listeners/statlistener.h b/src/listeners/statlistener.h deleted file mode 100644 index 485401728..000000000 --- a/src/listeners/statlistener.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_STATLISTENER_H -#define LISTENERS_STATLISTENER_H - -#include "enums/being/attributes.h" - -#include "listeners/baselistener.hpp" - -#include "localconsts.h" - -class StatListener notfinal -{ - public: - A_DELETE_COPY(StatListener) - - virtual void statChanged(const AttributesT id, - const int oldVal1, - const int oldVal2) = 0; - - static void distributeEvent(const AttributesT id, - const int oldVal1, - const int oldVal2); - - defineListenerHeader(StatListener) -}; - -#endif // LISTENERS_STATLISTENER_H diff --git a/src/listeners/tablemodellistener.h b/src/listeners/tablemodellistener.h deleted file mode 100644 index 717df4f11..000000000 --- a/src/listeners/tablemodellistener.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2008-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_TABLEMODELLISTENER_H -#define LISTENERS_TABLEMODELLISTENER_H - -#include "localconsts.h" - -class Widget; - -class TableModelListener notfinal -{ - public: - TableModelListener() - { } - - A_DELETE_COPY(TableModelListener) - - /** - * Must be invoked by the TableModel whenever a global change is about - * to occur or has occurred (e.g., when a row or column is being - * removed or added). - * - * This method is triggered twice, once before and once after - * the update. - * - * \param completed whether we are signalling the end of the update - */ - virtual void modelUpdated(const bool completed) = 0; - - virtual ~TableModelListener() - { } -}; - -#endif // LISTENERS_TABLEMODELLISTENER_H diff --git a/src/listeners/textskilllistener.cpp b/src/listeners/textskilllistener.cpp deleted file mode 100644 index 1c0434948..000000000 --- a/src/listeners/textskilllistener.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/textskilllistener.h" - -#include "gui/windows/textdialog.h" - -#include "net/skillhandler.h" - -#include "debug.h" - -TextSkillListener::TextSkillListener() : - ActionListener(), - mDialog(nullptr), - mSkillId(0), - mX(0), - mY(0), - mLevel(0) -{ -} - -void TextSkillListener::setSkill(const int skillId, - const int x, - const int y, - const int level) -{ - mSkillId = skillId; - mX = x; - mY = y; - mLevel = level; -} - -void TextSkillListener::action(const ActionEvent &event) -{ - if (event.getId() == "ok" && (mDialog != nullptr)) - { - const std::string text = mDialog->getText(); - if (text.empty()) - return; - skillHandler->usePos(mSkillId, - mLevel, - mX, mY, - text); - } - mDialog = nullptr; -} diff --git a/src/listeners/textskilllistener.h b/src/listeners/textskilllistener.h deleted file mode 100644 index 025a4a51a..000000000 --- a/src/listeners/textskilllistener.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_TEXTSKILLLISTENER_H -#define LISTENERS_TEXTSKILLLISTENER_H - -#include "listeners/actionlistener.h" - -#include "localconsts.h" - -class TextDialog; - -class TextSkillListener final : public ActionListener -{ - public: - TextSkillListener(); - - A_DELETE_COPY(TextSkillListener) - - void action(const ActionEvent &event) override final; - - void setSkill(const int skillId, - const int x, - const int y, - const int level); - - void setDialog(TextDialog *dialog) - { mDialog = dialog; } - - private: - TextDialog *mDialog; - int mSkillId; - int mX; - int mY; - int mLevel; -}; - -#endif // LISTENERS_TEXTSKILLLISTENER_H diff --git a/src/listeners/tooltiplistener.cpp b/src/listeners/tooltiplistener.cpp deleted file mode 100644 index 665839abf..000000000 --- a/src/listeners/tooltiplistener.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/tooltiplistener.h" - -#include "gui/gui.h" -#include "gui/viewport.h" - -#include "gui/popups/textboxpopup.h" - -#include "debug.h" - -ToolTipListener::ToolTipListener() : - MouseListener(), - mToolTip() -{ -} - -void ToolTipListener::mouseMoved(MouseEvent &event) -{ - if (mToolTip.empty() || (textBoxPopup == nullptr)) - return; - - int x = 0; - int y = 0; - if (viewport != nullptr) - { - x = viewport->mMouseX; - y = viewport->mMouseY; - } - else - { - Gui::getMouseState(x, y); - } - - event.consume(); - textBoxPopup->show(x, y, mToolTip); -} - -void ToolTipListener::mouseExited(MouseEvent &event A_UNUSED) -{ - if (mToolTip.empty() || (textBoxPopup == nullptr)) - return; - textBoxPopup->hide(); -} diff --git a/src/listeners/tooltiplistener.h b/src/listeners/tooltiplistener.h deleted file mode 100644 index 0e4f5d231..000000000 --- a/src/listeners/tooltiplistener.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_TOOLTIPLISTENER_H -#define LISTENERS_TOOLTIPLISTENER_H - -#include "listeners/mouselistener.h" - -#include - -#include "localconsts.h" - -class ToolTipListener notfinal : public MouseListener -{ - public: - ToolTipListener(); - - A_DELETE_COPY(ToolTipListener) - - void setToolTip(const std::string &str) - { mToolTip = str; } - - std::string getToolTip() const - { return mToolTip; } - - void mouseMoved(MouseEvent &event) override; - - void mouseExited(MouseEvent &event) override; - - protected: - std::string mToolTip; -}; - -#endif // LISTENERS_TOOLTIPLISTENER_H diff --git a/src/listeners/updatestatuslistener.cpp b/src/listeners/updatestatuslistener.cpp deleted file mode 100644 index 511ba9c7a..000000000 --- a/src/listeners/updatestatuslistener.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/updatestatuslistener.h" - -#include "utils/foreach.h" - -#include "debug.h" - -defineListener(UpdateStatusListener) - -void UpdateStatusListener::distributeEvent() -{ - FOR_EACH (STD_VECTOR::iterator, - it, mListeners) - { - UpdateStatusListener *const listener = *it; - if (listener != nullptr) - listener->updateStatus(); - } -} diff --git a/src/listeners/updatestatuslistener.h b/src/listeners/updatestatuslistener.h deleted file mode 100644 index 68b7b14b5..000000000 --- a/src/listeners/updatestatuslistener.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_UPDATESTATUSLISTENER_H -#define LISTENERS_UPDATESTATUSLISTENER_H - -#include "listeners/baselistener.hpp" - -#include "localconsts.h" - -class UpdateStatusListener notfinal -{ - public: - A_DELETE_COPY(UpdateStatusListener) - - virtual void updateStatus() = 0; - - static void distributeEvent(); - - defineListenerHeader(UpdateStatusListener) -}; - -#endif // LISTENERS_UPDATESTATUSLISTENER_H diff --git a/src/listeners/uploadlistener.cpp b/src/listeners/uploadlistener.cpp deleted file mode 100644 index d253fb1aa..000000000 --- a/src/listeners/uploadlistener.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/uploadlistener.h" - -#include "input/inputmanager.h" - -#include "debug.h" - -UploadListener uploadListener; - -void UploadListener::action(const ActionEvent &event A_UNUSED) -{ - inputManager.executeAction(InputAction::UPLOAD_LOG); -} diff --git a/src/listeners/uploadlistener.h b/src/listeners/uploadlistener.h deleted file mode 100644 index b75fe58b8..000000000 --- a/src/listeners/uploadlistener.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_UPLOADLISTENER_H -#define LISTENERS_UPLOADLISTENER_H - -#include "listeners/actionlistener.h" - -#include "localconsts.h" - -class UploadListener final : public ActionListener -{ - public: - UploadListener() : - ActionListener() - { } - - A_DELETE_COPY(UploadListener) - - void action(const ActionEvent &event A_UNUSED) override final; -}; - -extern UploadListener uploadListener; - -#endif // LISTENERS_UPLOADLISTENER_H diff --git a/src/listeners/vendingmodelistener.cpp b/src/listeners/vendingmodelistener.cpp deleted file mode 100644 index aa532099f..000000000 --- a/src/listeners/vendingmodelistener.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/vendingmodelistener.h" - -#include "utils/foreach.h" - -#include "debug.h" - -defineListener(VendingModeListener) - -void VendingModeListener::distributeEvent(const bool b) -{ - FOR_EACH (STD_VECTOR::iterator, - it, mListeners) - { - VendingModeListener *const listener = *it; - if (listener != nullptr) - listener->vendingEnabled(b); - } -} diff --git a/src/listeners/vendingmodelistener.h b/src/listeners/vendingmodelistener.h deleted file mode 100644 index 65035e32d..000000000 --- a/src/listeners/vendingmodelistener.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_VENDINGMODELISTENER_H -#define LISTENERS_VENDINGMODELISTENER_H - -#include "listeners/baselistener.hpp" - -#include "localconsts.h" - -class VendingModeListener notfinal -{ - public: - A_DELETE_COPY(VendingModeListener) - - virtual void vendingEnabled(const bool b) = 0; - - static void distributeEvent(const bool b); - - defineListenerHeader(VendingModeListener) -}; - -#endif // LISTENERS_VENDINGMODELISTENER_H diff --git a/src/listeners/vendingslotslistener.cpp b/src/listeners/vendingslotslistener.cpp deleted file mode 100644 index 2f6b90c4a..000000000 --- a/src/listeners/vendingslotslistener.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/vendingslotslistener.h" - -#include "utils/foreach.h" - -#include "debug.h" - -defineListener(VendingSlotsListener) - -void VendingSlotsListener::distributeEvent(const int slots) -{ - FOR_EACH (STD_VECTOR::iterator, - it, mListeners) - { - VendingSlotsListener *const listener = *it; - if (listener != nullptr) - listener->vendingSlotsChanged(slots); - } -} diff --git a/src/listeners/vendingslotslistener.h b/src/listeners/vendingslotslistener.h deleted file mode 100644 index ea79848a9..000000000 --- a/src/listeners/vendingslotslistener.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_VENDINGSLOTSLISTENER_H -#define LISTENERS_VENDINGSLOTSLISTENER_H - -#include "listeners/baselistener.hpp" - -#include "localconsts.h" - -class VendingSlotsListener notfinal -{ - public: - A_DELETE_COPY(VendingSlotsListener) - - virtual void vendingSlotsChanged(const int slots) = 0; - - static void distributeEvent(const int slots); - - defineListenerHeader(VendingSlotsListener) -}; - -#endif // LISTENERS_VENDINGSLOTSLISTENER_H diff --git a/src/listeners/weightlistener.h b/src/listeners/weightlistener.h deleted file mode 100644 index 781a76988..000000000 --- a/src/listeners/weightlistener.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_WEIGHTLISTENER_H -#define LISTENERS_WEIGHTLISTENER_H - -#include "gui/windows/okdialog.h" - -#include "localconsts.h" - -extern OkDialog *weightNotice; - -/** - * Listener used for handling the overweigth message. - */ -struct WeightListener final : public ActionListener -{ - public: - WeightListener() : - ActionListener() - { } - - A_DELETE_COPY(WeightListener) - - void action(const ActionEvent &event A_UNUSED) override final - { - weightNotice = nullptr; - } -}; - -#endif // LISTENERS_WEIGHTLISTENER_H diff --git a/src/listeners/widgetdeathlistener.h b/src/listeners/widgetdeathlistener.h deleted file mode 100644 index 5933edcec..000000000 --- a/src/listeners/widgetdeathlistener.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * - * - * Per Larsson a.k.a finalman - * Olof Naessén a.k.a jansem/yakslem - * - * Visit: http://guichan.sourceforge.net - * - * License: (BSD) - * 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. - * 3. Neither the name of Guichan nor the names of its contributors may - * be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 - * OWNER 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. - */ - -#ifndef LISTENERS_WIDGETDEATHLISTENER_H -#define LISTENERS_WIDGETDEATHLISTENER_H - -#include "events/event.h" - -/** - * Interface for listening for death events from widgets. - * - * @see Widget::addDeathListener, Widget::removeDeathListener - * @author Olof Naessén - */ -class WidgetDeathListener notfinal -{ - public: - A_DELETE_COPY(WidgetDeathListener) - - /** - * Destructor. - */ - virtual ~WidgetDeathListener() - { } - - /** - * Called when a widget dies. It is used to be able to recieve - * a notification when a death of a widget occurs. - * - * @param event The event of the death. - */ - virtual void death(const Event &event) = 0; - - protected: - /** - * Constructor. - * - * You should not be able to make an instance of DeathListener, - * therefore its constructor is protected. - */ - WidgetDeathListener() - { } -}; - -#endif // LISTENERS_WIDGETDEATHLISTENER_H diff --git a/src/listeners/widgetlistener.h b/src/listeners/widgetlistener.h deleted file mode 100644 index c3e44ebb6..000000000 --- a/src/listeners/widgetlistener.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * - * - * Per Larsson a.k.a finalman - * Olof Naessén a.k.a jansem/yakslem - * - * Visit: http://guichan.sourceforge.net - * - * License: (BSD) - * 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. - * 3. Neither the name of Guichan nor the names of its contributors may - * be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 - * OWNER 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. - */ - -#ifndef LISTENERS_WIDGETLISTENER_H -#define LISTENERS_WIDGETLISTENER_H - -#include "events/event.h" - -#include "localconsts.h" - -/** - * Interface for listening for events from widgets. When a widget's size, - * location or visibility changes, the relevant method of the listener is - * invoked. - * - * @see Widget::addWidgetListener, Widget::removeWidgetListener - * @author Olof Naessén - */ -class WidgetListener notfinal -{ - public: - A_DELETE_COPY(WidgetListener) - - /** - * Destructor. - */ - virtual ~WidgetListener() - { } - - /** - * Invoked when a widget changes its size. - * - * @param event Describes the event. - */ - virtual void widgetResized(const Event &event A_UNUSED) - { } - - /** - * Invoked when a widget is moved. - * - * @param event Describes the event. - */ - virtual void widgetMoved(const Event &event A_UNUSED) - { } - - /** - * Invoked when a widget is hidden, i.e it's set to be - * not visible. - * - * @param event Describes the event. - */ - virtual void widgetHidden(const Event &event A_UNUSED) - { } - - /** - * Invoked when a widget is shown, i.e it's set to be - * visible. - * - * @param event Describes the event. - */ - virtual void widgetShown(const Event &event A_UNUSED) - { } - - protected: - /** - * Constructor. - * - * You should not be able to make an instance of WidgetListener, - * therefore its constructor is protected. - */ - WidgetListener() - { } -}; - -#endif // LISTENERS_WIDGETLISTENER_H diff --git a/src/listeners/wrongdatanoticelistener.cpp b/src/listeners/wrongdatanoticelistener.cpp deleted file mode 100644 index ea227eca7..000000000 --- a/src/listeners/wrongdatanoticelistener.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#include "listeners/wrongdatanoticelistener.h" - -#include "gui/widgets/textfield.h" - -#include "debug.h" - -WrongDataNoticeListener::WrongDataNoticeListener() : - ActionListener(), - mTarget(nullptr) -{ -} - -void WrongDataNoticeListener::setTarget(TextField *const textField) -{ - mTarget = textField; -} - -void WrongDataNoticeListener::action(const ActionEvent &event) -{ - if (event.getId() == "ok" && (mTarget != nullptr)) - mTarget->requestFocus(); -} diff --git a/src/listeners/wrongdatanoticelistener.h b/src/listeners/wrongdatanoticelistener.h deleted file mode 100644 index 07820d6d5..000000000 --- a/src/listeners/wrongdatanoticelistener.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * 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, see . - */ - -#ifndef LISTENERS_WRONGDATANOTICELISTENER_H -#define LISTENERS_WRONGDATANOTICELISTENER_H - -#include "listeners/actionlistener.h" - -class TextField; - -/** - * Listener used while dealing with wrong data. It is used to direct the focus - * to the field which contained wrong data when the Ok button was pressed on - * the error notice. - */ -class WrongDataNoticeListener final : public ActionListener -{ - public: - WrongDataNoticeListener(); - - A_DELETE_COPY(WrongDataNoticeListener) - - void setTarget(TextField *const textField); - - void action(const ActionEvent &event) override final; - private: - TextField *mTarget; -}; - -#endif // LISTENERS_WRONGDATANOTICELISTENER_H -- cgit v1.2.3-60-g2f50