2008-06-20 08:43:23 -04:00
|
|
|
/****************************************************************
|
|
|
|
* RetroShare is distributed under the following license:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008 Robert Fernie
|
|
|
|
*
|
|
|
|
* 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., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
#ifndef _GENERAL_MSG_DIALOG_H
|
|
|
|
#define _GENERAL_MSG_DIALOG_H
|
|
|
|
|
|
|
|
#include "ui_GeneralMsgDialog.h"
|
|
|
|
|
2008-06-24 00:36:45 -04:00
|
|
|
class SubDestItem;
|
|
|
|
class SubFileItem;
|
|
|
|
class FileInfo;
|
|
|
|
|
|
|
|
const uint32_t GMD_TYPE_MESSAGE_IDX = 0;
|
|
|
|
const uint32_t GMD_TYPE_FORUM_IDX = 1;
|
|
|
|
const uint32_t GMD_TYPE_CHANNEL_IDX = 2;
|
|
|
|
const uint32_t GMD_TYPE_BLOG_IDX = 3;
|
|
|
|
|
2008-06-20 08:43:23 -04:00
|
|
|
class GeneralMsgDialog : public QDialog, private Ui::GeneralMsgDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/** Default Constructor */
|
2008-06-24 00:36:45 -04:00
|
|
|
GeneralMsgDialog(QWidget *parent = 0, uint32_t type = 0);
|
2008-06-20 08:43:23 -04:00
|
|
|
/** Default Destructor */
|
|
|
|
|
2008-06-24 00:36:45 -04:00
|
|
|
void addAttachment(std::string path);
|
2008-07-06 12:03:16 -04:00
|
|
|
void addAttachment(std::string hash, std::string fname, uint64_t size,
|
|
|
|
bool local, std::string srcId);
|
2008-07-04 10:41:24 -04:00
|
|
|
|
2008-06-24 00:36:45 -04:00
|
|
|
void addDestination(uint32_t type, std::string grpId, std::string inReplyTo);
|
2008-07-04 10:41:24 -04:00
|
|
|
void setMsgType(uint32_t type);
|
2008-06-24 00:36:45 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void dragEnterEvent(QDragEnterEvent *event);
|
|
|
|
virtual void dropEvent(QDropEvent *event);
|
2008-06-20 08:43:23 -04:00
|
|
|
|
2008-06-24 00:36:45 -04:00
|
|
|
private slots:
|
2009-05-06 17:15:12 -04:00
|
|
|
void addExtraFile();
|
2008-07-06 12:03:16 -04:00
|
|
|
void checkAttachmentReady();
|
2008-06-24 00:36:45 -04:00
|
|
|
void updateGroupId();
|
|
|
|
void newDestination();
|
|
|
|
void cancelMsg();
|
|
|
|
void sendMsg();
|
2008-06-20 08:43:23 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2008-07-04 10:41:24 -04:00
|
|
|
void parseRsFileListAttachments(std::string attachList);
|
|
|
|
|
2008-06-24 00:36:45 -04:00
|
|
|
void sendMessage(uint32_t type, std::string grpId, std::string inReplyTo,
|
|
|
|
std::wstring subject, std::wstring msg, std::list<FileInfo> &files);
|
|
|
|
|
|
|
|
|
|
|
|
/* maps of files and destinations */
|
|
|
|
std::list<SubDestItem *> mDestinations;
|
|
|
|
std::list<SubFileItem *> mAttachments;
|
2008-07-06 12:03:16 -04:00
|
|
|
|
|
|
|
bool mCheckAttachment;
|
2008-06-20 08:43:23 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|