Барномасозии Васлак дар LibreOffice Calc
Методи мукаммалкунии Calc Бо васлак, ки дар ин ҷой оварда шудааст кӯҳна мебошад. Интерфейсҳо ҳоло ҳам кор мекунанд ба хотири мувофиқат ба гузашта, вале барои барномасозии Васлакҳои нав шумо бояд Функтсияҳои APIро истифода баред.
Ба LibreOffice Calc бо ёрии васлакҳо имкониятҳои нав ворид сохтан мумкин аст. Ин дар Ёвари Функтсия дар категорияи Васлак оварда шудааст. Агар шумо хоҳиш кунед барномасозиро ёд гиред, дар ин ҷой метавонед омӯзед, ки кадом функтсияҳо бояд экспорт карда шаванд бо китобхонаи байнӣ DLL-и беруна то, ки васлак бомуваффақият насб шавад.
LibreOffice дар равоқи Васлакҳо ба китобхонаи байнӣ DLL-и мувофиқ ҷустуҷӯ мекунад. Барои шинохт будан бо LibreOffice, китобхонаи байнӣ DLL бояд хосиятҳои зарурӣ дошта бошад. Ин маълумот ба шумо кӯмак мекунад барои сохтани Васлак дар Ёвари функтсияҳо-и LibreOffice Calc.
Консептсияи Васлак
Ҳар як китобхонаи Васлак якчанд функтсия дорад. ,Баъзе функтсияҳо барои идоракунӣ мебошанд. Шумо метавонед қариб тамони номро барои васлакатон истифода кунед. Ба ҳар ҳол онҳо бояд чанд қоидаро риоя кунанд. Номгузорӣ дар ҳар платформа дигар хел мебошад.
Функтсияҳои китобхонаи байнӣ DLL-и васлак
Ҳадди ақал функтсияҳои административии GetFunctionCount and GetFunctionData вуҷуд дошта бошанд. Бо ин васила функтсияҳо, параметрҳои онҳо муайян карда мешавад. Арзиши баргардандаи Double ва String дастгири шудааст. Ҳамчун параметр, диапазони чашмак массиви Double , массиви String , and массиви Чашмак дастгири шудаанд.
Параметрҳо ба воситаи ҳаволаҳо гузошта мешаванд. Вале, ин дар LibreOffice Calc дастгирӣ нашудааст.
Китобхонаҳо дар вақти иҷроиш бор карда шуда ва бо функтсияҳои административӣ тафтиш карда мешаванд.
Функтсияҳо синхронӣ даъвад шуда натиҷаашон маълум мегарданд. Функтсияҳои асихронӣ низ имкон доранд; вале онҳо муфассал шарҳ дода нашудаанд аз сабаби мураккабӣ.
Маълумоти умумӣ оиди интерфейс
Шумораи максималии параметрҳо дар LibreOffice Calc 16 аст: як параметри баргардонӣ ва то 15 параметри дохилкунӣ.
Типи далелҳо:
Типи далелҳо |
Шарҳ |
CALLTYPE |
Дар Windows: FAR PASCAL (_far _pascal) Дигар: аслӣ (operating system specific default) |
USHORT |
2 Byte unsigned Integer |
DOUBLE |
8 byte platform-dependent format |
Paramtype |
Platform-dependent like int PTR_DOUBLE =0 pointer to a double PTR_STRING =1 pointer to a zero-terminated string PTR_DOUBLE_ARR =2 pointer to a double array PTR_STRING_ARR =3 pointer to a string array PTR_CELL_ARR =4 pointer to a cell array NONE =5 |
Функтсияҳои Shared Library DLL
Дар зер шумо шарҳи ин функтсияҳоро мебинед, ки дар Shared Library external DLL даъват карда мешаванд.
Барои ҳама функтсияҳоиShared Library DLL зерин таалуқ дорад:
void CALLTYPE fn(out, in1, in2, ...)
Output: Resulting value
Input: Ягон рақами (double&, char*, double*, char**, Cell area), ҳангоми Cell area массиви double array, string array, or cell array аст.
GetFunctionCount()
Шумораи функтсияҳоро ба ғайр аз функтсияҳои административии параметри шаволашуда. Ҳар як функтсия рақами ягона аз 0 то nCount-1 дорад. Ин рақам лозим аст барои функтсияҳои GetFunctionData ва GetParameterDescription.
Синтаксис
void CALLTYPE GetFunctionCount(USHORT& nCount)
Параметр
USHORT &nCount:
Output: Ҳавола ба тағирёбандае, ки шумораи функтсияҳои васлакро дорад. Мисол: Агар васлак 5 функтсияҳо барои LibreOffice Calc дошта бошад, пас nCount=5.
GetFunctionData()
Ҳама маълумоти муҳимро оиди васлак муайян мекунад.
Синтаксис
void CALLTYPE GetFunctionData(USHORT& nNo, char* pFuncName, USHORT& nParamCount, Paramtype* peType, char* pInternalName)
Параметр
USHORT& nNo:
Input: Рақаме аз 0 то nCount-1.
char* pFuncName:
Output: Номи функтсия чӣ тавре, ки барномапардоз мебинад дар Shared Library DLL. Ин ном ба номи дар Ёвари функтсия мувофиқ нест.
USHORT& nParamCount:
Output: Шумораи парметрҳо дар функтсия. Ин рақам бояд зиёд аз 0 бошад, зеро кӣ ҳамеша арзише баргардонида мешавад; максимум 16.
Paramtype* peType:
Output: Ҳавола ба массиви 16 арзиши Paramtype. Аввалин навиштҳои nParamCount бо параметрҳои мувофиқ пур мешаванд.
char* pInternalName:
Output: Номи функтсияҳо чӣ тавре, ки дар Ёвари функтсия дида мешаванд.
Параметрҳои pFuncName ва pInternalName char arrays мебошанд, ки андозаи 256 ро дар LibreOffice Calc доранд.
GetParameterDescription()
Шарҳи мухтасари васлак ва функтсияҳои онро дорад. Ин функтсия барои нишондиҳии параметрҳо дар Ёвари Функтсия истифода мешавад.
Синтаксис
void CALLTYPE GetParameterDescription(USHORT& nNo, USHORT& nParam, char* pName, char* pDesc)
Параметр
USHORT& nNo:
Input: Шумораи функтсияҳо дар китобхона; миёни 0 ва nCount-1.
USHORT& nParam:
Input: Indicates, for which parameter the description is provided; parameters start at 1. If nParam is 0, the description itself is supposed to be provided in pDesc; in this case, pName does not have any meaning.
char* pName:
Output: Takes up the parameter name or type, for example, the word "Number" or "String" or "Date", and so on. Implemented in LibreOffice Calc as char[256].
char* pDesc:
Output: Takes up the description of the parameter, for example, "Value, at which the universe is to be calculated." Implemented in LibreOffice Calc as char[256].
pName and pDesc are char arrays; implemented in LibreOffice Calc with size 256. Please note that the space available in the Function Wizard is limited and that the 256 characters cannot be fully used.
Cell areas
The following tables contain information about which data structures must be provided by an external program module in order to pass cell areas. LibreOffice Calc distinguishes between three different arrays, depending on the data type.
Double Array
As a parameter, a cell area with values of the Number/Double type can be passed. A double array in LibreOffice Calc is defined as follows:
Эффект |
Намуна: |
Шарҳ |
0 |
Стн |
Column number in the upper-left corner of the cell area. Numbering starts at 0. |
2 |
Сатр |
Row number in the upper-left corner of the cell area; numbering starts at 0. |
4 |
Табуляр |
Table number in the upper-left corner of the cell area; numbering starts at 0. |
6 |
Стн |
Column number in the lower-right corner of the cell area. Numbering starts at 0. |
8 |
Сатр |
Row number in the lower-right corner of the cell area; numbering starts at 0. |
10 |
Табуляр |
Table number in the lower-right corner of the cell area; numbering starts at 0. |
12 |
Шумора |
Number of the following elements. Empty cells are not counted or passed. |
14 |
Стн |
Column number of the element. Numbering starts at 0. |
16 |
Сатр |
Row number of the element; numbering starts at 0. |
18 |
Табуляр |
Table number of the element; numbering starts at 0. |
20 |
Хатогӣ |
Error number, where the value 0 is defined as "no error." If the element comes from a formula cell the error value is determined by the formula. |
22 |
Арзиш |
8 byte IEEE variable of type double/floating point |
30 |
... |
Next element |
String Array
A cell area, which contains values of data type Text and is passed as a string array. A string array in LibreOffice Calc is defined as follows:
Эффект |
Намуна: |
Шарҳ |
0 |
Стн |
Column number in the upper-left corner of the cell area. Numbering starts at 0. |
2 |
Сатр |
Row number in the upper-left corner of the cell area; numbering starts at 0. |
4 |
Табуляр |
Table number in the upper-left corner of the cell area; numbering starts at 0. |
6 |
Стн |
Column number in the lower-right corner of the cell area. Numbering starts at 0. |
8 |
Сатр |
Row number in the lower-right corner of the cell area; numbering starts at 0. |
10 |
Табуляр |
Table number in the lower-right corner of the cell area; numbering starts at 0. |
12 |
Шумора |
Number of the following elements. Empty cells are not counted or passed. |
14 |
Стн |
Column number of the element. Numbering starts at 0. |
16 |
Сатр |
Row number of the element; numbering starts at 0. |
18 |
Табуляр |
Table number of the element; numbering starts at 0. |
20 |
Хатогӣ |
Error number, where the value 0 is defined as "no error." If the element comes from a formula cell the error value is determined by the formula. |
22 |
Len |
Length of the following string, including closing zero byte. If the length including closing zero byte equals an odd value a second zero byte is added to the string so that an even value is achieved. Therefore, Len is calculated using ((StrLen+2)&~1). |
24 |
Сатрҳо |
String with closing zero byte |
24+Len |
... |
Next element |
Cell Array
Cell arrays are used to call cell areas containing text as well as numbers. A cell array in LibreOffice Calc is defined as follows:
Эффект |
Намуна: |
Шарҳ |
0 |
Стн |
Column number in the upper-left corner of the cell area. Numbering starts at 0. |
2 |
Сатр |
Row number in the upper-left corner of the cell area; numbering starts at 0. |
4 |
Табуляр |
Table number in the upper-left corner of the cell area; numbering starts at 0. |
6 |
Стн |
Column number in the lower-right corner of the cell area. Numbering starts at 0. |
8 |
Сатр |
Row number in the lower-right corner of the cell area; numbering starts at 0. |
10 |
Табуляр |
Table number in the lower-right corner of the cell area; numbering starts at 0. |
12 |
Шумора |
Number of the following elements. Empty cells are not counted or passed. |
14 |
Стн |
Column number of the element. Numbering starts at 0. |
16 |
Сатр |
Row number of the element; numbering starts at 0. |
18 |
Табуляр |
Table number of the element; numbering starts at 0. |
20 |
Хатогӣ |
Error number, where the value 0 is defined as "no error." If the element comes from a formula cell the error value is determined by the formula. |
22 |
Тип |
Type of cell content, 0 == Double, 1 == String |
24 |
Value or Len |
If type == 0: 8 byte IEEE variable of type double/floating point If type == 1: Length of the following string, including closing zero byte. If the length including closing zero byte equals an odd value a second zero byte is added to the string so that an even value is achieved. Therefore, Len is calculated using ((StrLen+2)&~1). |
26 if type==1 |
Сатрҳо |
If type == 1: String with closing zero byte |
32 or 26+Len |
... |
Next element |