diff options
Diffstat (limited to 'Swift/Controllers/UIInterfaces')
4 files changed, 60 insertions, 2 deletions
diff --git a/Swift/Controllers/UIInterfaces/ChatWindow.h b/Swift/Controllers/UIInterfaces/ChatWindow.h index faef5c8..b90efd9 100644 --- a/Swift/Controllers/UIInterfaces/ChatWindow.h +++ b/Swift/Controllers/UIInterfaces/ChatWindow.h @@ -24,12 +24,14 @@ namespace Swift { class TabComplete; class RosterItem; class ContactRosterItem; + class FileTransferController; class ChatWindow { public: enum AckState {Pending, Received, Failed}; enum Tristate {Yes, No, Maybe}; enum OccupantAction {Kick}; + enum FileTransferState {WaitingForAccept, Negotiating, Transferring, Canceled, Finished, FTFailed}; ChatWindow() {} virtual ~ChatWindow() {}; @@ -45,6 +47,11 @@ namespace Swift { virtual void addPresenceMessage(const std::string& message) = 0; virtual void addErrorMessage(const std::string& message) = 0; virtual void replaceMessage(const std::string& message, const std::string& id, const boost::posix_time::ptime& time) = 0; + + // File transfer related stuff + virtual std::string addFileTransfer(const std::string& senderName, bool senderIsSelf, const std::string& filename, const boost::uintmax_t sizeInBytes) = 0; + virtual void setFileTransferProgress(std::string, const int percentageDone) = 0; + virtual void setFileTransferStatus(std::string, const FileTransferState state, const std::string& msg = "") = 0; virtual void setContactChatState(ChatState::ChatStateType state) = 0; virtual void setName(const std::string& name) = 0; @@ -88,6 +95,12 @@ namespace Swift { boost::signal<void ()> onAlertButtonClicked; boost::signal<void (ContactRosterItem*)> onOccupantSelectionChanged; boost::signal<void (ChatWindow::OccupantAction, ContactRosterItem*)> onOccupantActionSelected; + + // File transfer related + boost::signal<void (std::string /* id */)> onFileTransferCancel; + boost::signal<void (std::string /* id */, std::string /* description */)> onFileTransferStart; + boost::signal<void (std::string /* id */, std::string /* path */)> onFileTransferAccept; + boost::signal<void (std::string /* path */)> onSendFileRequest; }; } #endif diff --git a/Swift/Controllers/UIInterfaces/FileTransferListWidget.h b/Swift/Controllers/UIInterfaces/FileTransferListWidget.h new file mode 100644 index 0000000..01dcfd3 --- /dev/null +++ b/Swift/Controllers/UIInterfaces/FileTransferListWidget.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2011 Tobias Markmann + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#pragma once + +namespace Swift { + +class FileTransferOverview; + +class FileTransferListWidget { +public: + virtual ~FileTransferListWidget() {} + + virtual void show() = 0; + virtual void activate() = 0; + + virtual void setFileTransferOverview(FileTransferOverview*) = 0; +}; + +} diff --git a/Swift/Controllers/UIInterfaces/FileTransferListWidgetFactory.h b/Swift/Controllers/UIInterfaces/FileTransferListWidgetFactory.h new file mode 100644 index 0000000..0b08fb3 --- /dev/null +++ b/Swift/Controllers/UIInterfaces/FileTransferListWidgetFactory.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2011 Tobias Markmann + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#pragma once + +#include "Swift/Controllers/UIInterfaces/FileTransferListWidget.h" + +namespace Swift { + +class FileTransferListWidgetFactory { +public: + virtual ~FileTransferListWidgetFactory() {} + + virtual FileTransferListWidget* createFileTransferListWidget() = 0; +}; + +} diff --git a/Swift/Controllers/UIInterfaces/UIFactory.h b/Swift/Controllers/UIInterfaces/UIFactory.h index 57f55d0..cf89dab 100644 --- a/Swift/Controllers/UIInterfaces/UIFactory.h +++ b/Swift/Controllers/UIInterfaces/UIFactory.h @@ -18,6 +18,7 @@ #include <Swift/Controllers/UIInterfaces/ProfileWindowFactory.h> #include <Swift/Controllers/UIInterfaces/ContactEditWindowFactory.h> #include <Swift/Controllers/UIInterfaces/AdHocCommandWindowFactory.h> +#include <Swift/Controllers/UIInterfaces/FileTransferListWidgetFactory.h> namespace Swift { class UIFactory : @@ -27,12 +28,13 @@ namespace Swift { public LoginWindowFactory, public MainWindowFactory, public MUCSearchWindowFactory, - public XMLConsoleWidgetFactory, + public XMLConsoleWidgetFactory, public UserSearchWindowFactory, public JoinMUCWindowFactory, public ProfileWindowFactory, public ContactEditWindowFactory, - public AdHocCommandWindowFactory { + public AdHocCommandWindowFactory, + public FileTransferListWidgetFactory { public: virtual ~UIFactory() {} }; |