summaryrefslogtreecommitdiffstats
blob: 8b62df80e31bed58a121c0d4b3056fb4f837c3bf (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 * Copyright (c) 2010-2016 Isode Limited.
 * All rights reserved.
 * See the COPYING file for more information.
 */

#include <SwifTools/Idle/PlatformIdleQuerier.h>
#include <Swiften/Base/Platform.h>

#if defined(SWIFTEN_PLATFORM_MACOSX) && defined(HAVE_IOKIT) && !defined(SWIFTEN_PLATFORM_IPHONE)
#include <SwifTools/Idle/MacOSXIdleQuerier.h>
#elif defined(SWIFTEN_PLATFORM_WINDOWS)
#include <SwifTools/Idle/WindowsIdleQuerier.h>
#elif defined(HAVE_XSS)
#include <SwifTools/Idle/XSSIdleQuerier.h>
#endif
#include <SwifTools/Idle/DummyIdleQuerier.h>

#include <cassert>
#include <iostream>

namespace Swift {

PlatformIdleQuerier::PlatformIdleQuerier() : querier(nullptr) {
#if defined(SWIFTEN_PLATFORM_MACOSX)
#if defined(HAVE_IOKIT) && !defined(SWIFTEN_PLATFORM_IPHONE)
    querier = new MacOSXIdleQuerier();
#else
    querier = new DummyIdleQuerier();
#endif
#elif defined(SWIFTEN_PLATFORM_WINDOWS)
    querier = new WindowsIdleQuerier();
#elif defined(HAVE_XSS)
    querier = new XSSIdleQuerier();
#else
    querier = new DummyIdleQuerier();
#endif
}

PlatformIdleQuerier::~PlatformIdleQuerier() {
    delete querier;
}

}