package edu.chl.proton.model;

import static java.awt.Font.BOLD;
import static java.awt.Font.ITALIC;
import static java.time.format.SignStyle.NORMAL;

/**
 * @author Ludvig Ekman
 * Created by ludvig on 2017-05-01.
 */
// TODO: Take in a Part to change, or have a public CurrentPart? Or otherwise solve problem with referencing to a
// non-static object from a static method.
public class FontStyle {
    private String font;
    private TextPosture posture;
    private TextWeight weight;
    private int size;

    public FontStyle(String font, TextPosture posture, TextWeight weight, int size){
        this.font = font;
        this.posture=posture;
        this.size=size;
        this.weight=weight;
    }
    public FontStyle(){
    }

    protected void setFont(String font){ // enum as well?
        if(font == null){

        }
        //TODO: Make fonts
        if(font.equalsIgnoreCase("SANS")){
            // FontStyle.setFont(font);

        } else if(font.equalsIgnoreCase("ROMAN")){
            return;

        } else if (font.equalsIgnoreCase("NORMAL")){
            return; // default
        }
    }
    protected String getFont(){
        return font;
    }

    protected void setTextPosture(TextPosture posture) {
        switch (posture) {
            case ITALIC:
                // Make stuff italic
                break;
            case NORMAL:
                // and so on
                break;
            default:
                // reset / do nothing?
                break;
        }
    }
    protected TextPosture getTextPosture(){
        return posture;
    }
    protected void setTextWeight(TextWeight weight) {
        switch (weight) {
            case BOLD:
                // Do stuff bold
                break;
            case NORMAL:
            // and so on
            break;
            default:
                //text3.setFont(Font.font(family, FontPosture.ITALIC, size));
                break;
        }
    }
    protected TextWeight getTextWeight(){
        return weight;
    }
    protected void setSize(int size){
            // do something with the text size
    }
    protected int getSize() {
        return size;
    }

    protected String getItalicStyle(String makeStyle){
        return "<b>"+makeStyle+"</b>";
    }
    protected String getItalicBoldStyle(String makeStyle){
        return "<b>"+makeStyle+"</b>";
    }
    protected String getHeadingStyle(String makeStyle){

        return "<b>"+makeStyle+"</b>";
    }
    protected String getLinkStyle(String makeStyle){

        return "<span style=\"text-decoration:underline;color:blue\">"+makeStyle+"</span>";
    }
    protected String getListStyle(String makeStyle){

        return "<span style=\"color:#007E73\">" + makeStyle + "</span>";
    }
    protected String getBoldStyle(String makeStyle){

        return "<b>"+makeStyle+"</b>";
    }
    protected String getQuoteStyle(String makeStyle){

        return "<b>"+makeStyle+"</b>";
    }
    protected String getCodeStyle(String makeStyle){

        return "<b>"+makeStyle+"</b>";
    }

}

@@ -2243,33 +2243,33 @@
        return %22%3C
-b
+i
 %3E%22+makeStyle+%22%3C/
@@ -2260,33 +2260,33 @@
 %3E%22+makeStyle+%22%3C/
-b
+i
 %3E%22;%0A    %7D%0A    pr
@@ -2349,32 +2349,35 @@
      return %22%3Cb%3E
+%3Ci%3E
 %22+makeStyle+%22%3C/b
@@ -2367,32 +2367,36 @@
 %3E%22+makeStyle+%22%3C/
+i%3E%3C/
 b%3E%22;%0A    %7D%0A    p
@@ -2462,37 +2462,78 @@
  return %22%3Cb%3E
-%22+makeStyle+%22
+%3Cspan style=%5C%22color:#007E73%5C%22%3E%22 + makeStyle + %22%3C/span%3E
 %3C/b%3E%22;%0A    %7D
@@ -2989,34 +2989,68 @@
 eturn %22%3C
-b%3E%22+makeStyle+%22%3C/b
+span style=%5C%22color:#007E73%5C%22%3E%22 + makeStyle + %22%3C/span
 %3E%22;%0A    

make more unique styles in FontStyle