# coding: utf-8
# calc OLE  TEXCELL 
# 2019.01 Ver.1.00

class CalcUtilt
   NONE = 0x7FFF
   SOLID = 0
   DOTTED = 1
   DASHED = 2
   DOUBLE = 3
   THINTHICK_SMALLGAP = 4
   THINTHICK_MEDIUMGAP = 5
   THINTHICK_LARGEGAP = 6
   THICKTHIN_SMALLGAP = 7
   THICKTHIN_MEDIUMGAP = 8
   THICKTHIN_LARGEGAP = 9
   EMBOSSED = 10
   ENGRAVED = 11
   OUTSET = 12
   INSET = 13
   FINE_DASHED = 14
   DOUBLE_THIN = 15
   DASH_DOT = 16
   DASH_DOT_DOT = 17

# 文字斜体
   FontSlant_NONE = 0
   FontSlant_OBLIQUE = 1
   FontSlant_ITALIC = 2
   FontSlant_DONTKNOW = 3
   FontSlant_REVERSE_OBLIQUE = 4
   FontSlant_REVERSE_ITALIC = 5

# 文字太字
   FontWeight_DONTKNOW = 0
   FontWeight_THIN = 50
   FontWeight_ULTRALIGHT = 60
   FontWeight_LIGHT = 75
   FontWeight_SEMILIGHT = 90
   FontWeight_NORMAL = 100
   FontWeight_SEMIBOLD = 110
   FontWeight_BOLD = 150
   FontWeight_ULTRABOLD = 175
   FontWeight_BLACK = 200

# 文字下線
   FontUnderline_NONE = 0
   FontUnderline_SINGLE = 1
   FontUnderline_DOUBLE = 2
   FontUnderline_DOTTED = 3
   FontUnderline_DONTKNOW = 4
   FontUnderline_DASH = 5
   FontUnderline_LONGDASH = 6
   FontUnderline_DASHDOT = 7
   FontUnderline_DASHDOTDOT = 8
   FontUnderline_SMALLWAVE = 9
   FontUnderline_WAVE = 10
   FontUnderline_DOUBLEWAVE = 11
   FontUnderline_BOLD = 12
   FontUnderline_BOLDDOTTED = 13
   FontUnderline_BOLDDASH = 14
   FontUnderline_BOLDLONGDASH = 15
   FontUnderline_BOLDDASHDOT = 16
   FontUnderline_BOLDDASHDOTDOT = 17
   FontUnderline_BOLDWAVE = 18

# セル内容横方向配置
   CellHoriJustify_STANDARD = 0
   CellHoriJustify_LEFT = 1
   CellHoriJustify_CENTER = 2
   CellHoriJustify_RIGHT = 3
   CellHoriJustify_BLOCK = 4
   CellHoriJustify_REPEAT = 5

# セル内容縦方向配置
   CellVertJustify_STANDARD = 0
   CellVertJustify_TOP = 1
   CellVertJustify_CENTER = 2
   CellVertJustify_BOTTOM = 3

# 取り消し線
   FontStrikeout_NONE = 0
   FontStrikeout_SINGLE = 1
   FontStrikeout_DOUBLE = 2
   FontStrikeout_DONTKNOW = 3
   FontStrikeout_BOLD = 4
   FontStrikeout_SLASH = 5
   FontStrikeout_X = 6

# ******* RGB *******
   def RGB(iRed, iGreen, iBlue)
   
      return (iRed << 16) | (iGreen << 8) | iBlue
   end

# ******* 書式コード取得 *******
   def getFormatCode(servmnga, doca, sfomt)

      local = servmnga.Bridge_GetStruct("com.sun.star.lang.Locale")
      local.Language = "ja"
      local.Country = "JP"
      nfid = doca.NumberFormats.queryKey(sfomt, local, false)
      if nfid == -1     # 存在しない場合は登録
         nfid = doca.NumberFormats.addNew(sfomt, local)
      end
      return nfid
   end

end
