%D \module
%D   [       file=classic,
%D        version=2009.03.31,
%D          title=\CONTEXT\ Resume Style,
%D       subtitle=Classic Style,
%D         author=Wolfgang Schuster,
%D           date=\currentdate,
%D      copyright=Wolfgang Schuster,
%D          email=schuster.wolfgang@googlemail.com,
%D        license=Public Domain]

\unprotect

\useresumestyle[modern]

%D Colors (moderncv names)
%D
%D \startlines
%D classic:1 firstnamecolor
%D classic:2 familynamecolor
%D classic:3 titlecolor
%D classic:4 quotecolor
%D classic:5 addresscolor
%D classic:6 sectionrectanglecolor
%D classic:7 sectiontitlecolor
%D classic:8 subsectioncolor
%D resume:9 footersymbolcolor
%D \stoplines

\startsetups resume:blue

  \definecolorgroup
    [resume]
    [0.00:0.00:0.00,
     0.00:0.00:0.00,
     0.35:0.35:0.35,
     0.35:0.35:0.35,
     0.25:0.50:0.75,
     0.25:0.50:0.75,
     0.20:0.40:0.65,
     0.20:0.40:0.65,
     0.00:0.00:0.00]

\stopsetups

\startsetups resume:orange

  \definecolorgroup
    [resume]
    [0.00:0.00:0.00,
     0.00:0.00:0.00,
     0.35:0.35:0.35,
     0.35:0.35:0.35,
     0.95:0.55:0.15,
     1.00:0.65:0.20,
     0.95:0.55:0.15,
     0.95:0.55:0.15,
     0.00:0.00:0.00]

\stopsetups

\startsetups resume:green

  \definecolorgroup
    [resume]
    [0.00:0.00:0.00,
     0.00:0.00:0.00,
     0.35:0.35:0.35,
     0.35:0.35:0.35,
     0.30:0.65:0.15,
     0.55:0.85:0.35,
     0.30:0.65:0.15,
     0.30:0.65:0.15,
     0.00:0.00:0.00]

\stopsetups

\startsetups resume:red

  \definecolorgroup
    [resume]
    [0.00:0.00:0.00,
     0.00:0.00:0.00,
     0.35:0.35:0.35,
     0.35:0.35:0.35,
     0.95:0.20:0.20,
     1.00:0.30:0.30,
     0.95:0.20:0.20,
     0.95:0.20:0.20,
     0.00:0.00:0.00]

\stopsetups

\startsetups resume:grey

  \definecolorgroup
    [resume]
    [0.00:0.00:0.00,
     0.00:0.00:0.00,
     0.35:0.35:0.35,
     0.35:0.35:0.35,
     0.35:0.35:0.35,
     0.75:0.75:0.75,
     0.35:0.35:0.35,
     0.35:0.35:0.35,
     0.00:0.00:0.00]

\stopsetups

\processaction
  [\resumestylevalue\v!option\c!color]
  [      blue=>\directsetup{resume:blue},
       orange=>\directsetup{resume:orange},
        green=>\directsetup{resume:green},
          red=>\directsetup{resume:red},
         grey=>\directsetup{resume:grey},
   \s!unknown=>\directsetup{resume:blue}]

%D Quick and dirty solution

\def\attributedresumevalue#1%
  {\doattributes{\????rd#1}\c!style\c!color{\resumevalue{#1}}}

\def\resumeheadalternativecassual[#1]%
  {\bgroup
   \def\doresumeheadalternativecassual##1%
     {\doifresumevalue{##1}{\advance\scratchcounter\plusone}}%
   \def\dodoresumeheadalternativecassual##1%
     {\doifresumevalue{##1}
        {\advance\scratchcounter\plusone
         \attributedresumevalue{##1}%
         \ifnum\scratchcounter<\resumeheadvalues\\\fi}}%
   \scratchcounter\zerocount
   \processcommalist[#1]\doresumeheadalternativecassual
   \edef\resumeheadvalues{\number\scratchcounter}%
   \scratchcounter\zerocount
   \processcommalist[#1]\dodoresumeheadalternativecassual
   \egroup}

\setvalue{\v!resume:\v!head:\v!classic}%
  {\hbox to \textwidth\bgroup
     \vbox\bgroup
       \hbox{\attributedresumevalue\v!firstname\space\attributedresumevalue\v!familyname}
       \doifresumevalue\v!title{\blank[\v!medium]}
       \hbox{\attributedresumevalue\v!title}
     \egroup
     \hss
     \framed
       [\c!location=\v!bottom,\c!align=\v!left,\c!width=\v!fit,\c!frame=\v!off]
       {\resumeheadalternativecassual[street,town,mobile,phone,fax,email,info]}%
     \quad
     \framed[\c!offset=2\points,\c!strut=\v!no]{\resumevalue{image}}%
   \egroup}

\setvalue{\v!resume:\v!nextfoot:\v!classic}%
  {\color[resume:4]{\it\correspagenumber/\numberofcorrespages}}

\setupresumestyle
  [\v!head,\v!nextfoot]
  [\c!alternative=\v!classic]

\setupresumestyle
  [\v!head]
  [\c!hoffset=\backspace,
   \c!voffset=2cm,
   \c!frame=\v!off,
   \c!width=\textwidth,
   \c!height=7cm]

\setupresumestyle
  [\v!nextfoot]
  [\v!option]
  [\c!state={\v!first,\v!next}]

\setupresumestyle
  [\v!nextfoot]
  [\v!frame]
  [\c!frame=\v!off,
   \c!width=\textwidth,
   \c!height=2cm,
   \c!align={\v!left,\v!lohi}]

\setupresumestyle
  [\v!nextfoot]
  [\v!layer]
  [\c!preset=\v!left\v!bottom,
   \c!hoffset=\backspace,
   \c!voffset=2cm]

%D Default style for the user information

\setupresume[\v!quote]     [\c!style=\v!italic,\c!color=resume:4]
\setupresume[\v!firstname] [\c!style=\c!tf\c!d,\c!color=resume:1]
\setupresume[\v!familyname][\c!style=\c!tf\c!d,\c!color=resume:2]
\setupresume[\v!title]     [\c!style=\c!it\c!b,\c!color=resume:3]
\setupresume[\v!street]    [\c!style=\v!italic,\c!color=resume:5]
\setupresume[\v!town]      [\c!style=\v!italic,\c!color=resume:5]
\setupresume[\v!mobile]    [\c!style=\v!italic,\c!color=resume:5]
\setupresume[\v!phone]     [\c!style=\v!italic,\c!color=resume:5]
\setupresume[\v!fax]       [\c!style=\v!italic,\c!color=resume:5]
\setupresume[\v!email]     [\c!style=\v!italic,\c!color=resume:5]
\setupresume[\v!info]      [\c!style=\v!italic,\c!color=resume:5]

\protect \endinput
