package MyApplication @ISA = qw() sub Debug return shift->{Debug}; sub PermitDebugPrint return $PermitDebugPrint; sub pParams return shift->{pParams}; sub FileSystemCharCode return shift->{FileSystemCharCode}; sub PrintCharCode return shift->{PrintCharCode}; sub PerlCharCode return shift->{PerlCharCode}; sub SQLCharCode return shift->{SQLCharCode}; sub WebCharCode return shift->{WebCharCode}; sub WebCharSet return shift->{WebCharSet}; sub GetApplication sub GetApplication { return return shift; sub Application sub Application { return return shift; sub App sub App { return return shift; sub SetAppName sub SetAppName { my ($this,$p) = return $this->{AppName} = $p; sub GetDocument return shift->{Document}; sub Document return shift->{Document}; sub Doc return shift->{Document}; sub GetIniFile return shift->{IniFile}; return shift->{'IniFile'}; sub Ini return shift->{IniFile}; sub Args return shift->{Args}; sub CGIForm my ($this) = @_; return $this->Args()->CGIForm() if($this->Args()->CGIForm()); return $this->{CGIForm} if($this->{CGIForm}); return undef; sub MainWindow return shift->{MainWindow}; sub SetMainWindow sub SetMainWindow { my ($this,$mw)= return shift->{MainWindow} = $mw; sub mw return shift->{MainWindow}; sub Usage return shift->Args()->Usage(); sub WorkDir return shift->{WorkDir}; sub pParams return shift->{pParams}; sub Debug return shift->{Debug}; sub SetDebug my ($this, $f) = @_; return $this->{Debug} = 1; return $this->{Debug}++; return $this->{Debug}--; sub DoConfirm return shift->{'DoConfirm'}; sub PrintLevel return shift->{'PrintLevel'}; sub stdio return shift->{'stdio'}; sub set my ($this, $key, $val) = @_; return $this->{$key} = $val; sub get my ($this, $key, $defval) = @_; return $this->{$key} if(defined $this->{$key}); return $defval; return shift->App()->ReadSetting(); return shift->App()->SaveSetting(); sub RegLF return shift->{RegLF}; sub LF return shift->{LF}; sub SetLF my ($this, $LF) = @_; return $LF; sub Space return shift->{Space}; sub SetSpace my ($this, $Space) = @_; return $Space; sub DirectorySeparator return shift->{'DirectorySeparator'}; sub OS return shift->{'OS'}; sub AppName return shift->{AppName}; sub Program return shift->{Program}; sub SetProgram sub SetProgram { my ($this,$p) = return $this->{Program} = $p; sub ProgramPath return shift->{ProgramPath}; sub SetProgramPath sub SetProgramPath { my ($this,$p) = return $this->{ProgramPath} = $p; sub ProgramName sub ProgramName { my ($this) = return $this->{ProgramName}; sub SetProgramName sub SetProgramName { my ($this,$p) = return $this->{ProgramName} = $p; sub Version return shift->{Version}; sub SetVersion sub SetVersion { my ($this,$p) = return $this->{'Version'} = $p; sub AppTitle return shift->{Title}; sub GetTitle return shift->{Title}; sub Title return shift->{Title}; sub SetTitle sub SetTitle { my ($this,$p) = return $this->{'Title'} = $p; sub PrintCharCode return shift->{'PrintCharCode'}; sub SetPrintCharCode my ($this, $c) = @_; return -1; return $c; sub OSCharCode return shift->{'OSCharCode'}; sub SetOSCharCode sub SetOSCharCode { my($this,$c)= return $this->{'OSCharCode'}=$c; sub ProgramCharCode return shift->{'ProgramCharCode'}; sub SetProgramCharCode sub SetProgramCharCode { my($this,$c)= return $this->{'ProrgramCharCode'}=$c; sub PerlCharCode return shift->{'PerlCharCode'}; sub SetPerlCharCode sub SetPerlCharCode { my($this,$c)= return $this->{'PerlCharCode'}=$c; sub FileSystemCharCode return shift->{'FileSystemCharCode'}; sub SetFileSystemCharCode sub SetFileSystemCharCode { my($this,$c)= return $this->{'FileSystemCharCode'}=$c; sub FileCharCode return shift->{'FileCharCode'}; sub SetFileCharCode sub SetFileCharCode { my($this,$c)= return $this->{'FileCharCode'}=$c; sub SQLCharCode return shift->{'SQLCharCoderCode'}; sub SetSQLCharCode sub SetSQLCharCode { my($this,$c)= return $this->{'SQLCharCode'}=$c; sub WebCharCode return shift->{'WebCharCode'}; sub SetWebCharCode my ($this, $c) = @_; return $this->{'WebCharCode'}; sub WebCharSet my ($App) = @_; return $App->{'WebCharSet'}; sub SetWebCharSet my ($this, $c) = @_; return $this->{WebCharSet} = $c; sub GetWebCharSetByCharCode my ($WebCharCode) = @_; return "iso-2022-jp" if($WebCharCode =~ /^jis$/i); return "euc-jp" if($WebCharCode =~ /^euc$/i); return "iso-8859-1" if($WebCharCode =~ /^en$/i); return "x-$WebCharCode"; sub GetWebCharSet my ($Language, $WebCharCode) = @_; return "iso-8859-1" if($Language =~ /English/i); return "iso-2022-jp" if($WebCharCode =~ /^jis$/i); return "euc-jp" if($WebCharCode =~ /^euc$/i); return "iso-8859-1" if($WebCharCode =~ /^en$/i); return "x-$WebCharCode"; sub CSVCharCode return shift->{CSVCharCode}; sub SetCSVCharCode my ($this, $c) = @_; return $this->{CSVCharCode} = $c; sub BEGIN sub new my ($module, $app) = @_; return $this; sub DESTROY my $this = shift; # $this->SUPER::DESTROY( sub UpdateParams my ($this, $pParams) = @_; return $pParams; sub BuildParameterHash my ($this) = @_; return $this->{pParams} if($this->{pParams}); return $this->{pParams} = {}; sub Initialize my ($this) = @_; return -1; return 1; sub CreateWindow my ($this, $MainWindow, $icon) = @_; return $MainWindow; sub MainLoop my ($this) = @_; sub StartTime return shift->{'StartTime'}; sub StartDate return shift->{'StartDate'}; sub RemoteIPAddress my ($this) = @_; return $ip; sub SetCGIForm my ($this, $form) = @_; return $this->{CGIForm} if(!defined $form and $this->{CGIForm}); return $this->{CGIForm} = $form; sub AddArgument my ($this, $arg, $explanation, $defval) = @_; sub GetFileNameArray my ($this) = @_; return @$files; sub GetArgFileName my ($this, $idx) = @_; return $files->[$idx]; sub GetGetArg my ($this, $key, $defvalue, $StopFlag) = @_; return undef unless(defined $key); return $str if(defined $str); return $str if(defined $str); return $str if(defined $str); return $defvalue; sub ReadArgs my ($this, $StopFlag, $WebCharCode, $CheckAllowedArgs) = @_; return $ret; sub AddIniFileVariable my ($this, $KeyTree, $VarName, $DefVal) = @_; return unless($VarName); return unless($section); sub ReadSetting my ($this, $IsPrint) = @_; return; return; return; return unless($pHash); return 1; sub SaveSetting my ($this) = @_; return unless($IniFile); return unless($pHash); return 1; sub OpenIniFile my ($this, $ProgramPath, $CreateIniFile) = @_; return $ret; sub ConnectDocument my ($this, $doc) = @_; sub SpeculateProgramPath my ($this, $path, $BaseDir) = @_; return $this->SetProgramPath($ProgramPath); sub SetWorkDir my ($this, $path) = @_; return $this->{'WorkDir'} = $path if(-d $path); return $this->{'WorkDir'} = Deps::MakePath($drive, $directory); sub GetOutputMode return shift->{OutputMode}; sub SetOutputMode my ($this, $mode, $infile, $outfile) = @_; return undef; return undef; return $this->{OutputMode} = $mode; sub OutputMode return shift->{OutputMode}; sub GetpBuffer sub GetpBuffer { my ($this)= return $this->{pOUTBuffer}; sub GetBuffer my ($this, $ClearBuffer) = @_; return $s; sub ClearBuffer my ($this) = @_; return $this->GetpBuffer(); sub PrintBuffer my ($this, $ClearBuffer) = @_; return if(!defined $this->{pOUTBuffer}); sub MergeStrings my ($this, @s) = @_; return $s; sub PrintError my ($this, @args) = @_; return $this->PrintRawHTML("", @args, ""); return $this->print2(0, @args); sub DeleteHTMLFlag return shift->{DeleteHTMLFlag}; sub SetDeleteHTMLFlag sub SetDeleteHTMLFlag { my ($this,$f)= return shift->{DeleteHTMLFlag} = $f; sub InitHTML my ($this, $s, $WebCharSet, $CSS, $PrintHTMLHeader, %args) = @_; my $LinkTarget; if($WebCharSet =~ /^_/) { $LinkTarget = $WebCharSet; $WebCharSet = $this->WebCharSet(); } if(!defined $CSS or $CSS =~ /^_/) { ($this, $s, $WebCharSet, $LinkTarget, $CSS, $PrintHTMLHeader, %args) = @_; return; sub EndHTML my ($this, $s, $WebCharSet) = @_; sub BGColor return shift->{BGColor}; sub SetBGColor my ($this, $bg) = @_; return $this->{BGColor} = $bg; sub italic my ($this, @s) = @_; sub bold my ($this, @s) = @_; sub H1 my ($this, @s) = @_; sub H2 my ($this, @s) = @_; sub H3 my ($this, @s) = @_; sub H4 my ($this, @s) = @_; sub H5 my ($this, @s) = @_; sub H6 my ($this, @s) = @_; sub P my ($this, @s) = @_; sub BR my ($this, @s) = @_; return ""; sub HR my ($this) = @_; return ""; sub print my ($this, @args) = @_; return $this->print2(0, @args); return $this->print2(1, @args); sub print2 my ($this, $ConvertHTML, @args) = @_; return $this->{pOUTJFile}->print(@args); return ${$this->{pOUTBuffer}} .= join('', @args); return $this->{stdio}->print(@args) if($this->{stdio}); return print(@args); sub printf my ($this, $format, @args) = @_; return $this->print($s); ($this, @args) = return $this->{stdio}->printf(@args) if($this->{stdio}); return printf(@args); sub DebugPrint my ($this, @args) = @_; return if(!$PermitDebugPrint); return $this->print(@args) if($this->{'Debug'}); return ''; sub ConfigureIniFileVariables my ($this) = @_; return 1; sub SetLanguage my ($App, $l) = @_; return $App->{Language} if(!defined $l or $l eq ''); return $App->{Language} = $l; sub Language my ($App) = @_; return $App->{Language}; sub LanguageCode my ($App) = @_; return 'Invalid Language' if(!defined $c or $c eq ''); return $c; sub PrintWithReplaced my ($App, $file, $target, @array) = @_; return Utils::PrintWithReplaced($file, $target, @array); sub PrintWithReplacedForHTML my ($App, $file, $target, @array) = @_; return Utils::PrintWithReplaced($file, $target, @array); sub BuildDateString my ($App, $d) = @_; return Utils::BuildDateString($d, $App->Language()); sub CheckBlankString my ($this, $s, @messages) = @_; return 1 if(defined $s and $s ne ''); return 0; return 0; sub GetFileContent my ($App, $pParams, $infile) = @_; return '' if(!$in); return $content; sub ConvertToTextFile my ($App, $pParams, $SourcePath, $Overwrite, $pdftoext) = @_; return '' if($SourcePath !~ /\.pdf$/i); return ($TextPath, $Content); return ('', undef) if(!-e $TextPath); return ($TextPath, $Content) if(-e $TextPath); return ('', undef); sub MakeHankakuFile my ($App, $pParams, $outfile, $Content) = @_; return $ret; sub CollectDirs my ($App, $pParams, $dir, $pfmasks) = @_; return @dirs; sub ReadDirsToHash my ($App, $pParams, $pDirs, $func) = @_; return @Infs; sub IsExcludedFolder my ($App, $pParams, $dir, $pExcludeDirs, $ScriptCharCode, $FileSystemCharCode) = @_; return 0 if(!defined $pExcludeDirs); return 1 if($filename =~ /$d/i); return 0; sub GetFileList my ($App, $pParams, $path, $SortByDir, $SearchHiddenFiles) = @_; return @f if(!$SortByDir); return @files; sub SearchDirectory my ($App, $pParams, $keyword, $dir, $CallBack, $CurrentLevel, $MaxLevel, $pExculdedDirs, $ScriptCharCode, $FileSystemCharCode) = @_; return; sub FileSortBy my ($App, $FileSortBy, $pFiles) = @_; return sort @$pFiles; return sort { $b <=> $a } @$pFiles; return sort { my $at = Utils::GetFileSize($a); return sort { my $at = Utils::GetFileSize($a); return sort { my $at = Utils::GetWriteDate($a); return sort { my $at = Utils::GetWriteDate($a); return @$pFiles; sub BrowseDirectory my ($App, $pParams, $path, $RootDir) = @_; my $a; ($a, $App, $pParams) = @_; return; my @Files; $App->SearchDirectory($pParams, '', $path, sub { my ($App, $key, $HitCountInDir, $path, $dir, $filename) = @_; sub Execute my ($this, $cmd, $IsPrint) = @_; return $ret; sub Escape my($this, $str, $data) = return $data; sub Revert my($this, $data) = return $data; sub IsExistFile my ($App, $path) = @_; return 1 if(-e $path); return 0;