VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "dwDevMode"
Attribute VB_Creatable = True
Attribute VB_Exposed = True
' Desaware API Class library
' Copyright (c) 1996 by Desaware Inc.
' All rights reserved

Private iDevMode As DEVMODE

Public Sub CopyToDEVMODE(ByVal lpDevMode As Long)
    If lpDevMode = 0 Then RaiseError 5, "dwDevMode"
    agCopyData iDevMode, ByVal lpDevMode, Len(iDevMode)
End Sub

Public Sub CopyFromDEVMODE(ByVal lpDevMode As Long)
    If lpDevMode = 0 Then RaiseError 5, "dwDevMode"
    agCopyData ByVal lpDevMode, iDevMode, Len(iDevMode)
End Sub

Public Sub SetDevMode(dmDeviceName As String, dmSpecVersion As Integer, dmDriverVersion As Integer, dmSize As Integer, dmDriverExtra As Integer, dmFields As Long, dmOrientation As Integer, dmPaperSize As Integer, dmPaperLength As Integer, dmPaperWidth As Integer, dmScale As Integer, dmCopies As Integer, dmDefaultSource As Integer, dmPrintQuality As Integer, dmColor As Integer, dmDuplex As Integer, dmYResolution As Integer, dmTTOption As Integer)
    iDevMode.dmDeviceName = dmDeviceName
    iDevMode.dmSpecVersion = dmSpecVersion
    iDevMode.dmDriverVersion = dmDriverVersion
    iDevMode.dmSize = dmSize
    iDevMode.dmDriverExtra = dmDriverExtra
    iDevMode.dmFields = dmFields
    iDevMode.dmOrientation = dmOrientation
    iDevMode.dmPaperSize = dmPaperSize
    iDevMode.dmPaperLength = dmPaperLength
    iDevMode.dmPaperWidth = dmPaperWidth
    iDevMode.dmScale = dmScale
    iDevMode.dmCopies = dmCopies
    iDevMode.dmDefaultSource = dmDefaultSource
    iDevMode.dmPrintQuality = dmPrintQuality
    iDevMode.dmColor = dmColor
    iDevMode.dmDuplex = dmDuplex
    iDevMode.dmYResolution = dmYResolution
    iDevMode.dmTTOption = dmTTOption
End Sub

Public Property Get dmDeviceName() As String
    dmDeviceName = iDevMode.dmDeviceName
End Property

Public Property Let dmDeviceName(vNewValue As String)
    iDevMode.dmDeviceName = vNewValue
End Property

Public Property Get dmSpecVersion() As Integer
    dmSpecVersion = iDevMode.dmSpecVersion
End Property

Public Property Let dmSpecVersion(vNewValue As Integer)
    iDevMode.dmSpecVersion = vNewValue
End Property

Public Property Get dmDriverVersion() As Integer
    dmDriverVersion = iDevMode.dmDriverVersion
End Property

Public Property Let dmDriverVersion(vNewValue As Integer)
    iDevMode.dmDriverVersion = vNewValue
End Property

Public Property Get dmSize() As Integer
    dmSize = iDevMode.dmSize
End Property

Public Property Let dmSize(vNewValue As Integer)
    iDevMode.dmSize = vNewValue
End Property

Public Property Get dmDriverExtra() As Integer
    dmDriverExtra = iDevMode.dmDriverExtra
End Property

Public Property Let dmDriverExtra(vNewValue As Integer)
    iDevMode.dmDriverExtra = vNewValue
End Property

Public Property Get dmFields() As Long
        dmFields = iDevMode.dmFields
End Property

Public Property Let dmFields(vNewValue As Long)
    iDevMode.dmFields = vNewValue
End Property

Public Property Get dmOrientation() As Integer
    dmOrientation = iDevMode.dmOrientation
End Property

Public Property Let dmOrientation(vNewValue As Integer)
    iDevMode.dmOrientation = vNewValue
End Property

Public Property Get dmPaperSize() As Integer
    dmPaperSize = iDevMode.dmPaperSize
End Property

Public Property Let dmPaperSize(vNewValue As Integer)
    iDevMode.dmPaperSize = vNewValue
End Property

Public Property Get dmPaperLength() As Integer
    dmPaperLength = iDevMode.dmPaperLength
End Property

Public Property Let dmPaperLength(vNewValue As Integer)
    iDevMode.dmPaperLength = vNewValue
End Property

Public Property Get dmPaperWidth() As Integer
    dmPaperWidth = iDevMode.dmPaperWidth
End Property

Public Property Let dmPaperWidth(vNewValue As Integer)
    iDevMode.dmPaperWidth = vNewValue
End Property

Public Property Get dmScale() As Integer
    dmScale = iDevMode.dmScale
End Property

Public Property Let dmScale(vNewValue As Integer)
    iDevMode.dmScale = vNewValue
End Property

Public Property Get dmCopies() As Integer
    dmCopies = iDevMode.dmCopies
End Property

Public Property Let dmCopies(vNewValue As Integer)
    iDevMode.dmCopies = vNewValue
End Property

Public Property Get dmDefaultSource() As Integer
    dmDefaultSource = iDevMode.dmDefaultSource
End Property

Public Property Let dmDefaultSource(vNewValue As Integer)
    iDevMode.dmDefaultSource = vNewValue
End Property

Public Property Get dmPrintQuality() As Integer
    dmPrintQuality = iDevMode.dmPrintQuality
End Property

Public Property Let dmPrintQuality(vNewValue As Integer)
    iDevMode.dmPrintQuality = vNewValue
End Property

Public Property Get dmColor() As Integer
    dmColor = iDevMode.dmColor
End Property

Public Property Let dmColor(vNewValue As Integer)
    iDevMode.dmColor = vNewValue
End Property

Public Property Get dmDuplex() As Integer
    dmDuplex = iDevMode.dmDuplex
End Property

Public Property Let dmDuplex(vNewValue As Integer)
    iDevMode.dmDuplex = vNewValue
End Property

Public Property Get dmYResolution() As Integer
    dmYResolution = iDevMode.dmYResolution
End Property

Public Property Let dmYResolution(vNewValue As Integer)
    iDevMode.dmYResolution = vNewValue
End Property

Public Property Get dmTTOption() As Integer
    dmTTOption = iDevMode.dmTTOption
End Property

Public Property Let dmTTOption(vNewValue As Integer)
    iDevMode.dmTTOption = vNewValue
End Property

' The properties below only exist in win32.
#If Win32 Then

Public Property Get dmCollate() As Integer
    dmCollate = iDevMode.dmCollate
End Property

Public Property Let dmCollate(vNewValue As Integer)
    iDevMode.dmCollate = vNewValue
End Property

Public Property Get dmFormName() As String
    dmFormName = iDevMode.dmFormName
End Property

Public Property Let dmFormName(vNewValue As String)
    iDevMode.dmFormName = vNewValue
End Property

Public Property Get dmUnusedPadding() As Integer
    dmUnusedPadding = iDevMode.dmUnusedPadding
End Property

Public Property Let dmUnusedPadding(vNewValue As Integer)
    iDevMode.dmUnusedPadding = vNewValue
End Property

Public Property Get dmBitsPerPel() As Integer
    dmBitsPerPel = iDevMode.dmBitsPerPel
End Property

Public Property Let dmBitsPerPel(vNewValue As Integer)
    iDevMode.dmBitsPerPel = vNewValue
End Property

Public Property Get dmPelsWidth() As Long
    dmPelsWidth = iDevMode.dmPelsWidth
End Property

Public Property Let dmPelsWidth(vNewValue As Long)
    iDevMode.dmPelsWidth = vNewValue
End Property

Public Property Get dmPelsHeight() As Long
    dmPelsHeight = iDevMode.dmPelsHeight
End Property

Public Property Let dmPelsHeight(vNewValue As Long)
    iDevMode.dmPelsHeight = vNewValue
End Property

Public Property Get dmDisplayFlags() As Long
    dmDisplayFlags = iDevMode.dmDisplayFlags
End Property

Public Property Let dmDisplayFlags(vNewValue As Long)
    iDevMode.dmDisplayFlags = vNewValue
End Property

Public Property Get dmDisplayFrequency() As Long
    dmDisplayFrequency = iDevMode.dmDisplayFrequency
End Property

Public Property Let dmDisplayFrequency(vNewValue As Long)
    iDevMode.dmDisplayFrequency = vNewValue
End Property

#End If ' win32 only properties

