| 1 | /* |
|---|
| 2 | * QuteCom, a voice over Internet phone |
|---|
| 3 | * Copyright (C) 2010 Mbdsys |
|---|
| 4 | * |
|---|
| 5 | * This program is free software; you can redistribute it and/or modify |
|---|
| 6 | * it under the terms of the GNU General Public License as published by |
|---|
| 7 | * the Free Software Foundation; either version 2 of the License, or |
|---|
| 8 | * (at your option) any later version. |
|---|
| 9 | * |
|---|
| 10 | * This program is distributed in the hope that it will be useful, |
|---|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | * GNU General Public License for more details. |
|---|
| 14 | * |
|---|
| 15 | * You should have received a copy of the GNU General Public License |
|---|
| 16 | * along with this program; if not, write to the Free Software |
|---|
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 18 | */ |
|---|
| 19 | |
|---|
| 20 | #ifndef OWSENDFILESESSION_H |
|---|
| 21 | #define OWSENDFILESESSION_H |
|---|
| 22 | |
|---|
| 23 | #include <coipmanager/filesessionmanager/ISendFileSession.h> |
|---|
| 24 | #include <coipmanager/session/Session.h> |
|---|
| 25 | |
|---|
| 26 | class ISendFileSessionPlugin; |
|---|
| 27 | |
|---|
| 28 | /** |
|---|
| 29 | * File Session. |
|---|
| 30 | * |
|---|
| 31 | * Interface to File transfer services. |
|---|
| 32 | * |
|---|
| 33 | * - Send mode: 'start' starts sending files by creating a FileSession per |
|---|
| 34 | * Contact and per file. 'stop' stops the transfer. |
|---|
| 35 | * |
|---|
| 36 | * @see TestFileSession for an example |
|---|
| 37 | * |
|---|
| 38 | * @ingroup CoIpManager |
|---|
| 39 | * @author Philippe Bernery |
|---|
| 40 | */ |
|---|
| 41 | class COIPMANAGER_API SendFileSession : public Session, public ISendFileSession { |
|---|
| 42 | Q_OBJECT |
|---|
| 43 | friend class FileSessionManager; |
|---|
| 44 | public: |
|---|
| 45 | |
|---|
| 46 | virtual ~SendFileSession(); |
|---|
| 47 | |
|---|
| 48 | // Inherited from Session |
|---|
| 49 | virtual void start(); |
|---|
| 50 | |
|---|
| 51 | virtual void pause(); |
|---|
| 52 | |
|---|
| 53 | virtual void resume(); |
|---|
| 54 | |
|---|
| 55 | virtual void stop(); |
|---|
| 56 | //// |
|---|
| 57 | |
|---|
| 58 | Q_SIGNALS: |
|---|
| 59 | |
|---|
| 60 | /** |
|---|
| 61 | * @see ISendFileSessionPlugin::fileTransferSignal |
|---|
| 62 | */ |
|---|
| 63 | void fileTransferSignal(IFileSession::IFileSessionEvent event); |
|---|
| 64 | |
|---|
| 65 | /** |
|---|
| 66 | * @see ISendFileSessionPlugin::fileTransferProgressionSignal |
|---|
| 67 | */ |
|---|
| 68 | void fileTransferProgressionSignal(int percentage); |
|---|
| 69 | |
|---|
| 70 | private Q_SLOTS: |
|---|
| 71 | |
|---|
| 72 | /** |
|---|
| 73 | * @see ISendFileSessionPlugin::fileTransferSignal |
|---|
| 74 | */ |
|---|
| 75 | void fileTransferSlot(IFileSession::IFileSessionEvent event); |
|---|
| 76 | |
|---|
| 77 | /** |
|---|
| 78 | * @see ISendFileSessionPlugin::fileTransferProgressionSignal |
|---|
| 79 | */ |
|---|
| 80 | void fileTransferProgressionSlot(int percentage); |
|---|
| 81 | |
|---|
| 82 | private: |
|---|
| 83 | |
|---|
| 84 | virtual bool canCreateISession(const Account & account, const ContactList & contactList) const; |
|---|
| 85 | |
|---|
| 86 | /** |
|---|
| 87 | * Creates a SendFileSession. |
|---|
| 88 | * |
|---|
| 89 | * @param userProfile link to UserProfile |
|---|
| 90 | */ |
|---|
| 91 | SendFileSession(CoIpManager & coIpManager); |
|---|
| 92 | |
|---|
| 93 | /** Pointer to running ISendFileSessionPlugin. */ |
|---|
| 94 | ISendFileSessionPlugin * _currentFileSessionPlugin; |
|---|
| 95 | |
|---|
| 96 | }; |
|---|
| 97 | |
|---|
| 98 | #endif //OWSENDFILESESSION_H |
|---|