List of IDs of type IDType
List of IDs of type IDType
static IDTypeList alloc(int panelID = 0, int selection_type = 0)
Create a new empty ID list of type IDTypeList. If a valid panel ID is given, the list is filled with the requested object IDs. The list must again be deleted using idtypelist::release.
If you specify a \URL[panel ID] {../InDesign/Plugins/w2plugins.html#ClassID}, the function will only find the IDs of the found objects. If you need more information about the found objects, e.g. the URL of a publication, the objects must be determined using the function list::alloc. Using this list and the functions list::gettext, list::getint and list::getint require further object-specific data.Bei Angabe einer Palette-ID ermittelt die Funktion lediglich die IDs der gefundenen Objekte. Wenn Sie weitere Informationen über die gefundenenn Objekte benötigen, z.B. die URL einer Publikation, müssen die Objekte mit Hilfe der Funktion list::alloc ermittelt werden. Mit der so definierten Liste können mit Hilfe der Funktionen list::gettext, list::getint und list::getint weitere objekt-spezifische Daten erfragt werden.
Name | Type | Default | Description |
Return | IDTypeList | New IDTypeList. If a valid panel id is given, the list is filled with the requested object IDs. | |
panelID | int | - | Class ID of the panel The following panels are supported:
|
selection_type | int | kAll | kAll : All datasets of the panel kEyeMarked : Only the eye marked datasets of the panel kSelected : Selected panel entries only |
static int release(IDTypeList li, int releaseItems = 1)
Delete a list again that was created with idtypelist::alloc
Name | Type | Default | Description |
li | IDTypeList | - | List to be deleted |
releaseItems | int | 1 | Release lists objects too? 1 : Yes 0 : No, do not delete list items |
static int length(IDTypeList li)
Ascertain the number of elements of a list
Name | Type | Default | Description |
Return | int | Number of entries in the list | |
li | IDTypeList | - | List |
static IDType first(IDTypeList li)
Get the first non-empty entry record of a given string list
Name | Type | Default | Description |
Return | IDType | First value of the list. | |
li | IDTypeList | - | List with at least one element |
static IDType next(IDTypeList li)
Get the next record of a given list.
Name | Type | Default | Description |
Return | IDType | Next value of the list. | |
li | IDTypeList | - | List with at least one element after the current list pointer |
static IDType prev(IDTypeList li)
Get the previous record of a given list.
Name | Type | Default | Description |
Return | IDType | Preceding value in the list. | |
li | IDTypeList | - | List with at least one element after the current list pointer |
static IDType last(IDTypeList li)
Get the last non-empty record of a given list
Name | Type | Default | Description |
Return | IDType | Last value of the list. | |
li | IDTypeList | - | List with at least one element |
static int get_pos(
IDTypeList li,
IDType val,
int setPos = 0)
Search for the position of a value in the list. If the value is not found, the function returns -1. List positions are 0-based, the first element has the position 0, the final the position length-1.
Name | Type | Default | Description |
Return | int | >= 0 : First occurrence of a value in the list -1 : Value not found |
|
li | IDTypeList | - | List in which the value is to be search for |
val | IDType | - | This value is searched for |
setPos | int | 0 | 0 : Leave list positions unchanged 1 : Set current list position at the point of finding |
static int find(
IDTypeList li,
int val,
int setPos = 0)
Search for the position of a given ID1 in the list. If the ID1 is not found, the function returns -1. List positions are 0-based, the first element has the position 0, the final the position length-1.
In contrast to get_pos you don't have to know the whole ID but only its first value. The list can can be used as a simple key value mapping than.
The id1 values of the list must be unique!
Name | Type | Default | Description |
Return | int | >= 0 : First occurrence of a value in the list -1 : Value not found |
|
li | IDTypeList | - | List in which the value is to be search for |
val | int | - | This value is searched for |
setPos | int | 0 | 0 : Leave list positions unchanged 1 : Set current list position at the point of finding |
static int find_id2(
IDTypeList li,
int val,
int setPos = 0)
Search for the position of a given ID1 in the list. If the ID1 is not found, the function returns -1. The function will therefore not work for key value pairs with values equal -1. In this case use the function find!
The id1 values of the list must be unique!
Name | Type | Default | Description |
Return | int | >= 0 : First occurrence of a value in the list -1 : Value not found |
|
li | IDTypeList | - | List in which the value is to be search for |
val | int | - | This value is searched for |
setPos | int | 0 | 0 : Leave list positions unchanged 1 : Set current list position at the point of finding |
static IDType get(
IDTypeList li,
int pos,
int setPos= 0)
Get the i-th element of the list. List positions are 0-based, the first element has the position 0, the final the position length-1.
Name | Type | Default | Description |
Return | IDType | Value of the list at the position i or 0. | |
li | IDTypeList | - | List from which the element is to be fetched |
pos | int | - | 0-based list position |
setPos | int | 0 | 0 : Leave list positions unchanged 1 : Set current list position to pos |
static int append(IDTypeList li, IDType ID)
Append element to the list
Name | Type | Default | Description |
Return | int | appended object or 0 | |
li | IDTypeList | - | List to which the append is to be made |
⇨ Get the values for the new list entry from an IDType object | |||
ID | IDType | - | ID with the values for the object to be appened |
⇨ Get the values for the new list entry directly | |||
id1 | int | - | First number of new ID |
id2 | int | - | Second number of new ID |
id3 | int | - | Third number of new ID |
strid | String oder char* | - | String id of new ID |
static int insert(
IDTypeList li,
int pos,
IDType val)
Insert element into the list.
Name | Type | Default | Description |
Return | int | inserted object or 0 | |
li | IDTypeList | - | List to which the insert is to be made |
pos | int | - | 0-based index of insert < 0 or >= length : Append otherwise : Insert at this position |
⇨ Get the values for the new list entry from an IDType object | |||
ID | IDType | - | ID with the values for the object to be inserted |
⇨ Get the values for the new list entry directly | |||
id1 | int | - | First number of new ID |
id2 | int | - | Second number of new ID |
id3 | int | - | Third number of new ID |
strid | String oder char* | - | String id of new ID |
static int remove(IDTypeList li, IDType val)
Remove the given ID from the list. The given ID will not released. Only the first occurence of the object will be effected.
Name | Type | Default | Description |
Return | int | 1 : Action successful 0 : otherwise |
|
li | IDTypeList | - | List from which the remove is to be made |
val | IDType | - | Value which is to be removed from the list |
static IDType remove_pos(IDTypeList li, int pos)
Remove a position from the list. List positions are 0-based, the first element has the position 0, the final the position length-1. The removed object in not released automatically!
Name | Type | Default | Description |
Return | IDType | Removed object or 0 | |
li | IDTypeList | - | List |
pos | int | - | 0-based delete position |
id = idtypelist::remove_pos (0); if (id) idtype::release (id);
static int clear(IDTypeList li, int releaseItems = 1)
Remove all elements of the list
Name | Type | Default | Description |
Return | int | 1 : Action successful 0 : otherwise |
|
li | IDTypeList | - | List |
releaseItems | int | 1 | Release lists objects too? 1 : Yes 0 : No, do not delete list items |
int sort(
IDTypeList li,
int sortBy = 1,
int direction = 0)
Sort the list
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
li | IDTypeList | - | list to sort |
sortBy | int | 1 | Sort list by? 1 : ID 2 : ID2 3 : ID3 4 : StringID |
direction | int | 0 | Sort order 0 : ascent 2 : descent |
Create a list with three entries and sort it:
int wid (IDType id) { if (id) { wlog ("", " %d, %d, %d, '%s'\n", idtype::id (id), idtype::id2 (id), idtype::id3 (id), idtype::stringid (id)); }
return 0; }
int main () { IDTypeList li = idtypelist::alloc (); IDType id;
id = idtype::alloc (18, 3, 1962, "Tilly"); idtypelist::append (li, id); id = idtype::alloc (9, 4, 1963, "Bastel"); idtypelist::append (li, id); id = idtype::alloc (14, 1, 1961, "Matth"); idtypelist::append (li, id);
wlog ("", "unsoerted\n"); for (id = idtypelist::first (li); id; id = idtypelist::next (li)) wid (id);
idtypelist::sort (li, 1, 0); wlog ("", "sorted by id1\n"); for (id = idtypelist::first (li); id; id = idtypelist::next (li)) wid (id);
idtypelist::sort (li, 2, 0); wlog ("", "sorted by id2\n"); for (id = idtypelist::first (li); id; id = idtypelist::next (li)) wid (id);
idtypelist::sort (li, 4, 0); wlog ("", "sorted byh stringid\n"); for (id = idtypelist::first (li); id; id = idtypelist::next (li)) wid (id);
idtypelist::sort (li, 1, 1); wlog ("", "sorted descent by id1\n"); for (id = idtypelist::first (li); id; id = idtypelist::next (li)) wid (id);
idtypelist::sort (li, 2, 1); wlog ("", "sorted descent byid2\n"); for (id = idtypelist::first (li); id; id = idtypelist::next (li)) wid (id);
idtypelist::sort (li, 4, 1); wlog ("", "sorted descent bystringid\n"); for (id = idtypelist::first (li); id; id = idtypelist::next (li)) wid (id);
return 0; }
static IDTypeList get_from_panel(
IDTypeList li,
int panelID,
int selection_type = 0)
Fill the list with the requested IDs of the given panel.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
li | IDTypeList | - | allocated IDTypeList |
panelID | int | - | Class ID of the panel The following panels are supported:
|
selection_type | int | kAll | kAll : All datasets of the panel kEyeMarked : Only the eye marked datasets of the panel kSelected : Selected panel entries only |
static IDTypeList mark_in_panel(
int panelID,
IDTypeList li = 0,
int state = 1,
int type = -1L,
int isText = -1L,
int plid = -1L,
int pnum = -1L,
ItemRef frameRef = 0,
int inOverset = -1L,
int start = -1L,
int len = -1L)
Change the eye mark of panel entries.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
panelID | int | - | Class ID of the panel The following panels are supported:
|
li | IDTypeList | 0 | allocated IDTypeList 0 or empty : all entries of the panel |
state | int | 1 | 0 : remove marker 1 : set marker |
⇨ The following parameters are only used for ToDoList panel ((kPanelToDoList). Properties are "AND" checked. | |||
type | int | -1 | Object type -1 any 1 : database 2 : placeholder |
isText | int | -1 | Text or frame? -1 any 0 : frame 1 : text |
plid | int | -1 | Placeholder ID. If you want change the marker of multiple placeholder ID you must call the function multiple times. -1 : any |
pnum | int | -1 | Page number (1-based). If you want change the marker of multiple pages you must call the function multiple times. -1 : any |
frameRef | int | 0 | Valid frame reference. If you want change the marker of multiple frames you must call the function multiple times. 0 : any |
start, len | int, int | -1,0 | Text range. If you want change the marker of multiple ranges you must call the function multiple times. -1, 0 : any |
Mark all publications.
#include "internal/panels.h"
int main () { idtypelist::mark_in_panel (kPanelPublications, 0, 1);
return 0; }
Mark all products with a given ID.
#include "internal/panels.h"
int main () { IDTypeList li = idtypelist::alloc ();
idtypelist::append (li, 120, 1401, 1702, "abc'120");
idtypelist::mark_in_panel (kPanelProducts, 0, 0); idtypelist::mark_in_panel (kPanelProducts, li, 1);
return 0; }
Mark all changed placeholders intersecting a given text range of the current frame.
#include "internal/panels.h" int main () { IDTypeList li = idtypelist::alloc ();
idtypelist::mark_in_panel (kPanelToDoList, 0, 0); idtypelist::mark_in_panel (kPanelToDoList, 0, 1, -1, // type -1, // istext -1, // plid -1, // pnum gFrame, // frame -1, // isOverset 17, // start 29 // len );
return 0; }
static char* to_xml(IDTypeList list, char* rootElementName = "recordids")
Generate a XML structure of a IDTypeList object.
If you think about using this function, you might be interested in further information about cscript / java interaction. Related information can be found here.
Name | Type | Default | Description |
Return | char * | xml string or 0 on errors. The result string is valid until the next time a to_xml function is called and must not be changed or released. | |
list | IDTypeList | - object | |
rootElementName | String or char* | recordids | name of the root element |
static IDTypeList from_xml(char* xml)
Create a IDTypeList object from a xml structure.
If you think about using this function, you might be interested in further information about cscript / java interaction. Related information can be found here.
Name | Type | Default | Description |
Return | IDTypeList | object of type IDTypeList. This list must be released using idtypelist::release. | |
xml | String or char* | - | xml structure |
static int add_all(
IDTypeList target,
IDTypeList src,
int deleteFromSource)
Append all elements from list src to list target. If deleteFromSource is non-zero, all elements are removed from source list. (but not deleted)
Name | Type | Default | Description |
Return | int | 0 oder Fehlercode. | |
target | IDTypeList - | target list | |
src | IDTypeList - | source list | |
deleteFromSource | 0 | delete elements from source |
static int get_responsibles()
Get the list containing the names of the people who can be entered as responsible for a Comet Note. The list is not filled automatically by this call!
In this list, enter all the names of people responsible for Comet notes. Information on responsibilities for comet notes can be found here This applies to the entries in the list:
The list must not be deleted! The contents of the list are deleted automatically when the current data connection is closed.
Name | Type | Default | Description |
Return | IDTypeList | Valid list for names for Comet note responsibilities |
idtypelist::append (idtypelist::get_responsibles (), 1, 0, 0, "aaa"); idtypelist::append (idtypelist::get_responsibles (), 2, 0, 0, "bbb"); idtypelist::append (idtypelist::get_responsibles (), 3, 0, 0, "ccc"); idtypelist::append (idtypelist::get_responsibles (), 4, 1, 0, "Geneviève");
Alphabetic index HTML hierarchy of classes or Java