QTfrontend/ui/widget/chatwidget.h
branchsdl2transition
changeset 11362 ed5a6478e710
parent 11046 47a8c19ecb60
child 11865 047be82b6f67
equal deleted inserted replaced
11361:31570b766315 11362:ed5a6478e710
     1 /*
     1 /*
     2  * Hedgewars, a free turn based strategy game
     2  * Hedgewars, a free turn based strategy game
     3  * Copyright (c) 2007 Igor Ulyanov <iulyanov@gmail.com>
     3  * Copyright (c) 2007 Igor Ulyanov <iulyanov@gmail.com>
     4  * Copyright (c) 2004-2013 Andrey Korotaev <unC0Rr@gmail.com>
     4  * Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com>
     5  *
     5  *
     6  * This program is free software; you can redistribute it and/or modify
     6  * This program is free software; you can redistribute it and/or modify
     7  * it under the terms of the GNU General Public License as published by
     7  * it under the terms of the GNU General Public License as published by
     8  * the Free Software Foundation; version 2 of the License
     8  * the Free Software Foundation; version 2 of the License
     9  *
     9  *
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13  * GNU General Public License for more details.
    13  * GNU General Public License for more details.
    14  *
    14  *
    15  * You should have received a copy of the GNU General Public License
    15  * You should have received a copy of the GNU General Public License
    16  * along with this program; if not, write to the Free Software
    16  * along with this program; if not, write to the Free Software
    17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18  */
    18  */
    19 
    19 
    20 #ifndef _CHAT_WIDGET_INCLUDED
    20 #ifndef _CHAT_WIDGET_INCLUDED
    21 #define _CHAT_WIDGET_INCLUDED
    21 #define _CHAT_WIDGET_INCLUDED
    22 
    22 
    30 #include <QListWidgetItem>
    30 #include <QListWidgetItem>
    31 
    31 
    32 #include "SDLInteraction.h"
    32 #include "SDLInteraction.h"
    33 
    33 
    34 #include "SmartLineEdit.h"
    34 #include "SmartLineEdit.h"
       
    35 #include "playerslistmodel.h"
    35 
    36 
    36 class QTextBrowser;
    37 class QTextBrowser;
    37 class QLineEdit;
    38 class QLineEdit;
    38 class QListView;
    39 class QListView;
    39 class QSettings;
    40 class QSettings;
    85         void discardStyleSheet();
    86         void discardStyleSheet();
    86         void saveStyleSheet();
    87         void saveStyleSheet();
    87         QString linkedNick(const QString & nickname);
    88         QString linkedNick(const QString & nickname);
    88         void beforeContentAdd();
    89         void beforeContentAdd();
    89         void afterContentAdd();
    90         void afterContentAdd();
       
    91         bool isInGame();
    90 
    92 
    91         /**
    93         /**
    92          * @brief Checks whether the message contains a highlight.
    94          * @brief Checks whether the message contains a highlight.
    93          * @param sender the sender of the message
    95          * @param sender the sender of the message
    94          * @param message the message
    96          * @param message the message
   130         void follow(const QString &);
   132         void follow(const QString &);
   131         void nickCountUpdate(int cnt);
   133         void nickCountUpdate(int cnt);
   132         void consoleCommand(const QString & command);
   134         void consoleCommand(const QString & command);
   133 
   135 
   134     private:
   136     private:
       
   137         PlayersListModel* m_usersModel;
   135         bool m_isAdmin;
   138         bool m_isAdmin;
   136         QHBoxLayout mainLayout;
   139         QHBoxLayout mainLayout;
   137         QTextBrowser* chatText;
   140         QTextBrowser* chatText;
   138         QStringList chatStrings;
   141         QStringList chatStrings;
   139         QListView* chatNicks;
   142         QListView* chatNicks;