VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Procedure"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Private p_strName           As String
Private p_strModuleName     As String
Private p_strProcText       As String
Private p_strHeaderText     As String
Private p_strCommentText    As String
Private p_lngProcType       As Long
Private p_blnExported       As Boolean
Private p_modModule         As ExportToCodeLib.Module

Public Property Let Name(strName As String)
    If Len(p_strName) = 0 Then
        p_strName = strName
    End If
End Property

Public Property Get Name() As String
    Name = p_strName
End Property

Public Property Let ModuleName(strModuleName As String)
    If Len(p_strModuleName) = 0 Then
        p_strModuleName = strModuleName
    End If
End Property

Public Property Get ModuleName() As String
    ModuleName = p_strModuleName
End Property

Public Property Let ProcType(lngProcType As vbext_ProcKind)
    If p_lngProcType = -1 Then
        p_lngProcType = lngProcType
    End If
End Property

Public Property Get ProcType() As vbext_ProcKind
    ProcType = p_lngProcType
End Property

Public Property Let ProcText(strProcText As String)
    If Len(p_strProcText) = 0 Then
        p_strProcText = strProcText
    End If
End Property

Public Property Get ProcText() As String
    ProcText = p_strProcText
End Property

Public Property Let HeaderText(strHeaderText As String)
    If Len(p_strHeaderText) = 0 Then
        p_strHeaderText = strHeaderText
    End If
End Property

Public Property Get HeaderText() As String
    HeaderText = p_strHeaderText
End Property

Public Property Let CommentText(strCommentText As String)
    If Len(p_strCommentText) = 0 Then
        p_strCommentText = strCommentText
    End If
End Property

Public Property Get CommentText() As String
    Dim lngLen As Long

    ' Truncate comment to fit in text field in database.
    lngLen = Len(p_strCommentText)

    If lngLen > 255 Then
        p_strCommentText = Left(p_strCommentText, lngLen - 255)
    End If
    CommentText = p_strCommentText
End Property

Private Sub Class_Initialize()
    ' Set ProcType to -1 in order to control write-once property.
    p_lngProcType = -1
    
    Me.Exported = False
End Sub

Public Property Let Exported(blnExported As Boolean)
    p_blnExported = blnExported
End Property

Public Property Get Exported() As Boolean
    Exported = p_blnExported
End Property

Public Property Set Parent(modModule As ExportToCodeLib.Module)
    Set p_modModule = modModule
End Property

Public Property Get Parent() As ExportToCodeLib.Module
    ' Return Module object that is this object's parent.
    Set Parent = p_modModule
End Property
