Dennis Syrovatsky | 139d783 | 2005-11-02 05:36:05 +0000 | [diff] [blame] | 1 | /* 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 | |
| 26 | using namespace rfb; |
| 27 | using namespace rfb::win32; |
| 28 | |
| 29 | FileTransfer::FileTransfer() |
| 30 | { |
Dennis Syrovatsky | 4ab4185 | 2005-11-07 09:52:36 +0000 | [diff] [blame] | 31 | m_bFTDlgShown = false; |
Dennis Syrovatsky | 5c76117 | 2005-11-09 04:19:05 +0000 | [diff] [blame] | 32 | m_bInitialized = false; |
| 33 | |
Dennis Syrovatsky | 4ab4185 | 2005-11-07 09:52:36 +0000 | [diff] [blame] | 34 | m_pFTDialog = new FTDialog(GetModuleHandle(0), this); |
Dennis Syrovatsky | 5c76117 | 2005-11-09 04:19:05 +0000 | [diff] [blame] | 35 | m_pInStream = NULL; |
| 36 | m_pOutStream = NULL; |
Dennis Syrovatsky | 139d783 | 2005-11-02 05:36:05 +0000 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | FileTransfer::~FileTransfer() |
| 40 | { |
Dennis Syrovatsky | 4ab4185 | 2005-11-07 09:52:36 +0000 | [diff] [blame] | 41 | if (m_pFTDialog != NULL) { |
| 42 | delete m_pFTDialog; |
| 43 | m_pFTDialog = NULL; |
| 44 | } |
| 45 | } |
Dennis Syrovatsky | 139d783 | 2005-11-02 05:36:05 +0000 | [diff] [blame] | 46 | |
Dennis Syrovatsky | 5c76117 | 2005-11-09 04:19:05 +0000 | [diff] [blame] | 47 | bool |
| 48 | FileTransfer::initialize(rdr::InStream *pIS, rdr::OutStream *pOS) |
| 49 | { |
| 50 | if (m_bInitialized) return false; |
| 51 | |
| 52 | m_pInStream = pIS; |
| 53 | m_pOutStream = pOS; |
| 54 | |
| 55 | m_bInitialized = true; |
| 56 | return true; |
| 57 | } |
| 58 | |
| 59 | bool |
| 60 | FileTransfer::create() |
Dennis Syrovatsky | 4ab4185 | 2005-11-07 09:52:36 +0000 | [diff] [blame] | 61 | { |
Dennis Syrovatsky | da17d21 | 2005-11-09 05:58:30 +0000 | [diff] [blame^] | 62 | if (!m_bInitialized) return false; |
| 63 | |
Dennis Syrovatsky | 4ab4185 | 2005-11-07 09:52:36 +0000 | [diff] [blame] | 64 | m_bFTDlgShown = m_pFTDialog->createFTDialog(); |
Dennis Syrovatsky | 5c76117 | 2005-11-09 04:19:05 +0000 | [diff] [blame] | 65 | return m_bFTDlgShown; |
Dennis Syrovatsky | 139d783 | 2005-11-02 05:36:05 +0000 | [diff] [blame] | 66 | } |