vlp-27 Moving kernel to use QtDesigner files. Important note: need to use uic-qt4...
[vlp.git] / src / kernel / send-message.h
1 /**************************************************************
2
3   Copyright (C) 2013  Rafał Długołęcki
4
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  as published by the Free Software Foundation; either version 2
8  of the License, or (at your option) any later version.
9
10  This program is distributed in the hope that it will be useful, 
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  GNU General Public License for more details.
14
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
17  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19
20
21
22  NOTE: This software is using the free software license of 
23        the QT library v.1.30 from Troll Tech AS.
24        See the file LICENSE.QT.
25
26 ************************************************************/
27
28 #ifndef VLP_SEND_MESSAGE_H
29 #define VLP_SEND_MESSAGE_H
30
31 #include <QtGui/QDialog>
32 #include <QtCore/QString>
33 #include <stdlib.h>
34
35 #include "ui/dialogs/send-message.h"
36
37 /**
38  * Class responsible for displaying dialog for sending messages
39  */
40 class SendMessageDialog : public QDialog, private Ui::sendMessageDialog {
41 public:
42         /**
43          * Constructs a SendMessageDialog with parent 'parent'.
44          * The widget flags f are passed on to the QWidget constructor.
45          *
46          * @param parent parent widget of this dialog
47          * @param flags QDialog flags of this dialog
48          */
49         SendMessageDialog(QWidget * parent = 0, Qt::WindowFlags flags = 0 ) :
50                 QDialog(parent, flags)
51         {
52                 setupUi(this);
53                 connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
54                 connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
55         }
56         
57         /**
58          * Returns entered in dialog node number
59          * @return node number from this dialog textfield
60          */
61         int getNodeNumber()
62         {
63                 return atoi(nodeNumber->text().toAscii().data());
64         }
65         
66         /**
67          * Returns entered in dialog message
68          * @return message from this dialog textarea
69          */
70         QString getMessage()
71         {
72                 return message->toPlainText();
73         }
74 };
75
76
77 #endif /* VLP_SEND_MESSAGE_H */