File: CDataSourceNames.h

package info (click to toggle)
unixodbc 2.2.14p2-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 14,628 kB
  • ctags: 12,533
  • sloc: ansic: 104,243; cpp: 38,571; sh: 15,958; makefile: 2,727; sql: 1
file content (57 lines) | stat: -rw-r--r-- 2,005 bytes parent folder | download | duplicates (2)
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
/*!
 * \file
 *
 * \author  Peter Harvey <pharvey@peterharvey.org>
 * \author  \sa AUTHORS file
 * \version 2
 * \date    2007
 * \license Copyright unixODBC Project 2007-2008, LGPL
 */
#ifndef CDATASOURCENAMES_H
#define CDATASOURCENAMES_H

#include "CODBCInst.h"

#define ODBC_HELP_DATASOURCES_USER "User Data Source Names (DSN's) exist for use by a specific system account (User). The DSN's are typically stored somewhere in the User's home directory. These have precedence over System DSN's when DSN exists in both."
#define ODBC_HELP_DATASOURCES_SYSTEM "System Data Source Names (DSN's) exist for use by all system accounts. Elevated privileges (such as 'root') are normally required to manage these."

class CDataSourceNameList;

/*!
 * \class   CDataSourceNames
 * 
 * \brief   Widget to allow Data Source Names (DSN's) to be managed.
 *
 *          This is used to support \sa CManageDataSourceNames by implementing
 *          the bulk of the features in a way which is useful for a specific scope.
 *          This widget can be instantiated with ODBC_USER_DSN to support managing
 *          User DSN's or with ODBC_SYSTEM_DSN to support managing System DSN's.
 * 
 *          Basically; this widget wraps some buttons around a CDataSourceNames so that
 *          the DSN's can be; Added, Edited, or Removed.
 *
 * \note    Do NOT try to use this to manage ODBC_BOTH_DSN. See \sa CManageDataSourceNames
 *          for that.
 *
 * \sa      CManageDataSourceNames
 *          CDataSourceNamesFile
 */
class CDataSourceNames : public QWidget
{
    Q_OBJECT
public:
    CDataSourceNames( QWidget* pwidgetParent = NULL, int nSource = ODBC_USER_DSN );
    virtual ~CDataSourceNames();

    QString windowHelp() { if ( nSource == ODBC_USER_DSN ) return QString( tr( ODBC_HELP_DATASOURCES_USER ) ); return QString( tr( ODBC_HELP_DATASOURCES_SYSTEM ) ); }

public slots:
    void slotLoad();

protected:
    int                     nSource;
    CDataSourceNameList *   pDataSourceNameList;
};

#endif