2013-08-30 14:38:43 +00:00
|
|
|
/*
|
|
|
|
* synergy -- mouse and keyboard sharing utility
|
|
|
|
* Copyright (C) 2013 Bolton Software Ltd.
|
|
|
|
*
|
|
|
|
* This package is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* found in the file COPYING that should have accompanied this file.
|
|
|
|
*
|
|
|
|
* This package 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, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2014-02-28 12:36:45 +00:00
|
|
|
#include "common/stdvector.h"
|
|
|
|
#include "base/String.h"
|
|
|
|
#include "base/EventTypes.h"
|
2013-08-30 14:38:43 +00:00
|
|
|
|
2014-05-06 18:26:47 +00:00
|
|
|
class CDragInformation;
|
|
|
|
typedef std::vector<CDragInformation> CDragFileList;
|
2013-08-30 14:38:43 +00:00
|
|
|
|
|
|
|
class CDragInformation {
|
|
|
|
public:
|
2014-05-06 18:26:47 +00:00
|
|
|
CDragInformation();
|
2013-08-30 14:38:43 +00:00
|
|
|
~CDragInformation() { }
|
2014-05-06 18:26:47 +00:00
|
|
|
|
|
|
|
CString& getFilename() { return m_filename; }
|
|
|
|
void setFilename(CString& name) { m_filename = name; }
|
|
|
|
size_t getFilesize() { return m_filesize; }
|
|
|
|
void setFilesize(size_t size) { m_filesize = size; }
|
|
|
|
|
2013-08-30 14:38:43 +00:00
|
|
|
static void parseDragInfo(CDragFileList& dragFileList, UInt32 fileNum, CString data);
|
2014-05-14 14:45:15 +00:00
|
|
|
static CString getDragFileExtension(CString filename);
|
|
|
|
// helper function to setup drag info
|
2014-05-06 18:26:47 +00:00
|
|
|
// example: filename1,filesize1,filename2,filesize2,
|
|
|
|
// return file count
|
|
|
|
static int setupDragInfo(CDragFileList& fileList, CString& output);
|
|
|
|
|
2014-05-14 14:45:15 +00:00
|
|
|
static bool isFileValid(CString filename);
|
|
|
|
|
2014-05-06 18:26:47 +00:00
|
|
|
private:
|
|
|
|
static size_t stringToNum(CString& str);
|
|
|
|
static CString getFileSize(CString& filename);
|
|
|
|
|
|
|
|
private:
|
|
|
|
CString m_filename;
|
|
|
|
size_t m_filesize;
|
2013-08-30 14:38:43 +00:00
|
|
|
};
|