| 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 OWFILESESSIONMANAGER_H |
|---|
| 21 | #define OWFILESESSIONMANAGER_H |
|---|
| 22 | |
|---|
| 23 | #include <coipmanager/ICoIpSessionManager.h> |
|---|
| 24 | |
|---|
| 25 | #include <coipmanager/filesessionmanager/IFileSessionManagerPlugin.h> |
|---|
| 26 | #include <coipmanager/filesessionmanager/ReceiveFileSession.h> |
|---|
| 27 | |
|---|
| 28 | class Account; |
|---|
| 29 | class CoIpModule; |
|---|
| 30 | class IFileSessionManagerPlugin; |
|---|
| 31 | class IReceiveFileSessionPlugin; |
|---|
| 32 | class ISendFileSessionPlugin; |
|---|
| 33 | class SendFileSession; |
|---|
| 34 | |
|---|
| 35 | /** |
|---|
| 36 | * File Session Manager. |
|---|
| 37 | * |
|---|
| 38 | * Used to manage classes related to File Transfer. |
|---|
| 39 | * |
|---|
| 40 | * @ingroup CoIpManager |
|---|
| 41 | * @author Philippe Bernery |
|---|
| 42 | */ |
|---|
| 43 | class COIPMANAGER_API FileSessionManager : public ICoIpSessionManager { |
|---|
| 44 | Q_OBJECT |
|---|
| 45 | friend class SendFileSession; |
|---|
| 46 | public: |
|---|
| 47 | |
|---|
| 48 | FileSessionManager(CoIpManager & coIpManager); |
|---|
| 49 | |
|---|
| 50 | virtual ~FileSessionManager(); |
|---|
| 51 | |
|---|
| 52 | /** |
|---|
| 53 | * Creates a SendFileSession. Caller is responsible for deleting the |
|---|
| 54 | * Session. |
|---|
| 55 | */ |
|---|
| 56 | SendFileSession * createSendFileSession(); |
|---|
| 57 | |
|---|
| 58 | virtual IFileSessionManagerPlugin * getICoIpManagerPlugin(const Account & account, const ContactList & contactList) const; |
|---|
| 59 | |
|---|
| 60 | Q_SIGNALS: |
|---|
| 61 | /** |
|---|
| 62 | * Emitted when a new ReceiveFileSession |
|---|
| 63 | * |
|---|
| 64 | * @param sender this class |
|---|
| 65 | * @param fileSession pointer to the newly created FileSession. The receiver of the signal is responsible to delete the Session. |
|---|
| 66 | */ |
|---|
| 67 | void newReceiveFileSessionCreatedSignal(ReceiveFileSession * fileSession); |
|---|
| 68 | |
|---|
| 69 | /** |
|---|
| 70 | * TODO: to be changed: if a new implementation of File transfer is created, |
|---|
| 71 | * these events will not be valid anymore. There should in a class like Session |
|---|
| 72 | * |
|---|
| 73 | * @see IFileSessionManagerPlugin::needsUpgradeEvent |
|---|
| 74 | */ |
|---|
| 75 | void needsUpgradeSignal(); |
|---|
| 76 | |
|---|
| 77 | /** |
|---|
| 78 | * @see IFileSessionManagerPlugin::peerNeedsUpgradeEvent |
|---|
| 79 | */ |
|---|
| 80 | void peerNeedsUpgradeSignal(Contact contact); |
|---|
| 81 | |
|---|
| 82 | private Q_SLOTS: |
|---|
| 83 | |
|---|
| 84 | /** |
|---|
| 85 | * @see IFileSessionManagerPlugin::newIReceiveFileSessionCreatedEvent |
|---|
| 86 | */ |
|---|
| 87 | void newIReceiveFileSessionPluginCreatedSlot(IReceiveFileSessionPlugin * iReceiveFileSession); |
|---|
| 88 | |
|---|
| 89 | /** |
|---|
| 90 | * @see IFileSessionManagerPlugin::needsUpgradeEventHandler |
|---|
| 91 | */ |
|---|
| 92 | void needsUpgradeSlot(); |
|---|
| 93 | |
|---|
| 94 | /** |
|---|
| 95 | * @see IFileSessionManagerPlugin::peerNeedsUpgradeEventHandler |
|---|
| 96 | */ |
|---|
| 97 | void peerNeedsUpgradeSlot(IMContact imContact); |
|---|
| 98 | |
|---|
| 99 | private: |
|---|
| 100 | |
|---|
| 101 | virtual void initialize(); |
|---|
| 102 | |
|---|
| 103 | virtual void uninitialize(); |
|---|
| 104 | }; |
|---|
| 105 | |
|---|
| 106 | #endif //OWFILESESSIONMANAGER_H |
|---|