blob: 5da3c9fb93fe7eadf323f51930ffe1000bc7fb77 [file] [log] [blame]
Dennis Syrovatsky139d7832005-11-02 05:36:05 +00001/* Copyright (C) 2005 TightVNC Team. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 *
18 * TightVNC distribution homepage on the Web: http://www.tightvnc.com/
19 *
20 */
21
22// -=- FileTransfer.cxx
23
24#include <vncviewer/FileTransfer.h>
25
26using namespace rfb;
27using namespace rfb::win32;
28
29FileTransfer::FileTransfer()
30{
Dennis Syrovatsky4ab41852005-11-07 09:52:36 +000031 m_bFTDlgShown = false;
Dennis Syrovatsky5c761172005-11-09 04:19:05 +000032 m_bInitialized = false;
33
Dennis Syrovatsky4ab41852005-11-07 09:52:36 +000034 m_pFTDialog = new FTDialog(GetModuleHandle(0), this);
Dennis Syrovatsky63943a32005-11-10 06:24:56 +000035
36 m_pReader = NULL;
37 m_pWriter = NULL;
Dennis Syrovatsky139d7832005-11-02 05:36:05 +000038}
39
40FileTransfer::~FileTransfer()
41{
Dennis Syrovatsky4ab41852005-11-07 09:52:36 +000042 if (m_pFTDialog != NULL) {
43 delete m_pFTDialog;
44 m_pFTDialog = NULL;
45 }
46}
Dennis Syrovatsky139d7832005-11-02 05:36:05 +000047
Dennis Syrovatsky5c761172005-11-09 04:19:05 +000048bool
49FileTransfer::initialize(rdr::InStream *pIS, rdr::OutStream *pOS)
50{
51 if (m_bInitialized) return false;
52
Dennis Syrovatsky63943a32005-11-10 06:24:56 +000053 m_pReader = new FTMsgReader(pIS);
54 m_pWriter = new FTMsgWriter(pOS);
Dennis Syrovatsky5c761172005-11-09 04:19:05 +000055
56 m_bInitialized = true;
57 return true;
58}
59
60bool
Dennis Syrovatskyb595e032005-11-09 06:24:25 +000061FileTransfer::show()
Dennis Syrovatsky4ab41852005-11-07 09:52:36 +000062{
Dennis Syrovatskyda17d212005-11-09 05:58:30 +000063 if (!m_bInitialized) return false;
64
Dennis Syrovatsky4ab41852005-11-07 09:52:36 +000065 m_bFTDlgShown = m_pFTDialog->createFTDialog();
Dennis Syrovatsky5c761172005-11-09 04:19:05 +000066 return m_bFTDlgShown;
Dennis Syrovatsky139d7832005-11-02 05:36:05 +000067}
Dennis Syrovatsky63943a32005-11-10 06:24:56 +000068
69bool
70FileTransfer::processFTMsg(int type)
71{
72 if (m_bInitialized) return false;
73
74 switch (type)
75 {
76 case msgTypeFileListData:
77 break;
78 case msgTypeFileDownloadData:
79 break;
80 case msgTypeFileUploadCancel:
81 break;
82 case msgTypeFileDownloadFailed:
83 break;
84 case msgTypeFileDirSizeData:
85 break;
86 case msgTypeFileLastRequestFailed:
87 break;
88 default:
89 return false;
90 }
91
92 return false;
93}