%%
%% This is file `interfaces-tocloft.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% interfaces.dtx  (with options: `tocloft')
%% 
%% This is a generated file.
%% 
%% interfaces : 2011/01/19 v2.9 - interfaces : interfaces with keys for other packages (FC)
%% 
%% 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
%% 
%% This work consists of the main source file interfaces.dtx
%% and the derived files
%%     interfaces.sty, interfaces.pdf, interfaces.ins,
%%     interfaces-base.sty,
%%     interfaces-LaTeX.sty,
%%     interfaces-tikz.sty,
%%     interfaces-titlesec.sty,
%%     interfaces-hyperref.sty,
%%     interfaces-bookmark.sty,
%%     interfaces-hypbmsec.sty,
%%     interfaces-fancyhdr.sty,
%%     interfaces-marks.sty,
%%     interfaces-tocloft.sty,
%%     interfaces-makecell.sty,
%%     interfaces-enumitem.sty,
%%     interfaces-truncate.sty,
%%     interfaces-appendix.sty,
%%     interfaces-embedfile.sty,
%%     interfaces-environ.sty,
%%     interfaces-umrand.sty,
%%     interfaces-scrlfile.sty,
%%     interfaces-pgfkeys.sty,
%%     interfaces-etoolbox.sty
%% 
%% interfaces: interfaces with keys for other packages (FC)
%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr>
%% 
\let\CTANLinks=y
\let\interfacesquick=n
\ProvidesPackage{interfaces-tocloft}
   [2011/01/19 v2.9 pgfkeys macros for tocloft (FC)]
\RequirePackage{interfaces-base}
\itf@Check@Package{tocloft}
\newrobustcmd\tocsetup[1]{%
   \AfterPreamble{\itf@pgfkeys\pgfqkeys{/itf/tocloft/toc}{#1}}%
}% \tocsetup
\newrobustcmd\lofsetup[1]{%
   \AfterPreamble{\itf@pgfkeys\pgfqkeys{/itf/tocloft/lof}{#1}}%
}% \lofsetup
\newrobustcmd\lotsetup[1]{%
   \AfterPreamble{\itf@pgfkeys\pgfqkeys{/itf/tocloft/lot}{#1}}%
}% \lotsetup
\newrobustcmd\listofsetup[2]{%
   \AfterPreamble{\itf@pgfkeys\pgfqkeys{/itf/tocloft/#1}{#2}}%
}% \listofsetup

\def\itf@cft@newlistof#1#2#3{% #1=toc/lof (ext.), #2=entry (\newlistof only), #3=title (\newlistof only)
   \pgfqkeys{/itf/tocloft/#1}{%
      depth/.store in counter cs=c@#1depth,%
      depth/.append code=\expandafter\global\csname c@#1depth\endcsname
                                            \csname c@#1depth\endcsname
               \addtocontents{#1}{\csname c@#1depth\endcsname
                              \the\csname c@#1depth\endcsname\relax},%
         #1depth/.alias*=depth,%
      pagestyle/.code=\tocloftpagestyle{##1},%
      parskip/.store in skip cs=cftparskip,%
         parsep/.alias=parskip,%
      mark/.store in cs=cftmark#1,%
         marks/.alias=mark,%
         mark=,%
      label/.store as code,%
      ref/.store as code,%
         ref/.initial=\csname cft#1title\endcsname,% overwritten (toc,lof,lot)
         ref/.default=\csname cft#1title\endcsname,% overwritten (toc,lof,lot)
         ref/.blank=\pgfkeysnovalue,%
      title/.store as code in cs=cft#1title,% overwritten below for toc, lof and lot
      title/top/.store in skip cs=cftbefore#1titleskip,%
         beforetitleskip/.alias*=title/top,%
      title/bottom/.store in skip cs=cftafter#1titleskip,%
         aftertitleskip/.alias*=title/bottom,%
      title/font/.store as code in cs=cft#1titlefont,%
         title/format/.alias*=title/font,%
      title/color/.store as color,%
         title/color/.append code=\pgfkeysalso{/itf/tocloft/#1/title/font+={%
            \color{\pgfkeysvalueof{/itf/tocloft/#1/title/color}}}},%
         title/font/color/.alias=title/color,%
         title/format/color/.alias=title/color,%
      title/after/.store as code in cs=cftafter#1title,%
      title/command/.code=\csdef{@cftmake#1title}####1{##1},%
      dotsep/.code=\itf@units@mu\itf@musk{##1}%    converts to mu
                   \edef\cftdotsep{\itf@strip@mu\itf@musk},%
         dotsep/.default=4.5mu,%
         dotsep/.blank=\cftnodots,%
      dot/.store in=\cftdot,%
      before/.store as code,%
      after/.store as code,%
      columns/before@hook/.is private=interfaces-tocloft,%
      columns/after@hook/.is private=interfaces-tocloft,%
      columns/before@hook/.initial=,%
      columns/after@hook/.initial=,%
      columns/.code={\ltx@ifpackageloaded{multicol}{%
         \pgfkeysEsetvalue\pgfkeyscurrentkey{\number##1}%
         \ifnum\number##1>\@ne
            \pgfkeysgetvalue{/itf/tocloft/#1/columns/before@hook}\itf@tp
            \ifx\itf@tp\@empty
               \pgfkeyssetvalue{/itf/tocloft/#1/columns/before@hook}{%
                  \begingroup
                  \multicolsep\pgfkeysvalueof{/itf/tocloft/#1/multicolsep}\relax
                  \columnsep\pgfkeysvalueof{/itf/tocloft/#1/columns/sep}\relax
                  \columnseprule\pgfkeysvalueof{/itf/tocloft/#1/columns/rule}\relax
                  \begin{multicols}{\pgfkeysvalueof{/itf/tocloft/#1/columns}}%
                  \pgfkeysgetvalue{/itf/tocloft/#1/columns/rule/color}\columnseprulecolor
                  \pgfkeysvalueof{/itf/tocloft/#1/multicols/begin}%
               }%
               \pgfkeyssetvalue{/itf/tocloft/#1/columns/after@hook}{%
                  \pgfkeysvalueof{/itf/tocloft/#1/multicols/end}%
                  \end{multicols}
                  \endgroup
               }%
            \fi
         \else
            \pgfkeyslet\pgfkeyscurrentkey\@ne
            \pgfkeyslet{/itf/tocloft/#1/columns/before@hook}\@empty
            \pgfkeyslet{/itf/tocloft/#1/columns/after@hook}\@empty
         \fi}
         {\PackageError{interfaces-tocloft}
            {Key `columns': package multicol is required}\@eha}%
      },%
      columns/.default=2,columns/.blank=1,%
         multicol/.alias=columns,%
         multicols/.alias=columns,%
      twocolumns/.true=\pgfkeysalso{columns=2},%
      twocolumns/.false=\pgfkeysalso{columns=1},%
      columns/rule/.estore as dimen,%
      columns/rule/.default=\columnseprule,%
      columns/rule,% assign default
         columnseprule/.alias*=columns/rule,%
         columns/rule/width/.alias*=columns/rule,%
      columns/sep/.estore as dimen,%
      columns/sep/.default=\columnsep,%
      columns/sep/.blank=10\p@,%
      columns/sep,% assign default
         columnsep/.alias*=columns/sep,%
      columns/rule/color/.store as color command,%
      columns/rule/color,% assign default (\normalcolor)
         columnseprulecolor/.alias*=columns/rule/color,%
         columns/rulecolor/.alias*=columns/rule/color,%
         columns/color/.alias*=columns/rule/color,%
      multicolsep/.estore as glue,%
         multicolsep/.default=0pt plus4pt minus3pt,%
         multicolsep,% sets default
      multicols/begin/.initial=,multicols/begin/.default=,%
         multicols/before/.alias=multicols/begin,%
      multicols/end/.initial=,multicols/end/.default=,%
         multicols/after/.alias=multicols/end,%
   }% \pgfkeys
   \itf@AfterPackage{interfaces-bookmark}{%
   \def\itf@tocloft@bookmark@handler##1##2{%
      \pgfkeysEaddvalue{/itf/tocloft/##1/bookmark}{}{,##2}%
      \pgfkeysgetvalue{/itf/tocloft/##1/bookmark/text}\itf@tp
      \ifx \itf@tp\@empty
         \pgfkeyssetvalue{/itf/tocloft/##1/bookmark/text}\contentsname \fi}%
   \pgfqkeys{/itf/tocloft/#1}{%
      bookmark/.is multiple choice,%
      bookmark/bold/.true=\itf@tocloft@bookmark@handler{#1}{bold=true},%
      bookmark/bold/.false=\itf@tocloft@bookmark@handler{#1}{bold=false},%
      bookmark/italic/.true=\itf@tocloft@bookmark@handler{#1}{italic=true},%
      bookmark/italic/.false=\itf@tocloft@bookmark@handler{#1}{italic=false},%
      bookmark/color/.code=\itf@tocloft@bookmark@handler{#1}{color={##1}},%
      bookmark/level/.code=\pgfkeysEsetvalue{/itf/tocloft/#1/bookmark/level}{%
                     \ifcsname toclevel@##1\endcsname
                        \csname toclevel@##1\endcsname
                     \else##1\fi}%
                     \itf@tocloft@bookmark@handler{#1}{},%
         bookmark/level/.default=-1,%
         bookmark/level/.initial=-1,%
      bookmark/text/.store as code,%
         bookmark/text/.default=\contentsname,%
      bookmark/.unknown/.code=\pgfkeysEaddvalue{/itf/tocloft/#1/bookmark}
                                          {}{\pgfkeyscurrentname={##1}},%
      bookmark/.initial=,%
   }% \pgfkeys
   }% AfterPackage interfaces-bookmark
   %% while making a format \jobname is expanded to the name of the format...
   %% Therefore, the following commands must be expanded \AtEndPreamble
   \AfterPreamble{%
      \BeforeFile{\jobname.#1}{%
         \pgfkeysvalueof{/itf/tocloft/#1/before}%
         \pgfkeysvalueof{/itf/tocloft/#1/columns/before@hook}%
      }%
      \AfterFile{\jobname.#1}{%
         \pgfkeysvalueof{/itf/tocloft/#1/columns/after@hook}%
         \pgfkeysvalueof{/itf/tocloft/#1/after}%
      }%
   }%
   \ifcsname #1setup\endcsname\else
      \pgfqkeys{/itf/tocloft/#1}{%
         title={#3},%
         pagenumbers/.true=\@cftpnumon{#2},%
         pagenumbers/.false=\@cftpnumoff{#2},%
            pagenumbers/on/.alias=pagenumbers/true,
            pagenumbers/off/.alias=pagenumbers/false,
            pagenumber/.alias=pagenumbers,%
      }%
      \expandafter\pretocmd\csname @cftmake#1title\expandafter\endcsname
         \expandafter{\expandafter\itf@tocloft\csname cft#1title\endcsname{#1}{listof#2}}
      {\@PackageInfoNoLine{interfaces-tocloft}
         {\expandafter\string\csname @cftmake#1title\endcsname\space
            successfully augmented}}
      {\@PackageWarningNoLine{interfaces-tocloft}
         {\expandafter\string\csname @cftmake#1title\endcsname\space
            \space could not be patched
         \MessageBreak Keys label and bookmark won't work for \string\listofsetup}}%
   \fi
}% \itf@cft@newlistof
\itf@cft@newlistof{toc}{}{}
\itf@cft@newlistof{lof}{}{}
\itf@cft@newlistof{lot}{}{}
%% Specific to toc only -------------------------------------------------------
\pgfqkeys{/itf/tocloft/toc}{%
   title/.store as code in cs=contentsname,%
      contentsname/.alias=title,%
   ref/.initial=\contentsname,%
      ref/.default=\contentsname,%
   pagenumbers/.style={% boolean key
      part/pagenumbers={#1},chapter/pagenumbers={#1},section/pagenumbers={#1},%
      subsubsection/pagenumbers={#1},subsubsection/pagenumbers={#1},%
      paragraph/pagenumbers={#1},subparagraph/pagenumbers={#1}},%
   pagenumber/.alias=pagenumbers,%
}%
%% Specific to lof and lot ----------------------------------------------------
\pgfqkeys{/itf/tocloft/lof}{%
   title/.store as code in cs=listfigurename,%
      listfigurename/.alias=title,%
   ref/.initial=\listfigurename,%
      ref/.default=\listfigurename,%
}%
\pgfqkeys{/itf/tocloft/lot}{%
   title/.store as code in cs=listtablename,%
      listtablename/.alias=title,%
   ref/.initial=\listtablename,%
      ref/.default=\listtablename,%
}%
\if@cftsubfigopt
\pgfqkeys{/itf/tocloft}{%
   lof/pagenumbers/.style={figure/pagenumbers={#1},subfigure/pagenumbers={#1}},%
      lof/pagenumber/.alias=lof/pagenumbers,%
   lot/pagenumbers/.style={figure/pagenumbers={#1},subfigure/pagenumbers={#1}},%
      lot/pagenumber/.alias=lot/pagenumbers,%
}%
\else
\pgfqkeys{/itf/tocloft}{%
   lof/pagenumbers/.style={figure/pagenumbers={#1}},%
      lof/pagenumber/.alias=lof/pagenumbers,%
   lot/pagenumbers/.style={figure/pagenumbers={#1}},%
      lot/pagenumber/.alias=lot/pagenumbers,%
}%
\fi
\def\itf@cft@name#1.#2.#3\@nil{cft#1\itf@cft@secname{#2}#3}
\def\itf@cft@secname#1{%
   \expandafter\itf@cft@sec@name\csname#1\endcsname{#1}%
}% \itf@cft@secname
\def\itf@cft@sec@name#1#2{%
   \ifx#1\relax #2\else
   \ifx#1\section sec\else
      \ifx#1\subsection subsec\else
         \ifx#1\subsubsection subsubsec\else
            \ifx#1\paragraph para\else
               \ifx#1\subparagraph subpara\else
                  \ifx#1\figure fig\else
                     \ifx#1\subsubfigure subfig\else
                        \ifx#1\table tab\else
                           \ifx#1\subtable subtab\else
                              \ifx#1\chapter chap\else
                                  #2\fi
   \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
}% \itf@cft@section@name
%% tocloft setup for tables sections :
\pgfkeys{%
/handlers/.cft@def/.style={%
   \pgfkeyscurrentpath/.store in cs=\itf@cft@name #1\@nil},%
/handlers/.cft@code/.style={%
   \pgfkeyscurrentpath/.store as code in cs=\itf@cft@name #1\@nil},%
/handlers/.cft@length/.style={%
   \pgfkeyscurrentpath/.store in skip cs=\itf@cft@name #1\@nil},%
}
\def\itf@cft@newsection{\itf@cft@new@section{/itf/tocloft}}
\def\itf@cft@new@section#1#2#3{% #2 = toc | lof | lot, #3=part / chap / sec / subsec etc.
   \pgfqkeys{#1/#2/#3}{%
      skip/.cft@length=before.#3.skip,%
         beforeskip/.alias*=skip,%
         top/.alias*=skip,%
      indent/.cft@length=.#3.indent,%
      font/.cft@code=.#3.font,%
      font/.append code=\pgfkeysalso{/itf/tocloft/#2/#3/pagenumber/font={##1}},%
         format/.alias*=font,%
      color/.store as color,%
         color/.append code=\pgfkeysalso{/itf/tocloft/#2/#3/font+={%
            \color{\pgfkeysvalueof{/itf/tocloft/#2/#3/color}}%
            \ifdefined\hypersetup \hypersetup{%
               linkcolor=\pgfkeysvalueof{/itf/tocloft/#2/#3/color}}%
            \fi}},%
         font/color/.alias=color,%
         format/color/.alias=color,%
      number/width/.cft@length=.#3.numwidth,%
         numwidth/.alias*=number/width,%
      presnum/.cft@code=.#3.presnum,%
         number/before/.alias*=presnum,%
      aftersnum/.cft@code=.#3.aftersnum,%
         number/after/.alias*=aftersnum,%
      aftersnumb/.cft@code=.#3.aftersnumb,%
         title/before/.alias*=aftersnumb,%
      leader/.cft@def=.#3.leader,%
         leader/.default=\cftdotfill{\csname\itf@cft@name.#3.dotsep\@nil\endcsname},%
         leaders/.alias=leader,%
      dotsep/.code={\ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text
         \csdef{\itf@cft@name.#3.dotsep\@nil}{\cftdotsep}%
         \else
            \itf@units@mu\itf@musk{##1}%
            \csedef{\itf@cft@name.#3.dotsep\@nil}{\itf@strip@mu\itf@musk}%
         \fi},%
         dotsep/.blank=\cftnodots,%
      nodots/.code=\csdef{\itf@cft@name.#3.dotsep\@nil}{\cftnodots},%
         nodots/.value forbidden,%
      pagefont/.cft@code=.#3.pagefont,%
         page/font/.alias*=pagefont,%
         pagenumber/font/.alias*=pagefont,%
         pagenumbers/font/.alias*=pagefont,%
      page/color/.store as color,%
         page/color/.append code=\pgfkeysalso{/itf/tocloft/#2/#3/pagefont+={%
            \color{\pgfkeysvalueof{/itf/tocloft/#2/#3/page/color}}%
            \ifdefined\hypersetup \hypersetup{%
               linkcolor=\pgfkeysvalueof{/itf/tocloft/#2/#3/page/color}}%
            \fi}},%
         pagenumber/color/.alias=page/color,%
         pagenumbers/color/.alias=page/color,%
         page/font/color/.alias=page/color,%
         pagenumber/font/color/.alias=page/color,%
         pagenumbers/font/color/.alias=page/color,%
      afterpnum/.cft@code=.#3.afterpnum,%
         page/after/.alias*=afterpnum,%
         pagenumber/after/.alias*=afterpnum,%
      pagenumbers/.on=\@cftpnumon{\itf@cft@secname{#3}},%
      pagenumbers/.off=\@cftpnumoff{\itf@cft@secname{#3}},%
         pagenumber/.alias=pagenumbers,%
   }% \pgfqkeys
}% \itf@cft@new@section
\@for\itf@tp:=part,chap,chapter,sec,section,subsec,subsection,%
              subsubsec,subsubsection,para,paragraph,subpara,subparagraph%
   \do{\edef\itf@tp{\noexpand\itf@cft@newsection{toc}{\itf@tp}}\itf@tp}%
\if@cftsubfigopt
   \@for\itf@tp:=fig,figure,subfig,subfigure%
      \do{\edef\itf@tp{\noexpand\itf@cft@newsection{lof}{\itf@tp}}\itf@tp}%
   \@for\itf@tp:=tab,table,subtab,subtable%
      \do{\edef\itf@tp{\noexpand\itf@cft@newsection{lot}{\itf@tp}}\itf@tp}%
\else
   \@for\itf@tp:=fig,figure%
      \do{\edef\itf@tp{\noexpand\itf@cft@newsection{lof}{\itf@tp}}\itf@tp}%
   \@for\itf@tp:=tab,table%
      \do{\edef\itf@tp{\noexpand\itf@cft@newsection{lot}{\itf@tp}}\itf@tp}%
\fi
\itf@patch\pretocmd\@cftmaketoctitle
   {\itf@tocloft\contentsname{toc}{tableofcontents}}
   {\@PackageInfoNoLine{interfaces-tocloft}
      {\string\@cftmaketoctitle\space successfully augmented}}
   {\@PackageWarningNoLine{interfaces-tocloft}
      {\string\@cftmaketoctitle\space could not be patched
      \MessageBreak label and bookmark keys for \string\tocsetup\space won't work}}%
\itf@patch\pretocmd\@cftmakeloftitle
   {\itf@tocloft\listfigurename{lof}{listoffigures}}
   {\@PackageInfoNoLine{interfaces-tocloft}
      {\string\@cftmakeloftitle\space successfully augmented}}
   {\@PackageWarningNoLine{interfaces-tocloft}
      {\string\@cftmakeloftitle\space could not be patched
      \MessageBreak label and bookmark keys for \string\lofsetup\space won't work}}%
\itf@patch\pretocmd\@cftmakelottitle
   {\itf@tocloft\listtablename{lot}{listoftables}}
   {\@PackageInfoNoLine{interfaces-tocloft}
      {\string\@cftmakelottitle\space successfully augmented}}
   {\@PackageWarningNoLine{interfaces-tocloft}
      {\string\@cftmakelottitle\space could not be patched
      \MessageBreak label and bookmark keys for \string\lotsetup\space won't work}}%
\expandafter\itf@patch\expandafter\patchcmd\csname\string\newlistof\endcsname
   {#4}{\csname cft#3title\endcsname}
   {\@PackageInfoNoLine{interfaces-tocloft}
      {\string\newlistof\space successfully patched}}
   {\@PackageWarningNoLine{interfaces-tocloft}
      {\string\newlistof\space could not be patched
      \MessageBreak \string\listofsetup\space will not work}}%
\expandafter\itf@patch\expandafter\apptocmd\csname\string\newlistof\endcsname
   {\itf@cft@newlistof{#3}{#2}{#4}}
   {\@PackageInfoNoLine{interfaces-tocloft}
      {\string\newlistof\space successfully augmented}}
   {\@PackageWarningNoLine{interfaces-tocloft}
      {\string\newlistof\space could not be patched
      \MessageBreak \string\listofsetup\space will not work}}%
\expandafter\itf@patch\expandafter\apptocmd\csname\string\newlistentry\endcsname
   {\itf@cft@newsection{#3}{#2}}
   {\@PackageInfoNoLine{interfaces-tocloft}
      {\string\newlistentry\space successfully augmented}}
   {\@PackageWarningNoLine{interfaces-tocloft}
      {\string\newlistentry\space could not be patched
      \MessageBreak \string\listofsetup\space will not work}}
\def\itf@tocloft#1#2#3{%
   \expandafter\def\expandafter#1\expandafter{%
      \expandafter\itf@cft@label
            \expandafter#1\expandafter{#1}{#2}{#3}}%
}% \itf@tocloft
\long\def\itf@cft@label#1#2#3#4{%
   \def#1{#2}% restore original
   \begingroup
   \pgfkeysifdefined{/itf/tocloft/#3/bookmark}
      {%
      \raisedhyperdef{interfaces}{#4}{#2}%
      \pgfkeysgetvalue{/itf/tocloft/#3/bookmark/text}\itf@tp
      \ifx \itf@tp\@empty \else
         \pgfkeysgetvalue{/itf/tocloft/#3/bookmark}\@tempa
         \expandafter\bookmark\expandafter[%
            \expandafter{\@tempa,
               dest=interfaces.#4,%
               level=\pgfkeysvalueof{/itf/tocloft/#3/bookmark/level}%
            }]{\pgfkeysvalueof{/itf/tocloft/#3/bookmark/text}}%
         \global\BKM@startatroottrue
      \fi}
      {#2}%
   \pgfkeysgetvalue{/itf/tocloft/#3/label}\itf@tp
   \ifx \itf@tp\@empty \else
      \def\@currentHref{interfaces.#4}%
      \pgfkeysgetvalue{/itf/tocloft/#3/ref}\@currentlabel
      \def\@currentlabelname{#2}%
      \label{\pgfkeysvalueof{/itf/tocloft/#3/label}}%
   \fi
   \endgroup
   \gdef\itf@tp{\def#1{#2}\global\let\itf@tp \relax}% restore original
   \aftergroup\itf@tp % simple group introduced by tocloft to print \contentsname
}% \itf@cft@label
\endinput
%%
%% End of file `interfaces-tocloft.sty'.
