%% start of file `moderncvstylesidebar.sty'.
%% Copyright 2006-2015 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{moderncvstylesidebar}[2015/07/28 v2.0.0 modern curriculum vitae scheme: empty]


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

\RequirePackage{tikz}
\RequirePackage[absolute,overlay]{textpos}
\RequirePackage[left=6.5cm,right=1cm,top=0cm,bottom=0cm]{geometry}
\RequirePackage{tabularx}

%-------------------------------------------------------------------------------
%                package options
%-------------------------------------------------------------------------------


%-------------------------------------------------------------------------------
%                style definition
%-------------------------------------------------------------------------------
% see moderncv.cls for command declarations that needs to be implemented, e.g. \maketitle, \section, \subsections, \cvline, etc

\newcommand*{\langs}[1]{\def\@langs{#1}}
\newcommand*{\skills}[1]{\def\@skills{#1}}
\newcommand*{\others}[1]{\def\@others{#1}}


\renewcommand*{\namefont}{\fontsize{24}{32}\mdseries\upshape}
\renewcommand*{\titlefont}{\Huge\mdseries\slshape}
\renewcommand*{\addressfont}{\large\mdseries\slshape}
\renewcommand*{\quotefont}{\large\slshape}

% styles
\renewcommand*{\namestyle}[1]{{\namefont\textcolor{white}{#1}}}
\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{white}{#1}}}
\renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{white}{#1}}}
\renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{white}{#1}}}

\moderncvicons{marvosym}

\pagestyle{empty}

\@initializelength{\quotewidth}

\@initializelength{\makecvheadnamewidth}
\renewcommand*{\recomputecvheadlengths}{%
  \setlength{\quotewidth}{0.65\textwidth}}
  
\renewcommand*{\makecvhead}{%
  % recompute lengths (in case we are switching from letter to resume, or vice versa)
  \recomputecvlengths%
  % optional detailed information (pre-rendering)
  
  \@initializebox{\makecvheadbackgroundbox}%  
  \savebox{\makecvheadbackgroundbox}{%
    \begin{tikzpicture}[remember picture,overlay]
   		\node [rectangle, fill=sidecolor, anchor=north, minimum width=11cm, minimum height=\paperheight+1cm] (box) at (-6cm,0.5cm){};
	\end{tikzpicture}
	}
	
  \@initializebox{\makecvheadpicturebox}%
  \savebox{\makecvheadpicturebox}{%
    \ifthenelse{\isundefined{\@photo}}%
      {}%
      {
		%\begin{center}
      	\begin{tikzpicture}%[x=0.1,y=-0.1]
			\clip (\@photowidth/2, -\@photowidth/2) circle (\@photowidth/2);
			\node[anchor=north west, inner sep=0pt, outer sep=0pt] at (0,0) {\includegraphics[width=\@photowidth]{\@photo}};
		\end{tikzpicture}
		%\end{center}
	}
     }
     
            
  \@initializebox{\makecvheaddetailsbox}%  
    \def\phonesdetails{}%
    \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
      \protected@edef\phonesdetails{\phonesdetails\protect\makenewline\hfill\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
    \def\socialsdetails{}%
    \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
      \protected@edef\socialsdetails{\socialsdetails\protect\makenewline\hfill\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
  \savebox{\makecvheaddetailsbox}{%
    \begin{minipage}[t]{5.2cm}
    \raggedright
		\addressfont\color{white}%
      %\begin{tabular}[b]{@{}r@{}}
        \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\hfill\@addressstreet%
          \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\hfill\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
          \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\hfill\@addresscountry}}%
        \phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict
        \ifthenelse{\isundefined{\@email}}{}{\makenewline\hfill\emailsymbol\emaillink{\@email}}%
        \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hfill\homepagesymbol\httplink{\@homepage}}%
        \socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict
        \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\hfill\@extrainfo}%
      %\end{tabular}
    \end{minipage}}
  
  \@initializebox{\makecvheadnamebox}%
  \savebox{\makecvheadnamebox}{%
    \begin{minipage}[t]{5.2cm}
     \begin{center}
      {\namestyle{\@firstname\ \@lastname}}
      \ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
     \end{center}
    \end{minipage}}%
    
  \@initializebox{\makecvheadlangbox}%
  \savebox{\makecvheadlangbox}{%
     \textcolor{white}{
    \begin{minipage}[t]{5.2cm}
    \ifthenelse{\isundefined{\@langs}}{}{\makenewline\@langs}%
    \end{minipage}
      }
    }%
    
  \@initializebox{\makecvheadskillbox}%
  \savebox{\makecvheadskillbox}{%
     \textcolor{white}{
    \begin{minipage}[t]{5.2cm}
    \ifthenelse{\isundefined{\@skills}}{}{\makenewline\@skills}%
    \end{minipage}
      }
    }%
    
  \@initializebox{\makecvheadotherbox}%
  \savebox{\makecvheadotherbox}{%
     \textcolor{white}{
    \begin{minipage}[t]{5.2cm}
    \ifthenelse{\isundefined{\@others}}{}{\makenewline\@others}%
    \end{minipage}
      }
    }%
% -------------------------------------- 
    \usebox{\makecvheadbackgroundbox}%
    
	\begin{textblock}{1}(0.3,0)
	\begin{minipage}[t][\paperheight]{5.2cm}
	\begin{center}
	\vspace{0.5cm}
	\vfill%
		\usebox{\makecvheadpicturebox}%	
	\vspace{0.2cm}	
    \vfill%	 		     
      	\usebox{\makecvheadnamebox}%      	
    \vfill%      	
	\vspace{0.5cm}
      	\usebox{\makecvheaddetailsbox}%      	
    \vfill%      	
      	\usebox{\makecvheadskillbox}%      		
    \vfill%      	
      	\usebox{\makecvheadlangbox}%      		
    \vfill%      	
      	\usebox{\makecvheadotherbox}%      	
    \vfill%  
	\vspace{1cm} 
	\end{center}
	\end{minipage}
	\end{textblock}
}  
  
%\@initializelength{\quotewidth}
%\setlength{\marginparwidth}{0\p@}
%\setlength{\marginparsep}{0\p@}
%\renewcommand*{\recomputecvheadlengths}{%
%  \marginparwidth+\marginparsep% if a letter was typeset before the resume, \marginparwidth and \marginparsep will be non-zero; otherwise, this has no effect
%  \setlength{\marginparwidth}{0\p@}%
%  \setlength{\marginparsep}{0\p@}%
%  \setlength{\quotewidth}{0.85\textwidth}}



\moderncvbody{1}

\endinput


%% end of file `moderncvstylesidebar.sty'.
