summaryrefslogtreecommitdiff
path: root/doc/api-documentation/man/man3/listkey.3
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api-documentation/man/man3/listkey.3')
-rw-r--r--doc/api-documentation/man/man3/listkey.3276
1 files changed, 276 insertions, 0 deletions
diff --git a/doc/api-documentation/man/man3/listkey.3 b/doc/api-documentation/man/man3/listkey.3
new file mode 100644
index 0000000..268654b
--- /dev/null
+++ b/doc/api-documentation/man/man3/listkey.3
@@ -0,0 +1,276 @@
+.TH "ListKey" 3 "5 Oct 2001" "The Sword Project" \" -*- nroff -*-
+.ad l
+.nh
+.SH NAME
+ListKey \- ListKey is the basis for all types of keys that have lists of specified indexes (e.g.
+.SH SYNOPSIS
+.br
+.PP
+\fC#include <listkey.h>\fR
+.PP
+Inherits \fBSWKey\fR.
+.PP
+.SS Public Methods
+
+.in +1c
+.ti -1c
+.RI "\fBListKey\fR (const char *ikey=0)"
+.br
+.RI "\fIinitializes instance of ListKey.\fR"
+.ti -1c
+.RI "\fBListKey\fR (ListKey const &k)"
+.br
+.ti -1c
+.RI "virtual \fB~ListKey\fR ()"
+.br
+.RI "\fIcleans up instance of ListKey.\fR"
+.ti -1c
+.RI "virtual \fBSWKey\fR* \fBclone\fR () const"
+.br
+.RI "\fIReturns a copy of this \fBSWKey\fR object.\fR"
+.ti -1c
+.RI "virtual void \fBClearList\fR ()"
+.br
+.RI "\fIClears out elements of list.\fR"
+.ti -1c
+.RI "virtual int \fBCount\fR ()"
+.br
+.RI "\fIReturns number of elements in list.\fR"
+.ti -1c
+.RI "virtual void \fBRemove\fR ()"
+.br
+.RI "\fIRemoves current element from list.\fR"
+.ti -1c
+.RI "virtual char \fBSetToElement\fR (int ielement, SW_POSITION=TOP)"
+.br
+.RI "\fISets key to element number.\fR"
+.ti -1c
+.RI "virtual \fBSWKey\fR* \fBGetElement\fR (int pos=-1)"
+.br
+.RI "\fIGets a key element number.\fR"
+.ti -1c
+.RI "ListKey& \fBoperator<<\fR (const \fBSWKey\fR &ikey)"
+.br
+.RI "\fIAdds an element to the list.\fR"
+.ti -1c
+.RI "virtual void \fBadd\fR (const \fBSWKey\fR &ikey)"
+.br
+.ti -1c
+.RI "virtual void \fBcopyFrom\fR (const ListKey &ikey)"
+.br
+.RI "\fIEquates this ListKey to another ListKey object.\fR"
+.ti -1c
+.RI "virtual void \fBcopyFrom\fR (const \fBSWKey\fR &ikey)"
+.br
+.RI "\fIEquates this \fBSWKey\fR to another \fBSWKey\fR object.\fR"
+.ti -1c
+.RI "virtual void \fBsetPosition\fR (SW_POSITION)"
+.br
+.RI "\fIPositions this key.\fR"
+.ti -1c
+.RI "virtual void \fBdecrement\fR (int step)"
+.br
+.RI "\fIDecrements a number of elements.\fR"
+.ti -1c
+.RI "virtual void \fBincrement\fR (int step)"
+.br
+.RI "\fIIncrements a number of elements.\fR"
+.ti -1c
+.RI "virtual char \fBTraversable\fR ()"
+.br
+.ti -1c
+.RI "virtual long \fBIndex\fR () const"
+.br
+.RI "\fIUse this function to get te current position withing a module.\fR"
+.ti -1c
+.RI "virtual long \fBIndex\fR (long index)"
+.br
+.RI "\fIReturns the index for the new one given as as parameter.\fR"
+.ti -1c
+.RI "SWKEY_OPERATORS ListKey& \fBoperator=\fR (const ListKey &key)"
+.br
+.in -1c
+.SS Protected Attributes
+
+.in +1c
+.ti -1c
+.RI "int \fBarraypos\fR"
+.br
+.ti -1c
+.RI "int \fBarraymax\fR"
+.br
+.ti -1c
+.RI "int \fBarraycnt\fR"
+.br
+.ti -1c
+.RI "\fBSWKey\fR** \fBarray\fR"
+.br
+.in -1c
+.SS Private Methods
+
+.in +1c
+.ti -1c
+.RI "void \fBinit\fR ()"
+.br
+.in -1c
+.SS Static Private Attributes
+
+.in +1c
+.ti -1c
+.RI "\fBSWClass\fR \fBclassdef\fR"
+.br
+.in -1c
+.SH DETAILED DESCRIPTION
+.PP
+ListKey is the basis for all types of keys that have lists of specified indexes (e.g.
+.PP
+a list of verses, place, etc.)
+.PP
+Definition at line 36 of file listkey.h.
+.SH CONSTRUCTOR & DESTRUCTOR DOCUMENTATION
+.PP
+.SS ListKey::ListKey (const char * ikey = 0)
+.PP
+initializes instance of ListKey.
+.PP
+\fBParameters: \fR
+.in +1c
+.TP
+\fB\fIikey\fR\fR
+text key
+.SH MEMBER FUNCTION DOCUMENTATION
+.PP
+.SS int ListKey::Count ()\fC [virtual]\fR
+.PP
+Returns number of elements in list.
+.PP
+\fBReturns: \fR
+.in +1c
+number of elements in list
+.SS \fBSWKey\fR * ListKey::GetElement (int pos = -1)\fC [virtual]\fR
+.PP
+Gets a key element number.
+.PP
+\fBParameters: \fR
+.in +1c
+.TP
+\fB\fIpos\fR\fR
+element number to get (or default current)
+.PP
+\fBReturns: \fR
+.in +1c
+Key or null on error
+.SS long ListKey::Index (long index)\fC [inline, virtual]\fR
+.PP
+Returns the index for the new one given as as parameter.
+.PP
+The first parameter is the new index.
+.PP
+Reimplemented from \fBSWKey\fR.
+.PP
+Definition at line 112 of file listkey.h.
+.SS long ListKey::Index () const\fC [inline, virtual]\fR
+.PP
+Use this function to get te current position withing a module.
+.PP
+Here's a small example how to use this function and \fBIndex\fR(long). This function uses the GerLut module and chooses a random verse from the Bible and returns it.
+.PP
+.nf
+ const char* randomVerse() {
+ VerseKey vk;
+ SWMgr mgr;
+ LocaleMgr::systemLocaleMgr.setDefaultLocaleName("de");
+
+ SWModule* module = mgr->Modules("GerLut");
+ srand( time(0) );
+ const double newIndex = (double(rand())/RAND_MAX)*(24108+8224);
+ vk.Index(newIndex);
+ module->SetKey(vk);
+
+ char* text;
+ sprintf(text, "%s: %s",(const char*)vk ,module->StripText(&vk));
+ return text;
+.fi
+
+.PP
+Reimplemented from \fBSWKey\fR.
+.PP
+Definition at line 106 of file listkey.h.
+.SS char ListKey::SetToElement (int ielement, SW_POSITION = TOP)\fC [virtual]\fR
+.PP
+Sets key to element number.
+.PP
+\fBParameters: \fR
+.in +1c
+.TP
+\fB\fIielement\fR\fR
+element number to set to
+.PP
+\fBReturns: \fR
+.in +1c
+error status
+.PP
+Referenced by Index().
+.SS virtual \fBSWKey\fR* ListKey::clone () const\fC [virtual]\fR
+.PP
+Returns a copy of this \fBSWKey\fR object.
+.PP
+This is useful to get a 1:1 copy of an \fBSWKey\fR based object.
+.PP
+\fBReturns: \fR
+.in +1c
+\fBSWKey\fR
+.PP
+Reimplemented from \fBSWKey\fR.
+.SS void ListKey::copyFrom (const \fBSWKey\fR & ikey)\fC [inline, virtual]\fR
+.PP
+Equates this \fBSWKey\fR to another \fBSWKey\fR object.
+.PP
+\fBParameters: \fR
+.in +1c
+.TP
+\fB\fIikey\fR\fR
+other swkey object
+.PP
+Reimplemented from \fBSWKey\fR.
+.PP
+Definition at line 90 of file listkey.h.
+.SS void ListKey::copyFrom (const ListKey & ikey)\fC [virtual]\fR
+.PP
+Equates this ListKey to another ListKey object.
+.PP
+\fBParameters: \fR
+.in +1c
+.TP
+\fB\fIikey\fR\fR
+other ListKey object
+.SS ListKey & ListKey::operator<< (const \fBSWKey\fR & ikey)\fC [inline]\fR
+.PP
+Adds an element to the list.
+.PP
+\fBParameters: \fR
+.in +1c
+.TP
+\fB\fIikey\fR\fR
+the element to add
+.PP
+Definition at line 82 of file listkey.h.
+.SS void ListKey::setPosition (SW_POSITION)\fC [virtual]\fR
+.PP
+Positions this key.
+.PP
+\fBParameters: \fR
+.in +1c
+.TP
+\fB\fIp\fR\fR
+position
+.PP
+\fBReturns: \fR
+.in +1c
+*this
+.PP
+Reimplemented from \fBSWKey\fR.
+
+.SH AUTHOR
+.PP
+Generated automatically by Doxygen for The Sword Project from the source code. \ No newline at end of file