% Copyright 2006 Konstantin Korikov <lostclus@ua.fm>
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
% 
% This Current Maintainer of this work is Konstantin Korikov.
%
% This work consists of all files listed in manifest.txt.
%
m4_ESKDX_INIT
m4_FILE_INIT
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{eskdtitlebase}[m4_dnl
m4_FILE_ID([[$Date:: 2010-01-14#$]]) Base Title Commands]

m4_dnl должность и фамилия утверждающего
\newcommand{\ESKDtitleApprovedBy}[2]{%
  \@namedef{ESKD@title@approved@post@1}{#1}
  \@namedef{ESKD@title@approved@name@1}{#2}}

\newcount\ESKD@title@agreed@cnt
\newcount\ESKD@title@designed@cnt
\ESKD@title@agreed@cnt = 0
\ESKD@title@designed@cnt = 0

m4_dnl добавляет согласовавшего в список согласовавших
\newcommand{\ESKDtitleAgreedBy}[2]{%
  \advance \ESKD@title@agreed@cnt 1
  \@namedef{ESKD@title@agreed@post@\number\ESKD@title@agreed@cnt}{#1}
  \@namedef{ESKD@title@agreed@name@\number\ESKD@title@agreed@cnt}{#2}}

m4_dnl добавляет автора в список авторов
\newcommand{\ESKDtitleDesignedBy}[2]{%
  \advance \ESKD@title@designed@cnt 1
  \@namedef{ESKD@title@designed@post@\number\ESKD@title@designed@cnt}{#1}
  \@namedef{ESKD@title@designed@name@\number\ESKD@title@designed@cnt}{#2}}

\let\ESKD@title@approving@sheet\@undefinded
m4_dnl в наличии лист утверждения
\newcommand{\ESKDtitleApprovingSheet}[1]{%
  \def\ESKD@title@approving@sheet{#1}}

m4_dnl печатает гриф согласования/утверждения
\newcommand{\ESKDtitleMakeStamp}[2]{#1\\\rule{2cm}{.1mm}\ #2\\
``\rule{.8cm}{.1mm}'' \rule{2.3cm}{.1mm}\ \rule{1.5cm}{.1mm}}

\newcommand{\ESKD@title@make@stamp}[2]{%
  \ESKDtitleMakeStamp{%
    \@nameuse{ESKD@title@#1@post@#2}}{%
    \@nameuse{ESKD@title@#1@name@#2}}}

m4_dnl поля титульного листа
\newcommand{\ESKDtheTitleFieldI}{}
\newcommand{\ESKDtheTitleFieldII}{}
\newcommand{\ESKDtheTitleFieldIII}{}
\newcommand{\ESKDtheTitleFieldIV}{}
\newcommand{\ESKDtheTitleFieldV}{}
\newcommand{\ESKDtheTitleFieldVI}{}
\newcommand{\ESKDtheTitleFieldVII}{}
\newcommand{\ESKDtheTitleFieldVIII}{}
\newcommand{\ESKDtheTitleFieldIX}{}
\newcommand{\ESKDtheTitleFieldX}{}
\newcommand{\ESKDtitleFontI}{}
\newcommand{\ESKDtitleFontII}{}
\newcommand{\ESKDtitleFontIII}{}
\newcommand{\ESKDtitleFontIV}{}
\newcommand{\ESKDtitleFontV}{}
\newcommand{\ESKDtitleFontVI}{}
\newcommand{\ESKDtitleFontVII}{}
\newcommand{\ESKDtitleFontVIII}{}
\newcommand{\ESKDtitleFontIX}{}
\newcommand{\ESKDtitleFontX}{}

\def\ESKD@title@after@page{%
  \ESKDclearDoublePage
  \ESKDstyle{\ESKD@default@style@other}
  \ESKDthisStyle{\ESKD@default@style@first}}

m4_dnl базовый шаблон для любого титульного листа
\newenvironment{ESKDtitlePage}{%
  \begin{ESKDpadding}{5mm}{5mm}
  \ESKDstyle{\ESKD@default@style@title}}{%
  \end{ESKDpadding}
  \aftergroup\ESKD@title@after@page}

m4_dnl vim:ft=tex:sw=2:ai
