vlp-27 Moving kernel to use QtDesigner files. Important note: need to use uic-qt4...
[vlp.git] / src / kernel / send-message.h
diff --git a/src/kernel/send-message.h b/src/kernel/send-message.h
new file mode 100644 (file)
index 0000000..2653a0f
--- /dev/null
@@ -0,0 +1,77 @@
+/**************************************************************
+
+  Copyright (C) 2013  Rafał Długołęcki
+
+ 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 (at your option) 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, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+
+
+
+ NOTE: This software is using the free software license of 
+       the QT library v.1.30 from Troll Tech AS.
+       See the file LICENSE.QT.
+
+************************************************************/
+
+#ifndef VLP_SEND_MESSAGE_H
+#define VLP_SEND_MESSAGE_H
+
+#include <QtGui/QDialog>
+#include <QtCore/QString>
+#include <stdlib.h>
+
+#include "ui/dialogs/send-message.h"
+
+/**
+ * Class responsible for displaying dialog for sending messages
+ */
+class SendMessageDialog : public QDialog, private Ui::sendMessageDialog {
+public:
+       /**
+        * Constructs a SendMessageDialog with parent 'parent'.
+        * The widget flags f are passed on to the QWidget constructor.
+        *
+        * @param parent parent widget of this dialog
+        * @param flags QDialog flags of this dialog
+        */
+       SendMessageDialog(QWidget * parent = 0, Qt::WindowFlags flags = 0 ) :
+               QDialog(parent, flags)
+       {
+               setupUi(this);
+               connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+               connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+       }
+       
+       /**
+        * Returns entered in dialog node number
+        * @return node number from this dialog textfield
+        */
+       int getNodeNumber()
+       {
+               return atoi(nodeNumber->text().toAscii().data());
+       }
+       
+       /**
+        * Returns entered in dialog message
+        * @return message from this dialog textarea
+        */
+       QString getMessage()
+       {
+               return message->toPlainText();
+       }
+};
+
+
+#endif /* VLP_SEND_MESSAGE_H */