diff options
Diffstat (limited to 'wizards/source/depot/CommonLang.xba')
-rw-r--r-- | wizards/source/depot/CommonLang.xba | 368 |
1 files changed, 368 insertions, 0 deletions
diff --git a/wizards/source/depot/CommonLang.xba b/wizards/source/depot/CommonLang.xba new file mode 100644 index 000000000..ec2f62733 --- /dev/null +++ b/wizards/source/depot/CommonLang.xba @@ -0,0 +1,368 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<!-- + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . +--> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="CommonLang" script:language="StarBasic">REM ***** BASIC ***** + + +' Column A has the index 1 +Public Const SBCOLUMNNAME1 = 3 ' Stock names, sheet 1 +Public Const SBCOLUMNID1 = 4 ' Stock ID, sheet 1 +Public Const SBCOLUMNQUANTITY1 = 5 ' Stock quantity sheet 1 +Public Const SBCOLUMNRATE1 = 7 ' Price for stocks, sheet 1 +Public Const SBCOLUMNNAME2 = 3 ' Stock names, sheet 2 +Public Const SBCOLUMNDATE2 = 4 ' Transaction dates, sheet 2 +Public Const SBCOLUMNQUANTITY2 = 5 ' Transaction quantity, sheet 2 +Public Const SBCOLUMNRATE2 = 6 ' Price for stocks, sheet 2 +Public Const SBCOLUMNPROVPERCENT2 = 7 ' Provision in %, sheet 2 +Public Const SBCOLUMNPROVMIN2 = 8 ' Minimum provision, sheet 2 +Public Const SBCOLUMNPROVFIX2 = 9 ' Fixed provision, sheet 2 +Public Const SBCOLUMNPROCEEDS2 = 12 ' Profit, sheet 2 +Public Const SBCOLUMNQTYSOLD2 = 14 ' Quantity sold, sheet 2 +Public Const SBCOLUMNQTYREST2 = 15 ' Quantity not sold yet, sheet 2 +Public Const SBCOLUMNPRCREST2 = 16 ' Proportional price for quantity not sold yet, sheet 2 +Public Const SBCOLUMNREALPROC2 = 17 ' Realized proceeds, sheet 2 +Public Const SBCOLUMNDIVIDEND2 = 18 ' Dividend paid, sheet 2 +Public Const SBCOLUMNREALPROFIT2 = 19 ' Realized profit, sheet 2 +Public Const SBROWFIRSTTRANSACT2 = 8 ' First data row, sheet 2 +Public Const SBROWHEADER1 = 6 ' Headline, sheet 1 +Public Const SBMSGOK = 0 +Public Const SBMSGYESNO = 4 +Public Const SBMSGSTOP = 16 +Public Const SBMSGQUESTION = 32 +Public Const SBMSGDEFAULTBTN2 = 256 +Public Const SBHASID = 1 ' 0 = no ID, 1 = stocks have an ID +Public Const SBDIALOGSELL = 1 ' Step for main dialog +Public Const SBDIALOGBUY = 2 ' Step for main dialog +Public Const SBBINARY = 0 +Public TransactMode as Integer +Public Const LIFO = -1 +Public Const FIFO = 1 + +Public Const HANDLEDIVIDEND = 1 +Public Const HANDLESPLIT = 2 + +Global oDocument as Object +Global oDocFormats() as Object +Global oController as Object +Global oFirstSheet as Object +Global oBankSheet as Object +Global oMovementSheet as Object +Global sDocLanguage as String +Global sDocCountry as String +Global oSheets as Object +Global oDocLocale as New com.sun.star.lang.Locale +Global bEnableMarket as Boolean +Global bEnableInternet as Boolean +Global oMarketModel as Object +Global oInternetModel as Object + +Global sCurCurrency$, sCurExtension$, sCurChartSource$, sCurStockIDLabel$, sCurSeparator$ + +Public oNumberFormatter as Object +Public bDebugmode as Boolean +Global GlobListindex as Integer +Public blabla() as String +Public SplitDate as Date +Public oChartSheet as Object +Public oBackgroundSheet as Object +Public Const SBDATECOLUMN = 3 +Public Const SBVALUECOLUMN = 4 +Public Const SBSTARTROW = 25 +Public Const SBCHARTPERIOD = 14 +Public Const SBINTERVAL = "d" +Public sColumnHeader as String +Public StartDate as Date +Public EndDate as Date +Public iCurRow as Integer +Public iMaxRow as Integer +Public iStartDay as Integer +Public iStartMonth as Integer +Public iStartYear as Integer +Public iEndDay as Integer +Public iEndMonth as Integer +Public iEndYear as Integer +Public oStatusLine as Object +Public Today as Date +Public sInterval as String +Public ShortMonths(11,1) +Public iStep as Integer +Public sDepotCurrency as String +Public iValueCol as Integer + +Public DlgReference as Object +Public DlgTransaction as Object +Public DlgStockRates as Object +Public DlgStartUp as Object +Public TransactModel as Object +Public StockRatesModel as Object +Public StartUpModel as Object +Public StockRatesTitle(1 To 3) +Public TransactTitle(1 To 2) +Public NullList() +Public sStartupWelcome$, sStartupChooseMarket$, sStartupHint$ + +Public sMarket(7,10) as String +Public sCountryMarket(7,10) as String + +Public cDlgCaption1$, cDlgCaption2$ +Public sMsgError$, sMsgNoName$, sMsgNoQuantity$, sMsgNoDividend$, sMsgNoExchangeRate$ +Public sMsgNoValidExchangeDate$, sMsgWrongExchangeDate$, sMsgSellTooMuch$, sMsgConfirm$ +Public sMsgFreeStock$, sMsgTotalLoss$, sMsgEndDatebeforeNow$, sMsgStartDatebeforeEndDate$ + +Public sOk$, sCancel$ +Public sMsgAuthorization$, sMsgDeleteAll$ +Public SellMethod$ +Public cSplit$ +Global HistoryChartSource as String +Public DateCellStyle as String +Public CurrCellStyle as String +Public sStartDate$, sEndDate$, sHistory$ +Public sInsertStockname$ +Public sProductname$, sTitle$ +Public sInsertStocks$, sStockname$, sNoInternetUpdate$, sMarketplace$, sNoInternetDataAvailable$ +Public sCheckInternetSettings as String + +Sub LoadLanguage() + LoadDepotDialogs() + Select Case sDocLanguage + Case "de" + LoadGermanLanguage() + Case "en" + LoadEnglishLanguage() + Case "fr" + LoadFrenchLanguage() + Case "it" + LoadItalianLanguage() + Case "es" + LoadSpanishLanguage() + Case "sv" + LoadSwedishLanguage() + Case "ja" + LoadJapaneseLanguage() + Case "ko" + LoadKoreanLanguage() + Case "zh" + If sDocCountry = "CN" Then + LoadChineseSimpleLanguage() + Else + LoadChineseTradLanguage() + End If + End Select + InitializeStartUpModel() +End Sub + +Sub CompleteMarketList() +Dim EuroIndex as Integer +Dim LocCountry as String +Dim LocLanguage as String +Dim sLangList() as String +Dim sCountryList() as String +Dim sExtensionList() as String +Dim MaxIndex as Integer +Dim bIsLocale as Boolean + + GlobListIndex = -1 + For n = 0 To 5 + LocLanguage = sMarket(n,6) + LocCountry = sMarket(n,7) + If Instr(1,LocLanguage,";",SBBINARY) = 0 Then + bIsLocale = CheckDocLocale(LocLanguage, LocCountry) + Else + EuroIndex = 0 + sLangList() = ArrayoutofString(LocLanguage, ";", MaxIndex) + sCountryList() = ArrayoutofString(LocCountry, ";", MaxIndex) + sExtensionList() = ArrayoutofString(sMarket(n,8), ";", MaxIndex) + For m = 0 To MaxIndex + bIsLocale = CheckDocLocale(sLangList(m), sCountryList(m)) + If bIsLocale Then + EuroIndex = m + Exit For + End If + Next m + sMarket(n,6) = sLangList(EuroIndex) + sMarket(n,7) = sCountryList(EuroIndex) + sMarket(n,8) = sExtensionList(EuroIndex) + End If + If bIsLocale Then + GlobListIndex = n + Exit For + End If + Next n +End Sub + +Sub LocalizedCurrencies() + If GlobListIndex = -1 Then + sCountryMarket(0,0) = "Euro" + sCountryMarket(0,1) = chr(8364) + sCountryMarket(0,2) = "Paris" + sCountryMarket(0,3) = "http://fr.finance.yahoo.com/d/quotes.csv?s=<StockID>.PA&f=s4l1t1c1ghov&e=.csv" + sCountryMarket(0,5) = "Code" + sCountryMarket(0,6) = "fr" + sCountryMarket(0,7) = "FR" + sCountryMarket(0,8) = "40C" + sCountryMarket(0,9) = "59/9" + sCountryMarket(0,10) = "1" + + sCountryMarket(1,0) = "Euro" + sCountryMarket(1,1) = chr(8364) + sCountryMarket(1,2) = "Milano" + sCountryMarket(1,3) = "http://it.finance.yahoo.com/d/quotes.csv?s=<StockID>.MI&f=sl1d1t1c1ohgv&e=.csv" + sCountryMarket(1,5) = "Codice" + sCountryMarket(1,6) = "it" + sCountryMarket(1,7) = "IT" + sCountryMarket(1,8) = "410" + sCountryMarket(1,9) = "44" + sCountryMarket(1,10) = "1" + + sCountryMarket(2,0) = "Euro" + sCountryMarket(2,1) = chr(8364) + sCountryMarket(2,2) = "Madrid" + sCountryMarket(2,3) = "http://es.finance.yahoo.com/d/quotes.csv?s=<StockID>&m=MC&f=sl1d1t1c1ohgv&e=.csv" + sCountryMarket(2,5) = "Simbolo" + sCountryMarket(2,6) = "es" + sCountryMarket(2,7) = "ES" + sCountryMarket(2,8) = "40A" + sCountryMarket(2,9) = "44" + sCountryMarket(2,10) = "1" + + sCountryMarket(3,0) = "Dansk krone" + sCountryMarket(3,1) = "kr" + sCountryMarket(3,2) = "København" + sCountryMarket(3,3) = "http://dk.finance.yahoo.com/d/quotes.csv?s=<StockID.CO&f=sl1d1t1c1ohgv&e=.csv" + sCountryMarket(3,5) = "Aktiesymbol" + sCountryMarket(3,6) = "da" + sCountryMarket(3,7) = "DK" + sCountryMarket(3,8) = "406" + sCountryMarket(3,9) = "44" + sCountryMarket(3,10) = "1" + + sCountryMarket(4,0) = "Svensk krona" + sCountryMarket(4,1) = "kr" + sCountryMarket(4,2) = "Stockholm" + sCountryMarket(4,3) = "http://se.finance.yahoo.com/d/quotes.csv?s=<StockID>.L&f=sl1d1t1c1ohgv&e=.c" + sCountryMarket(4,5) = "Kod" + sCountryMarket(4,6) = "sv" + sCountryMarket(4,7) = "SE" + sCountryMarket(4,8) = "41D" + sCountryMarket(4,9) = "44" + sCountryMarket(4,10) = "1" + + ' Taiwan Dollar + sCountryMarket(5,0) = "新臺幣" + sCountryMarket(5,1) = "¥" + sCountryMarket(5,2) = "代號" + sCountryMarket(5,3) = "http://tw.finance.yahoo.com/d/quotes.csv?s=<StockID>.TW&f=sl1d1t1c1ohgv&e=.csv" + sCountryMarket(5,5) = "代號" + sCountryMarket(5,6) = "zh" + sCountryMarket(5,7) = "TW" + sCountryMarket(5,8) = "404" + sCountryMarket(5,9) = "44" + sCountryMarket(5,10) = "1" + + ' Chinese Yuan + sCountryMarket(6,0) = "人民币" + sCountryMarket(6,1) = "¥" + sCountryMarket(6,2) = "代号" + sCountryMarket(6,3) = "http://cn.finance.yahoo.com/d/quotes.csv?s=<StockID>.SS&f=sl1d1t1c1ohgv&e=.csv" + sCountryMarket(6,5) = "代号" + sCountryMarket(6,6) = "zh" + sCountryMarket(6,7) = "CN" + sCountryMarket(6,8) = "804" + sCountryMarket(6,9) = "44" + sCountryMarket(6,10) = "1" + + ' korean Won + sCountryMarket(7,0) = "한국 원화" + sCountryMarket(7,1) = "₩" + sCountryMarket(7,2) = "서울" + sCountryMarket(7,3) = "http://kr.finance.yahoo.com/d/quotes.csv?s=<StockID>.KS&f=snl1d1t1c1ohgv&e=.csv" + sCountryMarket(7,5) = "종목 코드" + sCountryMarket(7,6) = "ko" + sCountryMarket(7,7) = "KR" + sCountryMarket(7,8) = "412" + sCountryMarket(7,9) = "44" + sCountryMarket(7,10) = "2" + + +' sCountryMarket(5,0) = "Российский рубль" +' sCountryMarket(5,1) = "р." +' sCountryMarket(5,2) = "" +' sCountryMarket(5,3) = "" +' sCountryMarket(5,5) = "" +' sCountryMarket(5,6) = "ru" +' sCountryMarket(5,7) = "RU" +' sCountryMarket(5,8) = "-419" +' sCountryMarket(5,9) = "" +' +' sCountryMarket(6,0) = "Złoty polski" +' sCountryMarket(6,1) = "zł" +' sCountryMarket(6,2) = "" +' sCountryMarket(6,3) = "" +' sCountryMarket(6,5) = "" 'Still Todo!! +' sCountryMarket(6,6) = "pl" +' sCountryMarket(6,7) = "PL" +' sCountryMarket(6,8) = "-415" +' sCountryMarket(6,9) = "" +' +' sCountryMarket(7,0) = "Türkische Lira" +' sCountryMarket(7,1) = "TL" +' sCountryMarket(7,2) = "" +' sCountryMarket(7,3) = "" +' sCountryMarket(7,5) = "" 'Still Todo!! +' sCountryMarket(7,6) = "tr" +' sCountryMarket(7,7) = "TR" +' sCountryMarket(7,8) = "-41F" +' sCountryMarket(7,9) = "" + + Dim n as Integer + Dim m as Integer +' Dim sCountryMarket(6,9) as String + + For n = 0 To Ubound(sCountryMarket(),1) + If sDocLanguage = sCountryMarket(n,6) and sDocCountry = sCountryMarket(n,7) Then + GlobListIndex = 6 + For m = 0 To 10 + sMarket(6,m) = sCountryMarket(n,m) + Next m + Exit For + End If + Next n + End If +End Sub + +Sub LoadDepotDialogs() + DlgTransaction = LoadDialog("Depot", "Dialog2") + DlgStockRates = LoadDialog("Depot", "Dialog3") + DlgStartUp = LoadDialog("Depot", "Dialog4") + TransactModel = DlgTransaction.Model + StockRatesModel = DlgStockRates.Model + StartUpModel = DlgStartUp.Model +End Sub + + +Sub InitializeStartUpModel() + With StartUpModel + .lblWelcome.Label = sStartupWelcome & Chr(13) & chr(13) & sStartUpChooseMarket + sStartUpHint = ReplaceString(sStartUpHint, sHistory, "<History>") + .lblHint.Label = sStartupHint +' .cmdGoOn.Enabled = Ubound(StartUpModel.lstMarkets.SelectedItems()) <> -1 + .cmdGoOn.Label = sOK + .cmdCancel.Label = sCancel + End With +End Sub</script:module> |