diff options
Diffstat (limited to 'Swift/QtUI/QtChatViewFactory.cpp')
-rw-r--r-- | Swift/QtUI/QtChatViewFactory.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Swift/QtUI/QtChatViewFactory.cpp b/Swift/QtUI/QtChatViewFactory.cpp new file mode 100644 index 0000000..5c55627 --- /dev/null +++ b/Swift/QtUI/QtChatViewFactory.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2012 Thilo Cestonaro + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ +#include "QtChatViewFactory.h" +#include "QtBarriersFreeChatView.h" +#include "QtWebKitChatView.h" +#include <Swift/Controllers/UIEvents/UIEventStream.h> + +#include <QDebug> + +namespace Swift { +QtChatView* QtChatViewFactory::createChatView(QtChatTheme* theme, QWidget* parent, UIEventStream* eventStream, SettingsProvider* settings, QMap<QString, QString> emoticons) { + bool barriersFreeChat = settings->getSetting(QtUISettingConstants::BARRIERS_FREE_CHAT_VIEW); + + qDebug() << "[QtChatViewFactory::createChatView] - barriersFreeChat: " << barriersFreeChat; + + if(barriersFreeChat) { + qDebug() << "[QtChatViewFactory::createChatView] - using barriers free chat view ..."; + return new QtBarriersFreeChatView(theme, parent, eventStream, settings, emoticons); + } + else { + qDebug() << "[QtChatViewFactory::createChatView] - using normal chat view ..."; + return new QtWebKitChatView(theme, parent, eventStream, settings, emoticons); + } +} + +} + |