File: CDrivers.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 (102 lines) | stat: -rw-r--r-- 3,419 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/**************************************************
 * CDrivers
 *
 * Drivers can be accessed via at least three methods. I
 * show all three in use in the constructer but I
 * recommend using SQLDrivers in the Driver Manager as
 * the best method.
 *
 **************************************************
 * This code was created by Peter Harvey @ CodeByDesign.
 * Released under GPL 31.JAN.99
 *
 * Contributions from...
 * -----------------------------------------------
 * Peter Harvey		- pharvey@codebydesign.com
 **************************************************/
#ifndef CDrivers_included
#define CDrivers_included

#include <sys/types.h>
#include <pwd.h>
#include <unistd.h>

#include <ini.h>
#include <odbcinstext.h>

#ifdef QT_V4LAYOUT
#define QT3_SUPPORT
#include <Qt/qmessagebox.h>
#include <Qt/qwidget.h>
#include <Qt/q3listview.h>
#include <Qt/qpushbutton.h>
#include <Qt/qpixmap.h>
#include <Qt/qlayout.h>
#include <Qt/qlabel.h>
#include <Qt/qframe.h>
#include <Qt/qlistview.h>
#else
#include <qmessagebox.h>
#include <qwidget.h>
#include <qlistview.h>
#include <qpushbt.h>
#include <qpixmap.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qframe.h>
#include <qlistview.h>
#endif

#include "CPropertiesFrame.h"

#define ODBC_HELP_DRIVER_NAME "*Unique* driver name."
#define ODBC_HELP_DRIVER_DESC "Driver description."
#define ODBC_HELP_DRIVER_DRIVER "The driver. Its a share library and the filename will probably have odbc in it and it will probably end with *.so."
#define ODBC_HELP_DRIVER_DRIVER64 "The driver for 64 bit environments. Its a share library and the filename will probably have odbc in it and it will probably end with *.so."
#define ODBC_HELP_DRIVER_SETUP "The setup routines. Its a share library used to provide this program with DSN properties which can be presented to the user to edit. This library filename usually ends with a *S.so."
#define ODBC_HELP_DRIVER_SETUP64 "The setup routines for 64 bit environments. Its a share library used to provide this program with DSN properties which can be presented to the user to edit. This library filename usually ends with a *S.so."
#define ODBC_HELP_DRIVER_USAGECOUNT "The number of installs that use this driver. This driver entry should be removed when < 1."
#define ODBC_HELP_DRIVER_CPTIMEOUT "Number of seconds before a connection timesout when in a Connection Pool. Leave this value blank to disable Connection Pooling."
#define ODBC_HELP_DRIVER_CPREUSE "The maximum number of times a connection can be reused in a Connection Pool. Set to a lower number when dealing with drivers which have stability issues or memory leaks."
#define ODBC_HELP_DRIVER_UNKNOWN "No help for this driver specific property. Please check with the vendor of the driver... perhaps their web site"

class CDrivers : public QWidget
{
    Q_OBJECT

public:

    CDrivers( QWidget* parent = NULL, const char* name = NULL );
    ~CDrivers();

#ifdef QT_V4LAYOUT
	Q3ListView *getListView() { return lvwDrivers; };
#else
	QListView *getListView() { return lvwDrivers; };
#endif

public slots:
	void Add();
	void Edit();
	void Delete();

protected:
    QPushButton* pbAdd;
    QPushButton* pbRemove;
    QPushButton* pbConfigure;
#ifdef QT_V4LAYOUT
    Q3ListView* lvwDrivers;
#else
    QListView* lvwDrivers;
#endif

private:
	HINI	hIni;
	char 	szINI[ODBC_FILENAME_MAX+1];

	void	Load();
	void	FreeProperties( HODBCINSTPROPERTY *hFirstProperty );

};
#endif