# class toConnectionProvider

This class is used to implement new database providers. More...

Contains pure virtuals
Definition | `#include <toconnection.h>`
List of all Methods

Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- toConnectionProvider (const QCString &provider,bool add=true)
- virtual ~toConnectionProvider ()
- virtual toConnection::connectionImpl * provideConnection (const QCString &provider, toConnection *conn)
- virtual std::list<QString> providedHosts (const QCString &provider)
- virtual std::list<QString> providedDatabases (const QCString &provider, const QString &host, const QString &user, const QString &pwd)
- virtual void initialize (void)
- virtual std::list<QString> providedOptions (const QCString &provider)
- virtual QWidget * providerConfigurationTab (const QCString &provider,QWidget *parent)
- const QString & config (const QCString &tag,const QCString &def)
- void setConfig (const QCString &tag,const QCString &value)

#### Public Static Methods

- static QWidget * configurationTab (const QCString &provider,QWidget *parent)
- static std::list<QCString> providers ()
- static std::list<QString> options (const QCString &provider)
- static toConnection::connectionImpl * connection (const QCString &provider,toConnection *conn)
- static std::list<QString> hosts (const QCString &provider)
- static std::list<QString> databases (const QCString &provider,const QString &host, const QString &user,const QString &pwd)
- static void initializeAll (void)

#### Protected Methods

- void addProvider (const QCString &provider)
- void removeProvider (const QCString &provider)

## Detailed Description

This class is used to implement new database providers.

void addProvider (const QCString &provider)

### addProvider

[protected]

Add a provider to the list that this provider can handle.

void removeProvider (const QCString &provider)

### removeProvider

[protected]

Remove a provider from the list that this provider can handle.

toConnectionProvider (const QCString &provider,bool add=true)

### toConnectionProvider

Create a new provider with the specified name.

Parameters:

provider | Name of the provider.

~toConnectionProvider ()

### ~toConnectionProvider

[virtual]

Destructor.

toConnection::connectionImpl * provideConnection (const QCString &provider, toConnection *conn)

### provideConnection

[pure virtual]

Create an implementation of a connection to this database.

Parameters:

provider | Provider to use for connection.
conn | The connection object to use the created connection.

Returns: A connection implementation created with new.

std::list<QString> providedHosts (const QCString &provider)

### providedHosts

[virtual]

List the available hosts this database provider knows about.

Returns: A list of hosts.

std::list<QString> providedDatabases (const QCString &provider, const QString &host, const QString &user, const QString &pwd)

### providedDatabases

[pure virtual]

List the available databases this provider knows about for a given host.

Parameters:

host | Host to return connections for.
user | That might be needed.
password | That might be needed.

Returns: A list of databases available for a given host.

void initialize (void)

### initialize

[virtual]

Will be called after program has been started and before connections have been opened. Use for initialization.

std::list<QString> providedOptions (const QCString &provider)

### providedOptions

[virtual]

Get a list of options available for the connection. An option with the name "-" indicates a break should be made to separate the rest of the options from the previous options. An option preceeded by "*" means selected by default. The * shoul be stripped before before passing it to the connection call.

QWidget * providerConfigurationTab (const QCString &provider,QWidget *parent)

### providerConfigurationTab

[virtual]

Create and return configuration tab for this connectiontype. The returned widget should also be a childclass of toSettingTab.

Returns: A pointer to the widget containing the setup tab for this tool or NULL of no settings are available.

QWidget * configurationTab (const QCString &provider,QWidget *parent)

### configurationTab

[static]

Get a list of names for providers.

std::list<QCString> providers ()

### providers

[static]

Get a list of names for providers.

std::list<QString> options (const QCString &provider)

### options

[static]

Get a list of options for a given provider.

toConnection::connectionImpl * connection (const QCString &provider,toConnection *conn)

### connection

[static]

Implement a connection for a given provider.

Parameters:

provider | Provider to implement.
conn | Connection to create implementation for.

std::list<QString> hosts (const QCString &provider)

### hosts

[static]

Get a list of hosts this provider knows about.

std::list<QString> databases (const QCString &provider,const QString &host, const QString &user,const QString &pwd)

### databases

[static]

Get a list of databases for a given provider and host.

Parameters:

provider | Provider to fetch databases for.
host | Host to fetch databases for.
user | That might be needed.
password | That might be needed.

Returns: List of known databases.

const QString & config (const QCString &tag,const QCString &def)

### config

Get connection specific settings.

Setting names are hierachical separated by ':' instead of '/' usually used in filenames. As an example all settings for the tool 'Example' would be under the 'Example:{settingname}' name. Observe that the settings are stored under the main provider name as passed to the toConnectionProvider constructor.

Parameters:

tag | The name of the configuration setting.
def | Contents of this setting.

void setConfig (const QCString &tag,const QCString &value)

### setConfig

Change connectionspecific setting. Depending on the implementation this can change the contents on disk or not.

Setting names are hierachical separated by ':' instead of '/' usually used in filenames. As an example all settings for the tool 'Example' would be under the 'Example:{settingname}' name. Observe that the settings are stored under the main provider name as passed to the toConnectionProvider constructor.

Parameters:

tag | The name of the configuration setting.
def | Default value of the setting, if it is not available.

void initializeAll (void)

### initializeAll

[static]

Call all initializers

Generated by: nneul on skyhawk on Wed Feb 23 19:49:58 2005, using kdoc 2.0a54.