summaryrefslogtreecommitdiffstats
blob: 5c55627051e531e8a2ed3334ab7519515aaaaddb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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);
	}
}

}