Attribute VB_Name = "modDeclarations"
Option Explicit

Public Type SAFEARRAYBOUND
    cElements           As Long
    lLbound             As Long
End Type

Public Type SAFEARRAY2D
    cDims               As Integer
    fFeatures           As Integer
    cbElements          As Long
    cLocks              As Long
    pvData              As Long
    Bounds(0 To 1)      As SAFEARRAYBOUND
End Type

Public Type BITMAP
    bmType              As Long
    bmWidth             As Long
    bmHeight            As Long
    bmWidthBytes        As Long
    bmPlanes            As Integer
    bmBitsPixel         As Integer
    bmBits              As Long
End Type

Public Type ServerDetails
    Database    As String
    User        As String
    Pwd         As String
    Host        As String
    Port        As String
End Type

Public Type POINT
    x As Long
    y As Long
End Type

Public Type PALETTEENTRY
    peRed   As Byte
    peGreen As Byte
    peBlue  As Byte
    peFlags As Byte
End Type

Public Type LOGPALETTE
    palVersion       As Integer
    palNumEntries    As Integer
    palPalEntry(255) As PALETTEENTRY  ' Enough for 256 colors
End Type
         
Public Type GUID
    Data1    As Long
    Data2    As Integer
    Data3    As Integer
    Data4(7) As Byte
End Type

Public Type RECT
    left   As Long
    top    As Long
    Right  As Long
    Bottom As Long
End Type

Public Type PicBmp
    Size As Long
    Type As Long
    hBmp As Long
    hPal As Long
    Reserved As Long
End Type

Public Type CAPSTATUS
    uiImageWidth                    As Long
    uiImageHeight                   As Long
    fLiveWindow                     As Long
    fOverlayWindow                  As Long
    fScale                          As Long
    ptScroll                        As POINT
    fUsingDefaultPalette            As Long
    fAudioHardware                  As Long
    fCapFileExists                  As Long
    dwCurrentVideoFrame             As Long
    dwCurrentVideoFramesDropped     As Long
    dwCurrentWaveSamples            As Long
    dwCurrentTimeElapsedMS          As Long
    hPalCurrent                     As Long
    fCapturingNow                   As Long
    dwReturn                        As Long
    wNumVideoAllocated              As Long
    wNumAudioAllocated              As Long
End Type

Public Type dbTable
    Name                            As String
    Columns()                       As String
End Type

Public Enum OpenModeConstants
    omc_VIEW = 0
    omc_ADD
    omc_EDIT
End Enum

Public Enum RecordSaveModeConstants
    rsmc_ADDNEW = 0
    rsmc_UPDATE
    rsmc_NONE
End Enum

Public Const WM_USER                        As Long = &H400
Public Const WM_CAP_DRIVER_CONNECT          As Long = (WM_USER + &HA)
Public Const WM_CAP_DRIVER_DISCONNECT       As Long = (WM_USER + &HB)
Public Const WM_CAP_SET_PREVIEWRATE         As Long = (WM_USER + &H34)
Public Const WM_CAP_SET_PREVIEW             As Long = (WM_USER + &H32)
Public Const WM_CAP_GET_STATUS              As Long = (WM_USER + &H36)
Public Const HWND_TOP                       As Long = 0
Public Const SWP_NOMOVE                     As Long = &H2
Public Const SWP_NOZORDER                   As Long = &H4
Public Const SWP_NOENDCHANGING              As Long = &H400
Public Const WS_VISIBLE                     As Long = &H10000000
Public Const WS_CHILD                       As Long = &H40000000

Public Const HWND_TOPMOST                   As Long = -1
Public Const HWND_NOTOPMOST                 As Long = -2
Public Const SWP_NOACTIVATE                 As Long = &H10
Public Const SWP_SHOWWINDOW                 As Long = &H40

Public Const RASTERCAPS                     As Long = 38
Public Const RC_PALETTE                     As Long = &H100
Public Const SIZEPALETTE                    As Long = 104

Public Const REPORT_HEADING                 As String = "Republic of the Philippines" & vbCrLf & _
                                                        "Department of Interior and Local Government" & vbCrLf & _
                                                        "BUREAU OF JAIL MANAGEMENT AND PENOLOGY" & vbCrLf & _
                                                        "NAME OF JAIL" & vbCrLf & _
                                                        "Address" & vbCrLf & _
                                                        "Contact Numbers"

Public Const MSG_PROMPT                     As String = "Scan your ? four (4) times."
Public Const MSG_INITIAL                    As String = "To begin, scan your ? and wait until success is confirmed. Repeat for each of the remaining scans."
Public Const MSG_NEXT                       As String = "The scan was successful. Place your ? on the fingerprint reader again."
Public Const MSG_NOTOK                      As String = "Try again. Place your ? flat on the fingerprint reader."
Public Const MSG_AGAIN                      As String = "The scan was not successful. Try again from the beginning and place your ? flat on the fingerprint reader."
Public Const MSG_SUCCESSFUL                 As String = "The fingerprint was successfully enrolled."

Public Const DEL1                           As String = ":"
Public Const DEL2                           As String = "|"
Public Const SEP1                           As String = ","
Public Const EMPTY_STRING                   As String = ""
Public Const DATE_FORMAT_MYSQL              As String = "YYYY-MM-DD HH:MM:SS"
Public Const DATE_FORMAT_DISPLAY            As String = "yyyy-MMMM-dd"

Public Const ADD_CAPTION                    As String = "&Add"
Public Const SAVE_CAPTION                   As String = "&Save"
Public Const EDIT_CAPTION                   As String = "&Edit"
Public Const UPDATE_CAPTION                 As String = "&Update"
Public Const CLOSE_CAPTION                  As String = "Cl&ose"
Public Const CANCEL_CAPTION                 As String = "&Cancel"
Public Const DELETE_CAPTION                 As String = "&Delete"

Public Const CAMERA_CAPTION                 As String = "Start Ca&mera"
Public Const CAPTURE_CAPTION                As String = "Ca&pture"
Public Const STOPCAM_CAPTION                As String = "St&op Camera"
Public Const BROWSE_CAPTION                 As String = "&Browse Image"

Public Const IMAGE_WIDTH                    As Integer = 40
Public Const IMAGE_HEIGHT                   As Integer = 40

Public Declare Function GetDeviceCaps Lib "GDI32" ( _
    ByVal hDC As Long, ByVal iCapabilitiy As Long) As Long

Public Declare Function GetSystemPaletteEntries Lib "GDI32" ( _
    ByVal hDC As Long, ByVal wStartIndex As Long, _
    ByVal wNumEntries As Long, lpPaletteEntries As PALETTEENTRY) As Long

Public Declare Function CreateCompatibleDC Lib "GDI32" ( _
    ByVal hDC As Long) As Long

Public Declare Function CreatePalette Lib "GDI32" ( _
    lpLogPalette As LOGPALETTE) As Long

Public Declare Function SelectPalette Lib "GDI32" ( _
    ByVal hDC As Long, ByVal hPalette As Long, _
    ByVal bForceBackground As Long) As Long

Public Declare Function RealizePalette Lib "GDI32" ( _
    ByVal hDC As Long) As Long

Public Declare Function SelectObject Lib "GDI32" ( _
    ByVal hDC As Long, ByVal hObject As Long) As Long

Public Declare Function BitBlt Lib "GDI32" ( _
    ByVal hDCDest As Long, ByVal XDest As Long, _
    ByVal YDest As Long, ByVal nWidth As Long, _
    ByVal nHeight As Long, ByVal hDCSrc As Long, _
    ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) _
    As Long

Public Declare Function GetWindowDC Lib "user32" ( _
    ByVal hWnd As Long) As Long

Public Declare Function GetDC Lib "user32" ( _
    ByVal hWnd As Long) As Long

Public Declare Function ReleaseDC Lib "user32" ( _
    ByVal hWnd As Long, ByVal hDC As Long) As Long

Public Declare Function DeleteDC Lib "GDI32" ( _
    ByVal hDC As Long) As Long

Public Declare Function GetWindowRect Lib "user32" ( _
    ByVal hWnd As Long, lpRect As RECT) As Long

Public Declare Function GetDesktopWindow Lib "user32" () As Long

Public Declare Function GetForegroundWindow Lib "user32" () As Long

Public Declare Function OleCreatePictureIndirect _
    Lib "olepro32.dll" (PicDesc As PicBmp, RefIID As GUID, _
    ByVal fPictureOwnsHandle As Long, IPic As IPicture) As Long

Public Declare Function GetProp Lib "user32" Alias "GetPropA" ( _
    ByVal hWnd As Long, _
    ByVal lpString As String) As Long

Public Declare Function GetPixel Lib "GDI32" ( _
    ByVal hDC As Long, _
    ByVal x As Long, _
    ByVal y As Long) As Long

Public Declare Function Rectangle Lib "GDI32" ( _
    ByVal hDC As Long, _
    ByVal x1 As Long, _
    ByVal y1 As Long, _
    ByVal x2 As Long, _
    ByVal y2 As Long) As Long

Public Declare Function StretchBlt Lib "GDI32" ( _
    ByVal hDC As Long, _
    ByVal x As Long, _
    ByVal y As Long, _
    ByVal nWidth As Long, _
    ByVal nHeight As Long, _
    ByVal hSrcDC As Long, _
    ByVal xSrc As Long, _
    ByVal ySrc As Long, _
    ByVal nSrcWidth As Long, _
    ByVal nSrcHeight As Long, _
    ByVal dwRop As Long) As Long
    
Public Declare Function capCreateCaptureWindow Lib "avicap32.dll" Alias "capCreateCaptureWindowA" ( _
    ByVal lpszWindowName As String, _
    ByVal dwStyle As Long, _
    ByVal x As Long, _
    ByVal y As Long, _
    ByVal nWidth As Long, _
    ByVal nHeight As Long, _
    ByVal hWndParent As Long, _
    ByVal nID As Long) As Long

Public Declare Function CreateCompatibleBitmap Lib "gdi32.dll" ( _
    ByVal hDC As Long, _
    ByVal nWidth As Long, _
    ByVal nHeight As Long) As Long

Public Declare Function Ellipse Lib "GDI32" ( _
    ByVal hDC As Long, _
    ByVal x1 As Long, _
    ByVal y1 As Long, _
    ByVal x2 As Long, _
    ByVal y2 As Long) As Long

Public Declare Function VarPtrArray Lib "msvbvm50.dll" Alias "VarPtr" ( _
    Ptr() As Any) As Long

Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _
    pDst As Any, _
    pSrc As Any, _
    ByVal ByteLen As Long)

Public Declare Function GetObjectAPI Lib "GDI32" Alias "GetObjectA" ( _
    ByVal hObject As Long, _
    ByVal nCount As Long, _
    lpObject As Any) As Long

Public Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" ( _
    ByVal hWnd As Long, _
    ByVal wMsg As Long, _
    ByVal wParam As Long, _
    ByVal lParam As Long) As Long

Public Declare Function SendMessage_2 Lib "user32.dll" Alias "SendMessageA" ( _
    ByVal hWnd As Long, _
    ByVal wMsg As Long, _
    ByVal wParam As Long, _
    ByRef lParam As CAPSTATUS) As Long

Public Declare Function SetWindowPos Lib "user32.dll" ( _
    ByVal hWnd As Long, _
    ByVal hWndInsertAfter As Long, _
    ByVal x As Long, _
    ByVal y As Long, _
    ByVal cx As Long, _
    ByVal cy As Long, _
    ByVal wFlags As Long) As Long
    
Public Declare Sub Sleep Lib "kernel32" ( _
    ByVal dwMilliseconds As Long)

Public hCapWin                          As Long
Public wF                               As Long
Public hF                               As Long

Public sql                              As String
Public userID                           As String
Public loginDateTime                    As String
Public PC                               As String

Public myBackEnd                        As BackEnd
Public db_server                        As ServerDetails
Public faces                            As ClassFaceRecogniser





