File indexing completed on 2024-04-14 14:32:00

0001 // Copyright (c) 2002 Rob Kaper <cap@capsi.com>
0002 //
0003 // This library is free software; you can redistribute it and/or
0004 // modify it under the terms of the GNU Lesser General Public
0005 // License version 2.1 as published by the Free Software Foundation.
0006 //
0007 // This library is distributed in the hope that it will be useful,
0008 // but WITHOUT ANY WARRANTY; without even the implied warranty of
0009 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0010 // Lesser General Public License for more details.
0011 //
0012 // You should have received a copy of the GNU Lesser General Public License
0013 // along with this library; see the file COPYING.LIB.  If not, write to
0014 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0015 // Boston, MA 02110-1301, USA.
0016 
0017 #ifndef ATLANTIK_AUCTION_WIDGET_H
0018 #define ATLANTIK_AUCTION_WIDGET_H
0019 
0020 #include "estatedetailsbase.h"
0021 
0022 #include <QMap>
0023 
0024 class QTreeWidgetItem;
0025 
0026 class AtlanticCore;
0027 class Player;
0028 class Auction;
0029 
0030 namespace Ui
0031 {
0032 class AuctionWidget;
0033 }
0034 
0035 class AuctionWidget : public EstateDetailsBase
0036 {
0037 Q_OBJECT
0038 
0039 public:
0040     AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, QWidget *parent);
0041     ~AuctionWidget();
0042 
0043 private Q_SLOTS:
0044     void auctionChanged();
0045     void playerChanged(Player *player);
0046     void playerCreated(Player *player);
0047     void playerRemoved(Player *player);
0048     void updateBid(Player *player, int amount);
0049     void slotBidButtonClicked();
0050 
0051 Q_SIGNALS:
0052     void bid(Auction *auction, int amount);
0053 
0054 private:
0055     QTreeWidgetItem *createPlayerItem(Player *player);
0056 
0057     Ui::AuctionWidget *m_ui;
0058     QMap<Player *, QTreeWidgetItem *> m_playerItems;
0059 
0060     AtlanticCore *m_atlanticCore;
0061     Auction *m_auction;
0062 };
0063 
0064 #endif