%% start of file `moderncvthemecasual.sty'.
%% Copyright 2007 Xavier Danaux (xdanaux@gmail.com).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.


%-------------------------------------------------------------------------------
%                identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvthemecasualkinote}[2008/06/17 v0.7 modern curriculum vitae style: casual]


%-------------------------------------------------------------------------------
%                required packages
%-------------------------------------------------------------------------------


%-------------------------------------------------------------------------------
%                package options
%-------------------------------------------------------------------------------
% color options
% blue (default option)
\DeclareOption{blue}{}
% darkblue
\newif\if@colordarkblue\@colordarkbluefalse
\DeclareOption{darkblue}{\@colordarkbluetrue}
% orange
\newif\if@colororange\@colororangefalse
\DeclareOption{orange}{\@colororangetrue}
% green
\newif\if@colorgreen\@colorgreenfalse
\DeclareOption{green}{\@colorgreentrue}
% red
\newif\if@colorred\@colorredfalse
\DeclareOption{red}{\@colorredtrue}
% grey
\newif\if@colorgrey\@colorgreyfalse
\DeclareOption{grey}{\@colorgreytrue}

% roman option
\newif\if@roman\@romanfalse
\DeclareOption{roman}{\@romantrue}

% unused options
\DeclareOption*{
  \PackageWarning{moderncvthemecasualkinote}{Unknown option ‘\CurrentOption’}}

% execute default options
\ExecuteOptions{color}

% process given options
\ProcessOptions\relax


%-------------------------------------------------------------------------------
%                style definition
%-------------------------------------------------------------------------------
% symbols used
\renewcommand*{\listitemsymbol}{\textbullet}

% colors
\definecolor{firstnamecolor}{rgb}{0.45,0.45,0.45}
\definecolor{familynamecolor}{rgb}{0.25,0.25,0.25}
\definecolor{quotecolor}{rgb}{0.35,0.35,0.35}
\definecolor{addresscolor}{rgb}{0.35,0.35,0.35}
% default blue color
  \definecolor{sectionrectanglecolor}{rgb}{0.25,0.50,0.75}
  \definecolor{sectiontitlecolor}{rgb}{0.20,0.40,0.65}
  \definecolor{subsectioncolor}{rgb}{0.20,0.40,0.65}
  \definecolor{footersymbolcolor}{rgb}{0.25,0.50,0.75}
\if@colordarkblue
  \definecolor{sectionrectanglecolor}{rgb}{0.10,0.20,0.45}
  \definecolor{sectiontitlecolor}{rgb}{0.05,0.10,0.35}
  \definecolor{subsectioncolor}{rgb}{0.05,0.10,0.35}
  \definecolor{footersymbolcolor}{rgb}{0.10,0.20,0.45}\fi
\if@colororange
  \definecolor{sectionrectanglecolor}{rgb}{1.00,0.65,0.20}
  \definecolor{sectiontitlecolor}{rgb}{0.95,0.55,0.15}
  \definecolor{subsectioncolor}{rgb}{0.95,0.55,0.15}
  \definecolor{footersymbolcolor}{rgb}{0.95,0.55,0.15}\fi
\if@colorgreen
  \definecolor{sectionrectanglecolor}{rgb}{0.55,0.85,0.35}
  \definecolor{sectiontitlecolor}{rgb}{0.30,0.65,0.15}
  \definecolor{subsectioncolor}{rgb}{0.30,0.65,0.15}
  \definecolor{footersymbolcolor}{rgb}{0.30,0.65,0.15}\fi
\if@colorred
  \definecolor{sectionrectanglecolor}{rgb}{1.00,0.30,0.30}
  \definecolor{sectiontitlecolor}{rgb}{0.95,0.20,0.20}
  \definecolor{subsectioncolor}{rgb}{0.95,0.20,0.20}
  \definecolor{footersymbolcolor}{rgb}{0.95,0.20,0.20}\fi
\if@colorgrey
  \definecolor{sectionrectanglecolor}{rgb}{0.75,0.75,0.75}
  \definecolor{sectiontitlecolor}{rgb}{0.35,0.35,0.35}
  \definecolor{subsectioncolor}{rgb}{0.35,0.35,0.35}
  \definecolor{footersymbolcolor}{rgb}{0.35,0.35,0.35}\fi

% fonts
\if@roman
  \AtBeginDocument{\rmfamily}
\else
  \AtBeginDocument{\sffamily}\fi
\renewcommand*{\ttdefault}{pcr}
\renewcommand*{\firstnamefont}{\fontsize{32}{40}\sffamily\mdseries\upshape}
\renewcommand*{\familynamefont}{\firstnamefont}
\renewcommand*{\addressfont}{\footnotesize\sffamily\mdseries\slshape}
\renewcommand*{\quotefont}{\large\slshape}
\renewcommand*{\sectionfont}{\Large\sffamily\mdseries\upshape}
\renewcommand*{\subsectionfont}{\large\sffamily\mdseries\upshape}

\newlength{\maketitlepicturewidth}
\setlength{\maketitlepicturewidth}{\@photowidth}
\ifthenelse{\isundefined{\@photo}}{}{
  \addtolength{\maketitlepicturewidth}{0.5em}
}
\newlength{\maketitledetailswidth}
\setlength{\maketitledetailswidth}{\textwidth}
\ifthenelse{\isundefined{\@photo}}{}{
  \addtolength{\maketitledetailswidth}{-\maketitlepicturewidth}
  \addtolength{\maketitledetailswidth}{-1em}
}

% styles

% maketitle
\newif\if@firstdetailselement\@firstdetailselementtrue
\newcommand*{\maketitledetailsnewline}{
  \if@firstdetailselement%
    \@firstdetailselementfalse%
  \else%
    \\[.2em]\fi}
\renewcommand*{\maketitle}{%
  {%
    \hfill%
%    \raggedleft{\firstnamestyle{\MakeLowercase{\@firstname}}\familynamestyle{\MakeLowercase{\@familyname}}}\\[-.35em]}%
    \raggedleft{\firstnamestyle{\@firstname}~\familynamestyle{\@familyname}}\\[-.35em]}%
  {\color{firstnamecolor}\rule{\textwidth}{.25ex}\\[0.5em]}%
  \begin{minipage}{\maketitledetailswidth}%
    % optional quote
    \ifthenelse{\isundefined{\@quote}}{}%
    {\raggedleft\quotestyle{\@quote}\\[0.5em]}%
    %\end{minipage}}\\[0.5em]}%
    \raggedleft\addressfont\color{addresscolor}%
    \ifthenelse{\isundefined{\@addressstreet}}{}{%
      \maketitledetailsnewline%
        \addresssymbol~\@addressstreet%
        \ifthenelse{\isundefined{\@addresscity}}{}{, \@addresscity}}%
        \ifthenelse{\isundefined{\@mobile}}{}{\maketitledetailsnewline\mobilesymbol~\@mobile}%
        \ifthenelse{\isundefined{\@phone}}{}{\maketitledetailsnewline\phonesymbol~\@phone}%
        \ifthenelse{\isundefined{\@fax}}{}{\maketitledetailsnewline\faxsymbol~\@fax}%
        \ifthenelse{\isundefined{\@email}}{}{\maketitledetailsnewline\emailsymbol~\emaillink{\@email}}%
        \ifthenelse{\isundefined{\@extrainfo}}{}{\maketitledetailsnewline\@extrainfo}%
  \end{minipage}%
  \ifthenelse{\isundefined{\@photo}}%
    {}%
    {%
    \hspace{1em}%
    \begin{minipage}{\maketitlepicturewidth}{%
      \color{firstnamecolor}\framebox[\maketitlepicturewidth]{\includegraphics[width=\@photowidth]{\@photo}}}
    \end{minipage}%
    }%
  }%

% cv footer
\newif\if@firstfooterelement\@firstfooterelementtrue
\providecommand*{\footersymbol}{}
\renewcommand*{\footersymbol}{%
  \if@firstfooterelement%
  \else%
    { ~~\color{footersymbolcolor}\textbullet~~~}\fi}
\providecommand*{\makefooter}{}
\renewcommand*{\makefooter}{%
  \fancypagestyle{plain}{%
  }%
  \pagestyle{plain}}
\AtBeginDocument{\makefooter}


\endinput


%% end of file `moderncvthemecasual.sty'.
