Automation Batch Tools

: Automate and process repetitive tasks with this automation program





// Read: Copyright © Thomas Schulz, all rights reserved.
// Contact: Primary: thomas#microsystools.com. Secondary: dk_sz#hotmail.com.
// Can only be used when making modules for "Micro-Sys MultiBatcher".
//------------------------------------------------------------------------------
unit LUmsCommonAllSharedDeclars;
{$I AImsCoreDefines.inc}
interface
const
incPIV_Major = '1.0.4'; // plugin interface version
incPIV_Minor = 'A'; // e.g. 'A'. These revisions are compatible without recompilation (e.g. 1.02A, 1.02B)

//==============================================================================
{
Please notice that this interface may define things not yet implemented in the
host program. Also, no gurantees are given that the interface will not change.
That said, the interface has proven to be quite stable.
}
//==============================================================================

//==============================================================================
{
Was implemented like this to allow for multiple languages.
}
//------------------------------------------------------------------------------
{
Describes the values that can be "or'ed" into: *TPluginInfo.CanWorkCategory*
"cwc" = "can work category".
}
cwcNull = $0;
cwcFiles = $1;
cwcDirs = $2;
cwcRootDir = $4; // *cwcDirs* does not cover this "special" directory
//------------------------------------------------------------------------------
{
Describes the values that can be "or'ed" into: *TPluginInfo.ReleaseState*
"prs" = "plugin release state".
}
prsNull = $0;
prsBuggy = $1;
prsUsable = $2;
prsStable = $4;
prsAlpha = $8;
prsBeta = $10;
prsSomePartsNotIntendedForProductionUse = $20;
prsNotIntendedForProductionUse = $40;
//------------------------------------------------------------------------------
{
Describes the values that can be "or'ed" into: *TProcExeMakePropName()->AReadyServices*
Remember that even if you request certain services they may be deemed invalid because of the property type.
"pprs" = "plugin public ready services".
}
pprsNull = $0;
pprsFilePathInsert = $1;
pprsTextEditorOpen = $2;
//------------------------------------------------------------------------------
{
Describes the values that can be "or'ed" into: *TProcExeAddPropGridColumn()->ColumnProps*
"pgcp" = "plugin grid column properties".
}
pgcpNull = $00000000;
//--
pgcpHorzLeftAlign = $00000001; // 00000000000000000000000000000001
pgcpHorzRightAlign = $00000002; // 00000000000000000000000000000010
pgcpHorzCenterAlign = $00000003; // 00000000000000000000000000000011 // 2 above combined!
//--
pgcpReadOnly = $00000010; // 00000000000000000000000000010000
pgcpPassword = $00000020; // 00000000000000000000000000100000
pgcpMultiLine = $00000040; // 00000000000000000000000001000000
//--
pgcpEdit = $00000100;
pgcpList = $00000200;
pgcpEditList = $00000300; // 2 above combined!
//--
pgcp_TrueFalse = $00001000;
pgcp_TypeFilter = $00002000;
//--
pgcp_SelectDir = $00010000;
pgcp_SelectFile = $00020000;
pgcp_SelectDirFile = $00030000; // 2 above combined!
//--
//------------------------------------------------------------------------------
{
Describes the values that can be "or'ed" into: *TExeSetPropDefaultFileValue()->FileProps*
"pfp" = "plugin file properties".
}
pfpNull = $00000000;
//--
pfpHighLightIni = $00000001;
pfpHighLightXml = $00000002; // use for XML, HTML, XHTML, SGML etc.
//------------------------------------------------------------------------------
{
End of "set-like" constants.
}
//==============================================================================

type
TPluginCategory = (pcMiscellaneous, pcFileProcessing, pcOfficeRelated, pcMediaHandling, pcWebDevelopment);
TPluginLoadingScheme = (plsCanDynamicAsNeeded, plsPreferKeepInMemory, plsRequireKeepInMemory);

{
Windows95:
FileNamePathMax = 255
CombinedPathMax = 259 (including drive etc. parts)
Posix standards (which I think Linux follows to some degree):
#define NAME_MAX 255 /* # chars in a file name */
-#define PATH_MAX 4095 /* # chars in a path name */
+#define PATH_MAX 4096 /* # chars in a path name including nul */
}
TSafePathLengthArr = packed array[0..4095] of Byte;
PSafePathLengthPtr = ^TSafePathLengthArr; // this way application can preallocate space for where plugin needs to write

TPluginPassedWriteOutProps = packed record
WorkPathNameOut: PSafePathLengthPtr;
AdvisePathBatchStop: Boolean; // sub batch = plugins listed to be run on this path (file or directory) in given project
AdviseProjectBatchStop: Boolean; // project batch = same meaning as above, just for whole project
AdviseMainBatchStop: Boolean; // main batch = same meaning as above, just all ("chained") projects and files
// -->> it is not guranteed that the last 2 will be stopped immediately <<--
end;
PPluginPassedWriteOutProps = ^TPluginPassedWriteOutProps;

TPluginPassedReadInProps = packed record
WorkPathNameIn: PChar;
end;
PPluginPassedReadInProps = ^TPluginPassedReadInProps;

TPluginInfo = packed record
StrID: PChar;
Author: PChar; // *PChar* fields can return both *''* and *nil* for an empty field
CopyRight: PChar;
PluginName: PChar;
PluginDesc: PChar;
HasCompany: PChar;
HasEmail: PChar;
HasUrl: PChar;
CanLaunchFilesSep: PChar; // separator between listed files
CanLaunchFilesList: PChar; // pathes must be relative to where the plugin is placed
CanMultiThreadWork: Boolean; // NOTE: Currently NOT USED ! (design makes it easy to support multiple threads)
PluginLoadingScheme: TPluginLoadingScheme; // "keep-in-memory-mode vs not" may require code adjustments
HasLogo: PChar; // recommended size is 180*70 (width*height)
SuggestedExts: PChar; // comma-separated, e.g. '.txt,.log'
PluginVersion: PChar;
InterfaceVersion: PChar;
PluginCategory: TPluginCategory;
CanWorkCategory: Cardinal;
ReleaseState: Cardinal;
end;
PPluginInfo = ^TPluginInfo;

TVisualPropType = (vptErrorOccured, vtpChoiceSingle, vtpChoiceMultiple, vptTextBoxes, vptGrid, vptFile, vptCustom);
(*
TVisualPropChoiceTypes = vtpChoiceSingle..vtpChoiceMultiple;
TVisualPropGridTypes = vptGridGeneric..vptGridGeneric;
TVisualPropFileTypes = vptFileGeneric..vptFileGeneric;
*)
// if selected value includes "trimmed" all fields will have leading and trailing non-printing characters (i.e. all <= 32 in ASCII) removed
TPropGridIgnoreRowsLevel = (pgirlNever, pgirlAllRowCellsEmpty, pgirlAllRowCellsEmptyWhenTrimmed, pgirlRowHasEmptyCells, pgirlRowHasEmptyCellsWhenTrimmed);

(* these are passed as parameters _when executable/application call on plugin_ *)
// general/all (edit)
TProcExeHandleEditPropGridErrorMsg = procedure(FieldInRowIndex: Integer; ErrorMsg: PWideChar; AdviceMsg: PWideChar); {$I AImsCC.inc} // used in *TProcPluginVerifyPropGridValue*
TProcExeHandleEditPropFileErrorMsg = procedure(CharPos: Integer; ErrorMsg: PWideChar; AdviceMsg: PWideChar); {$I AImsCC.inc} // used in *TProcPluginVerifyPropFileValue*
TProcExeHandleEditPropTextBoxErrorMsg = procedure(TextBoxID: PAnsiChar; ErrorMsg: PWideChar; AdviceMsg: PWideChar); {$I AImsCC.inc} // used in *TProcPluginVerifyPropTextBoxValue*

(* these the executable/application can call on plugin *)
// general/all (work)
TProcPluginWorkPath = procedure(PluginPassedReadInProps: PPluginPassedReadInProps; PluginPassedWriteOutProps: PPluginPassedWriteOutProps); {$I AImsCC.inc}
// choice::single + multiple (work)
TProcPluginSetPropChoiceValue = procedure(PropName: PAnsiChar; ChoiceID: PAnsiChar); {$I AImsCC.inc}
// choice::multiple (work)
TProcPluginSetPropChoiceValueCount = procedure(PropName: PAnsiChar; PropValueCount: Integer); {$I AImsCC.inc}
// textboxes (edit)
TProcPluginVerifyPropTextBoxValue = procedure(PropName: PAnsiChar; TextBoxID: PAnsiChar; PropValue: PWideChar; ExeCallBack: TProcExeHandleEditPropTextBoxErrorMsg); {$I AImsCC.inc}
// textboxes (work)
TProcPluginSetPropTextBoxValue = procedure(PropName: PAnsiChar; TextBoxID: PAnsiChar; PropValue: PWideChar); {$I AImsCC.inc}
// grid (edit)
TProcPluginPrepareVerifyGridRow = procedure(PropName: PAnsiChar); {$I AImsCC.inc}
TProcPluginAddVerifyPropGridValue = procedure(PropName: PAnsiChar; PropValue: PWideChar); {$I AImsCC.inc} // all rows (from top to bottom) have their cells looped through (left to right) and then verifyed
TProcPluginEndVerifyGridRow = procedure(PropName: PAnsiChar; ExeCallBack: TProcExeHandleEditPropGridErrorMsg); {$I AImsCC.inc}
// grid (work)
TProcPluginSetPropGridValueCount = procedure(PropName: PAnsiChar; ValueCount: Integer); {$I AImsCC.inc}
TProcPluginSetPropGridValue = procedure(PropName: PAnsiChar; const ColID: string; RowIdx: Integer; FieldValue: PWideChar); {$I AImsCC.inc}
// file (edit)
TProcPluginVerifyPropFileValue = procedure(PropName: PAnsiChar; FullFilePathName: PWideChar; ExeCallBack: TProcExeHandleEditPropFileErrorMsg); {$I AImsCC.inc}
// file (work)
TProcPluginSetPropFileValue = procedure(PropName: PAnsiChar; FullFilePathName: PWideChar); {$I AImsCC.inc}

(* these the plugin can call on executable/application *)
// general/all (init)
TProcExeMakePropName = procedure(PropName: PAnsiChar; ShownName: PWideChar; VisualPropType: TVisualPropType; AReadyServices: Cardinal; AHint, AHelp: PWideChar); {$I AImsCC.inc}
// grid (init)
TProcExeSetPropMetasGrid = procedure(PropName: PAnsiChar; PropGridIgnoreRowsLevel: TPropGridIgnoreRowsLevel); {$I AImsCC.inc}
// general/all (work)
TProcExeHandleWorkPathErrorMsg_Ansi = procedure(ErrorMsg: PAnsiChar; AdviceMsg: PAnsiChar); {$I AImsCC.inc}
TProcExeHandleWorkPathErrorMsg_Wide = procedure(ErrorMsg: PWideChar; AdviceMsg: PWideChar); {$I AImsCC.inc}
TProcExeRequestAddPathToBatch = procedure(AddPathName: PWideChar); {$I AImsCC.inc}
// choice::single + multiple (pre-edit)
TProcExeSetPropChoiceValueCount = procedure(PropName: PAnsiChar; PropValueCount: Integer); {$I AImsCC.inc}
TProcExeAddPropChoiceValue = procedure(PropName: PAnsiChar; ChoiceID: PAnsiChar; LabelText: PWideChar; Checked: Boolean); {$I AImsCC.inc}
// textboxes (pre-edit)
TProcExeSetPropTextBoxValueCount = procedure(PropName: PAnsiChar; TextBoxCount: Integer); {$I AImsCC.inc}
TProcExeSetPropTextBoxValue = procedure(PropName: PAnsiChar; TextBoxID: PAnsiChar; LabelText: PWideChar; PropValue: PWideChar); {$I AImsCC.inc}
// grid (pre-edit)
TProcExeSetPropGridColumnCount = procedure(PropName: PAnsiChar; ColumnCount: Integer); {$I AImsCC.inc}
TProcExeAddPropGridColumn = procedure(PropName: PAnsiChar; ColumnID: PAnsiChar; ColumnCaption: PWideChar; ColumnWidth: PAnsiChar; ColumnProps: Cardinal); {$I AImsCC.inc}
TProcExeSetPropDefaultGridValueCount = procedure(PropName: PAnsiChar; FieldCount: Integer); {$I AImsCC.inc}
TProcExeAddPropDefaultGridValue = procedure(PropName: PAnsiChar; ColIdx: Integer; RowIdx: Integer; FieldValue: PWideChar); {$I AImsCC.inc}
// file (pre-edit)
TProcExeSetPropDefaultFileValue = procedure(PropName: PAnsiChar; RelativeFilePath: PWideChar; FileProps: Cardinal); {$I AImsCC.inc}

(* declare data paramaters *)
TExeParamsDataAll = packed record
AppVersion: PChar;
PiVersionMajor: PChar;
PiVersionMinor: PChar;
Language: PChar;
PluginFilePathName: PChar;
PluginFilePath: PChar;
end;
PExeParamsDataAll = ^TExeParamsDataAll;

TExeParamsDataWork = packed record
BatchRootPath: PChar;
end;
PExeParamsDataWork = ^TExeParamsDataWork;

(* declare procedures/functions parameters *)
TExeParamsProcInit = packed record
// general/all
ProcExeMakePropName: TProcExeMakePropName;
// grid
ProcExeSetPropMetasGrid: TProcExeSetPropMetasGrid;
end;
PExeParamsProcInit = ^TExeParamsProcInit;

TExeParamsProcPreEdit = packed record
// choice::single + multiple
ProcExeSetPropChoiceValueCount: TProcExeSetPropChoiceValueCount;
ProcExeAddPropChoiceValue: TProcExeAddPropChoiceValue;
// textboxes
ProcExeSetPropTextBoxValueCount: TProcExeSetPropTextBoxValueCount;
ProcExeSetPropTextBoxValue: TProcExeSetPropTextBoxValue;
// grid
ProcExeSetPropGridColumnCount: TProcExeSetPropGridColumnCount;
ProcExeAddPropGridColumn: TProcExeAddPropGridColumn;
ProcExeSetPropDefaultGridValueCount: TProcExeSetPropDefaultGridValueCount;
ProcExeAddPropDefaultGridValue: TProcExeAddPropDefaultGridValue;
// file
ProcExeSetPropDefaultFileValue: TProcExeSetPropDefaultFileValue;
end;
PExeParamsProcPreEdit = ^TExeParamsProcPreEdit;

TExeParamsProcEdit = packed record
// general/all
end;
PExeParamsProcEdit = ^TExeParamsProcEdit;

TExeParamsProcWork = packed record
// general/all
ProcExeHandleWorkPathErrorMsg_Ansi: TProcExeHandleWorkPathErrorMsg_Ansi;
ProcExeHandleWorkPathErrorMsg_Wide: TProcExeHandleWorkPathErrorMsg_Wide;
ProcExeRequestAddPathToBatch: TProcExeRequestAddPathToBatch;
end;
PExeParamsProcWork = ^TExeParamsProcWork;

(* these the executable/application can call on plugin *)
TProcPluginReturnInfo = function(ExeParamsDataAll: PExeParamsDataAll): PPluginInfo; {$I AImsCC.inc}
TProcPluginSetupInit = procedure(ExeParamsDataAll: PExeParamsDataAll; ExeParamsProc: PExeParamsProcInit); {$I AImsCC.inc}
TProcPluginSetupPreEdit = procedure(ExeParamsDataAll: PExeParamsDataAll; ExeParamsProc: PExeParamsProcPreEdit); {$I AImsCC.inc}
TProcPluginSetupEdit = procedure(ExeParamsDataAll: PExeParamsDataAll; ExeParamsProc: PExeParamsProcEdit); {$I AImsCC.inc}
//--
TProcPluginSetupWorkStart = procedure(ExeParamsDataAll: PExeParamsDataAll; ExeParamsDataWork: PExeParamsDataWork; ExeParamsProc: PExeParamsProcWork); {$I AImsCC.inc}
TProcPluginSetupWorkStartDone = procedure; {$I AImsCC.inc}
TProcPluginSetupWorkEnd = procedure(ExeParamsDataAll: PExeParamsDataAll); {$I AImsCC.inc}
//==============================================================================
implementation
end.



Automation Batch Tools is a automation software tool that can automate repetitive tasks




This file is part of Automation Batch Tools. All rights reserved. See legal.