new 4475edb243ed4627f4c5f2c470ca40b3def034d4
[tagua/yd.git] / src / variant.h
blob65caa5298e5e6d921d48ef71fee87c2763063348
1 /*
2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2007 Maurizio Monge <maurizio.monge@kdemail.net>
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 */
11 #ifndef CORE__VARIANT_H
12 #define CORE__VARIANT_H
14 #include <KPluginFactory>
15 #include <KPluginLoader>
17 #include <core/repository.h>
19 /**
20 * @brief A Variant instance represents a game supported in Tagua.
22 class TAGUA_EXPORT Variant {
23 QString m_name;
24 QString m_proxy;
25 bool m_hidden;
26 Repository* m_repo;
27 public:
28 Variant(const QString& name, Repository* repo,
29 const QString& proxy = QString(),
30 bool hidden = false);
32 ~Variant();
34 QString name() const;
36 QString proxy() const;
38 bool hidden() const;
40 const Repository* repository() const;
41 Repository* repository();
44 template <typename Interface>
45 Interface* requestComponent(Variant* var, const QString& component) {
46 return requestInterface<Interface>(var->repository()->getComponent(component));
49 #endif // CORE__VARIANT_H