package constant

import (
	"fmt"
	"os"
	"os/user"
)

var (
	PthSep = string(os.PathSeparator)

	ConfigVer  = 1
	userProfile, _ = user.Current()

	ConfigFile = fmt.Sprintf("%s%s.zd.conf", userProfile.HomeDir, PthSep)

	LanguageDefault = "en"
	LanguageEN      = "en"
	LanguageZH      = "zh"

	EnRes = fmt.Sprintf("res%sen%smessages.json", string(os.PathSeparator), string(os.PathSeparator))
	ZhRes = fmt.Sprintf("res%szh%smessages.json", string(os.PathSeparator), string(os.PathSeparator))

	LogDir = fmt.Sprintf("log%s", string(os.PathSeparator))

	LeftWidth = 36
	MinWidth  = 130
	MinHeight = 36

	CmdViewHeight = 10
	
	MaxNumb = 100000 // max number in array

	FormatText = "text"
	FormatJson = "json"
	FormatXml = "xml"
	FormatSql = "sql"
	Formats = []string{FormatText, FormatJson, FormatXml, FormatSql}

	TypeText = "text"
	TypeImage = "image"
	TypeVoice = "voice"
	TypeVideo = "video"
	TypeArticle = "article"

	LeftBrackets  rune = '('
	RightBrackets rune = ')'
	Backtick rune = '`'

	DefaultPort = 8848
	DefaultRoot = "./"

	ResDir  = "data/"
	TmpDir  = "tmp/"

	SqliteDriver  = "sqlite3"
	SqliteSource  = "file:" + TmpDir + "cache/.data.db"
	SqliteTrackTable  = "excel_update"

	ExcelBorder  = `{"border": [{"type":"left","color":"999999","style":1}, {"type":"top","color":"999999","style":1},
		                              {"type":"bottom","color":"999999","style":1}, {"type":"right","color":"999999","style":1}]}`
	ExcelHeader  = `{"fill":{"type":"pattern","pattern":1,"color":["E0EBF5"]}}`
)
