summaryrefslogtreecommitdiff
path: root/libsql/osqlmanager.h
blob: b3d8d6931a43723b75c9b85e45efd6f3b6200134 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

#ifndef OSQL_MANAGER_H
#define OSQL_MANAGER_H

#include <qobject.h>

#include "osqlbackend.h"

/**
 * OSQLManager is responsible for loading
 * and unloading, querying different OSQL
 * services
 * Load a OSQLDriver and delete it yourself
 *
 */
class OSQLDriver;
class OSQLManager : public QObject {
    Q_OBJECT
public:
    /**
     * Empty c'tor
     */
    OSQLManager();

    /**
     * Query the Manager for different backends
     */
    OSQLBackEnd::ValueList queryBackEnd();

    /**
     * Load a backend with it's name from param name
     */
    OSQLDriver* load( const QString& name );

    /**
     * Load a OSQLDevice from const reference of OSQLBackEnd
     */
    OSQLDriver* load( const OSQLBackEnd& );

    /**
     * loads the Opie standard backend
     */
    OSQLDriver *standard();

    /**
     * register path to the search path list
     * When querying for services we scan all the
     * registered path for backends
     */
    void registerPath( const QString& path );

    /**
     * unregisterPath from the search path list
     */
    bool unregisterPath( const QString& path );
private:
    OSQLBackEnd::ValueList builtIn()const;
    OSQLBackEnd::ValueList m_list;
    QStringList m_path;
};

#endif