QDumontDLL Class Reference

DumontDLL Main Object Interface. More...

#include <DumontDLL.h>

Inheritance diagram for QDumontDLL:

Inheritance graph

List of all members.

Public Slots

void test (void)
void test (QString v1, QString v2, QString v3)
void test (QString v1, int v2, QString v3)
void test (QString v1, QString v2, QString v3, QString v4)
QDumontTestgetTest (void)
bool tcpStartServer (long port)
 Start Dumont TCP Server.
bool tcpConnectToServer (const QString &hostAddress, long port)
QString tcpRequest (const QString &request)
 Send TCP Request.
QString spellCheck (const QString &text, const QString &dictionary="C:/Commence/Dumont/en_GB.dic")
 Spell Check Some Text.
QString textEdit (const QString &text, const QString &title="", const QString &prompt="", const QString &dictionary="C:/Commence/Dumont/en_GB.dic")
QString inputBox (const QString prompt="", const QString title="", const QString dval="")
QString fileOpenDialog (const QString &caption="", const QString &dir="", const QString &filter="")
 Present a File-Open dialog to the user.
QMultiDateDialogmultiDateDialog (const QString &i_mdd="", const QString &i_defaultDate="")
void multiDateDialogExec (const QString &i_mdd="", const QString &i_defaultDate="")
QString randomKey (int length=4)
QString version (void)
 return current version number
bool updateIsAvailable (void)
 Check Dumont Source Server for program updates.
long AddLock (void)
 Add a DumontDLL instance lock.
long DelLock (void)
 Remove a DumontDLL instance lock.
long LockCount (void)
 Get the current lock count.
void dumpObject (QCocDispatch *i_object)
 dump the interface of an object to the console
void debugSave (QString i_filename)
 Save the contents of the debug window to a file.
void secretAgentEvent (void)
 Execute an Agent Event.
void addAgentMission (QString i_missionName, long i_fireIn=2000)
 Add an agent mission to the queue to be processed on the next cycle.
QCommenceFormform (QCocDispatch *i_form)
 Get the Form object wrapper.
long formCount (void)
 Forms Collection Count.
QCommenceFormform (long i_form)
 Return a form from the collection.
QCommenceFormpreviousForm ()
 Return the previous form.
QCommenceDatabasedatabase (QCocDispatch *i_database)
 Set the Form.Application object.
bool start (QCommenceForm *form)
bool start (QCocDispatch *i_application, const QString &dumCategory="")
 Start an Application.
void stop (void)
 Let Dumont know the application is stopping.
QString dq (QString i_value)
 Double Quote something.
QString prependZero (QString i_value, long i_count)
 Put zeros in front of something.
QString fixCase (QString i_value)
 Fix the case of a name field.
QString fixPhone (QString i_value)
 Fix the punctuation of a phone field.
bool phoneTooShort (void)
 Return if Phone Number was too short.
void delay (int i_value)
 Delay for a period of time.
void debugClear (void)
 Invoke the debugger.
void debug (QString i_value)
void debug (long i_value)
void debug (double i_value)
void debug (const char *i_value)
void debug (bool i_value)
QString textFile (QString i_fileName)
 Read some text from a file.
void textFile (QString i_fileName, QString i_data)
 Write some text to a file.
void appendTextFile (QString i_fileName, QString i_data)
 Append some text to a file.
void deleteFile (QString i_fileName)
 Delete a file.
void copyFile (QString i_fileName, QString i_newName)
 Copy a file.
void renameFile (QString i_fileName, QString i_newName)
 Rename a file.
long fileSize (QString i_fileName)
 Return the file size.
void log (QString i_fileName, QString i_sourceFile, QString i_logLine)
bool checkCreateDirectory (QString i_fileName)
void changeLog (QString i_logName, QString i_logHistory, QString i_itemTHID)
QString var (QString i_var, QString i_item)
QString var (QString i_var, QString i_item, QString i_value)
QString delVar (QString i_var, QString i_item)
QString cliptext (void)
 Get Text from the Clipboard.
void cliptext (QString i_value)
 Put Text to the Clipboard.
QString formatText (QString i_preText, QString i_text, QString i_postText)
QString formatOLtext (QString i_text)
QString formatOLurl (QString i_url)
QString formatOLdate (QDateTime dateTimeIn)
QString guid (void)
QString formatOLics (QString i_organizerEmail, QString i_summary, QDateTime i_dateStart, QDateTime i_dateEnd, QString i_location, QString i_uID, QString i_desc)
QString dateTimeStamp ()
 Return the current Date and Time stamp.
QString packDate (QDate i_date)
QString packDate (QDateTime i_dateTime)
QString packTime (QTime i_time)
QString packTime (QDateTime i_dateTime)
QString packDateTime (QDateTime i_dateTime)
QDate unpackDate (QString i_date)
QTime unpackTime (QString i_time)
QDateTime unpackDateTime (QString i_dateTime)
void dumpString (QString i_string)
 Dump a string binary to debug.
double fuzzy (double i_high, double i_low, double i_value)
 Perform a fuzzy-logic calculation.
QString selectItem (QString itemList, QString windowTitle="Pick an Item", bool multiSelect=false)
 Select an Item from a list of Items.
void fireAgent (const QString &options, const QString &itemName, const QString &agentName, const QStringList &itemList)
bool processMultiDates (const QString &mddNewCode, const QString &mddOriginalCode, const QString &mappingItemName)

Public Member Functions

 QDumontDLL (QObject *parent)
virtual ~QDumontDLL ()

Private Attributes

bool m_phoneTooShort
QDumontCommenceForms m_forms
QTimer * m_secretAgentTimer
QStringList * m_secretAgentMissions
QPointer< QMultiDateDialogm_mdd
QString m_mddCode
QString m_mddDate

Detailed Description

DumontDLL Main Object Interface.


This is the beef in the DumontDLL scripting extension. This object holds all of the Dumont processing code. When new functionality is added to Dumont the code is added here first, because this is the first interface that the vbScript program sees.

This object is written in straight Qt/C++, meaning it is intended to be used directly in a Qt/C++ application. The vbScript COM automation interface is implemented in a separate file.

Definition at line 1712 of file DumontDLL.h.

Constructor & Destructor Documentation

QDumontDLL::QDumontDLL ( QObject *  parent  ) 

The constructor initializes the environment for the first application.

Definition at line 108 of file DumontDLL.cpp.

QDumontDLL::~QDumontDLL (  )  [virtual]

Definition at line 164 of file DumontDLL.cpp.

Member Function Documentation

void QDumontDLL::addAgentMission ( QString  i_missionName,
long  i_fireIn = 2000 
) [slot]

Add an agent mission to the queue to be processed on the next cycle.

At present, agent missions are defined by a simple string.

i_missionName Mission Name String
i_fireIn Agent Fire Timer

Definition at line 501 of file DumontDLL.cpp.

long QDumontDLL::AddLock ( void   )  [slot]

Add a DumontDLL instance lock.

Since the DumontDLL is an external script assistant, loading it into script (application) memory takes time. Furthermore, dumont can provide various instance-wide functions such as storing temporary data between forms and whatnot.

Howver, in order to save loading time of the DumontDLL for every script launch and to be able to accomplish some of the instance-persistant functions the DumontDLL must be locked into application memory to prevent it from being automatically unloaded after the calling form script closes. This locking action is accomplished by making a call to AddLock(). Usually, this action is performed on database startup from a form that is loaded by an agent when the database is first opened:

Application Start-up Form vbScript Example
 dim ddll: set ddll = CreateObject("DumontDLL") ' load dumont into memory
 ddll.AddLock                                   ' add a lock to prevent dumont from being unloaded
 ddll.SetApplication Application                ' let dumont know about the application object
 cancel                                         ' cancel the form without saving
The best way to start this script is to create an agent to cause the special form to be loaded:

Application Start-up Agent Definition (typical)
 If this trigger occurs:
  Commence Event: Commence Starts
 then perform these actions:
  Add Item
   Category: Dumont
   Display Items: Checked
   Form: DumontStart
Once the DumontDLL is locked into application memory it can perform special monitoring and control enhancement functions over the database. Also, if any of the var functions are to be used, TempVar(), LocalVar() UserVar() or GlobalVar() then the DumontDLL really should be locked into application memory using some method similar to the above.

The AddLock() function can be called multiple times to add additional locks (they are addative). For each call to AddLock() there should be a corresponding call to DelLock(). However, if DelLock() is not called, the DumontDLL will be unloaded on application shutdown anyhow (when the .exe closes).
See also:
DelLock, SetApplication

Definition at line 195 of file DumontDLL.cpp.

void QDumontDLL::appendTextFile ( QString  i_fileName,
QString  i_data 
) [slot]

Append some text to a file.

Definition at line 1005 of file DumontDLL.cpp.

void QDumontDLL::changeLog ( QString  i_logName,
QString  i_logHistory,
QString  i_itemTHID 
) [slot]

Definition at line 1064 of file DumontDLL.cpp.

bool QDumontDLL::checkCreateDirectory ( QString  i_fileName  )  [slot]

Definition at line 1051 of file DumontDLL.cpp.

void QDumontDLL::cliptext ( QString  i_value  )  [slot]

Put Text to the Clipboard.

This takes text from the caller and pastes it up to the global clipboard.

Definition at line 1175 of file DumontDLL.cpp.

QString QDumontDLL::cliptext ( void   )  [slot]

Get Text from the Clipboard.

This copies text from the windows-clipboard back to the caller.

Definition at line 1170 of file DumontDLL.cpp.

void QDumontDLL::copyFile ( QString  i_fileName,
QString  i_newName 
) [slot]

Copy a file.

Definition at line 1019 of file DumontDLL.cpp.

QCommenceDatabase * QDumontDLL::database ( QCocDispatch i_database  )  [slot]

Set the Form.Application object.

This function is used to inform Dumont about this specific instance of this application. This is usually accomplished inside of a Form vbScript when the script has access to the application object. The purpose for setting the application object in the DumontDLL is to insure that the DumontDLL can access the correct instance of Commence for its database functions.

See also:
AddLock, DelLock, SetForm
Return a wrapped database object This takes a database object pointer from the caller and wraps a QCommenceDatabase object around it.

Definition at line 547 of file DumontDLL.cpp.

QString QDumontDLL::dateTimeStamp (  )  [slot]

Return the current Date and Time stamp.

This method returns a packed date/time string formatted as follows:


This string is handy when trying to provide a unique ID for a key field, and you want one based upon the current date and time. Often this is used in the following code:

 Sub Form_OnSave()
   ' Stamp the key field with a value that will tell us "when"
   '  this item was created, and by whom.  The result should look
   '  something like: "20080110121432MWP"
   dfrm.keyField.value = ddll.dateTimeStamp & dfrm.meInfo.abbreviation

By embedding the users abbreviation (often his initials), it is next to impossible that a single user is going to create two items at precisely the same second. However, it is possible that two different users will create an item at precisely the same second, so by embedding the users abbreviation into the field value pretty much insures that this keyfield value will be unique.

See also:
QCommenceForm::keyField, QCommenceForm::meInfo, QCommenceMeInfo::abbreviation

Definition at line 1130 of file DumontDLL.cpp.

void QDumontDLL::debug ( bool  i_value  )  [inline, slot]

Definition at line 2167 of file DumontDLL.h.

void QDumontDLL::debug ( const char *  i_value  )  [inline, slot]

Definition at line 2166 of file DumontDLL.h.

void QDumontDLL::debug ( double  i_value  )  [inline, slot]

Definition at line 2165 of file DumontDLL.h.

void QDumontDLL::debug ( long  i_value  )  [inline, slot]

Definition at line 2164 of file DumontDLL.h.

void QDumontDLL::debug ( QString  i_value  )  [slot]

Definition at line 986 of file DumontDLL.cpp.

void QDumontDLL::debugClear ( void   )  [slot]

Invoke the debugger.

This causes a special debugging text window to open and be filled with the message value provided. The message window will stay open as long as the DumontDLL is loaded in memory (see lock-persistence). Sending messages to the debug window has not functional impact over the operation of the DumontDLL other than to cause the window to be displayed.

Definition at line 541 of file DumontDLL.cpp.

void QDumontDLL::debugSave ( QString  i_filename  )  [slot]

Save the contents of the debug window to a file.

Definition at line 526 of file DumontDLL.cpp.

void QDumontDLL::delay ( int  i_value  )  [slot]

Delay for a period of time.

This will cause the Script to delay for the specified number of milliseconds.

Definition at line 981 of file DumontDLL.cpp.

void QDumontDLL::deleteFile ( QString  i_fileName  )  [slot]

Delete a file.

Definition at line 1012 of file DumontDLL.cpp.

long QDumontDLL::DelLock ( void   )  [slot]

Remove a DumontDLL instance lock.

This releases a lock that was previously applied to the DumontDLL using AddLock(). If there are no locks present (lock-count is zero) then this function does nothing.

See also:
AddLock, SetApplication

Definition at line 201 of file DumontDLL.cpp.

QString QDumontDLL::delVar ( QString  i_var,
QString  i_item 
) [slot]

Definition at line 1079 of file DumontDLL.cpp.

QString QDumontDLL::dq ( QString  i_value  )  [slot]

Double Quote something.

Definition at line 956 of file DumontDLL.cpp.

void QDumontDLL::dumpObject ( QCocDispatch i_object  )  [slot]

dump the interface of an object to the console

Definition at line 513 of file DumontDLL.cpp.

void QDumontDLL::dumpString ( QString  i_string  )  [inline, slot]

Dump a string binary to debug.

This takes an input string and dumps it to the debug window in a ascii/binary form that makes it possible to examine the internals of the string. This is useful for doing things like determining the contents of a string, including non-printable imbedded characters like vbCrLf.

Example Output
   dumDLL.dumpString dumFRM.toXml("*")

 0000: 3c 21 44 4f 43 54 59 50 45 20 51 43 6f 6d 6d 65  <!DOCTYPE QComme
 0010: 6e 63 65 46 6f 72 6d 3e 0d 0a 3c 69 74 65 6d 20  nceForm>..<item 
 0020: 66 6f 72 6d 4e 61 6d 65 3d 22 44 75 6d 6f 6e 74  formName="Dumont
 0030: 22 20 63 61 74 65 67 6f 72 79 4e 61 6d 65 3d 22  " categoryName="
 0040: 44 75 6d 6f 6e 74 22 20 69 74 65 6d 4e 61 6d 65  Dumont" itemName
 0050: 3d 22 74 65 73 74 22 20 69 74 65 6d 43 6c 61 72  ="test" itemClar
 0060: 69 66 79 3d 22 22 20 3e 0d 0a 20 20 20 3c 66 69  ify="" >..   <fi
 0070: 65 6c 64 30 20 6e 61 6d 65 3d 22 4e 61 6d 65 22  eld0 name="Name"
 0080: 20 3e 74 65 73 74 3c 2f 66 69 65 6c 64 30 3e 0d   >test</field0>.
 0090: 0a 20 20 20 3c 66 69 65 6c 64 31 20 6e 61 6d 65  .   <field1 name

Definition at line 2423 of file DumontDLL.h.

QString QDumontDLL::fileOpenDialog ( const QString &  caption = "",
const QString &  dir = "",
const QString &  filter = "" 
) [slot]

Present a File-Open dialog to the user.

This feature has been provided in Dumont to deal with the lack of FileOpen in the Vista operating system. It does not model the "UserAccounts.CommonDialog" interface, and probably never will, but its interface is pretty simple. The Dialog Window is based upon the Qt FileOpen dialog window found on the http://doc.trolltech.com/4.3/qfiledialog.html website.

Normally, in Qt, file and folder paths are handled with "/" (forward slash) characters. This is common in the Linux world. However, this is somewhat incompatible with windows, since windows employs the "\" (back slash) character when dealing with file and folder paths. Therefore, this routine has been modified to change all incoming "\" characters to "/" before employing the dialog, and then change all "/" characters from the dialog back into "\" characters for the caller. This should simplify employing this dialog in windows based applications that are expecting the "\" character.

In its simplest form, the Dialog returns the string of the full-path to the selected file. If the user presses 'cancel', an empty string is returned.

vbScript Example
 sub SelectTheFile()
   dim ddll: set ddll = createObject("DumontDLL")
   dim selectedFile
       selectedFile = ddll.fileOpenDialog( _
        "Pick a File", _
        "C:\Documents and Settings\mark\My Documents", _
        "Docs (*.doc;*.wpd)" )
   if( selectedFile = "" ) then
     msgbox "no file was selected"
     msgbox "you selected the file: " & selectedFile
   end if
 end sub

When calling this function, note that the Commence 'detail form' is is *not* modal. This could be a potential problem if the user closes the detail form before closing this FileOpen dialog either by 'cancel' or 'open'. If the user does first close the detail form without properly acknowledging this dialog window, then Commence will simply crash.
caption The Caption to be placed in the Dialog Window
dir The Initial Directory for the Dialog Window
filter The Filter to be applied to the Dialog (insert documentation here)

Definition at line 214 of file DumontDLL.cpp.

long QDumontDLL::fileSize ( QString  i_fileName  )  [slot]

Return the file size.

Definition at line 1031 of file DumontDLL.cpp.

void QDumontDLL::fireAgent ( const QString &  options,
const QString &  itemName,
const QString &  agentName,
const QStringList &  itemList 
) [slot]

Definition at line 1318 of file DumontDLL.cpp.

QString QDumontDLL::fixCase ( QString  i_value  )  [slot]

Fix the case of a name field.

This function takes a string argument and applies name-case encoding. This turns typed text "joe schmoe" and "jOE m. SCHmoe" into "Joe Schmoe" and "Joe M. Schmoe".

Definition at line 966 of file DumontDLL.cpp.

QString QDumontDLL::fixPhone ( QString  i_value  )  [slot]

Fix the punctuation of a phone field.

This function takes a string argument and applies phone-format encoding. This turns typed text "(213) 555.1212" and "1-213 123--1234" into "213-555-1212" and "213-123-1234", basically cleaning up typos in phone numbers and insuring that all phone numbers meet this standard.

Definition at line 971 of file DumontDLL.cpp.

QCommenceForm* QDumontDLL::form ( long  i_form  )  [inline, slot]

Return a form from the collection.

This will return a form instance from the forms collection. It references the form by its index number.

Definition at line 2034 of file DumontDLL.h.

QCommenceForm * QDumontDLL::form ( QCocDispatch i_form  )  [slot]

Get the Form object wrapper.

This takes a standard Commence form and wraps it with a Dumont QCommenceForm object. The QCommenceForm mimicks a standard Commence form with a few added features. The actual "type" of QCommenceForm that will be returned will depend upon the category in question. Certain categories will receive specialization forms, such as the Calendar, Person, Company and so on. These specialization forms include additional methods and functionality that cause the form to behave properly for its intended function.

See also:
QCommenceForm QCommenceCalendarForm QCommencePersonForm QCommenceCompanyForm

Definition at line 636 of file DumontDLL.cpp.

QString QDumontDLL::formatOLdate ( QDateTime  dateTimeIn  )  [slot]

Definition at line 1099 of file DumontDLL.cpp.

QString QDumontDLL::formatOLics ( QString  i_organizerEmail,
QString  i_summary,
QDateTime  i_dateStart,
QDateTime  i_dateEnd,
QString  i_location,
QString  i_uID,
QString  i_desc 
) [slot]

Definition at line 1110 of file DumontDLL.cpp.

QString QDumontDLL::formatOLtext ( QString  i_text  )  [slot]

Definition at line 1091 of file DumontDLL.cpp.

QString QDumontDLL::formatOLurl ( QString  i_url  )  [slot]

Definition at line 1124 of file DumontDLL.cpp.

QString QDumontDLL::formatText ( QString  i_preText,
QString  i_text,
QString  i_postText 
) [slot]

Definition at line 1084 of file DumontDLL.cpp.

long QDumontDLL::formCount ( void   )  [inline, slot]

Forms Collection Count.

This returns a count for Open forms. As each form is opened and wrapped with the Dumont.Form object it also gets registered in this collection.

Definition at line 2025 of file DumontDLL.h.

double QDumontDLL::fuzzy ( double  i_high,
double  i_low,
double  i_value 
) [slot]

Perform a fuzzy-logic calculation.

This routine takes a series of numbers and produces a fuzzy boolean result. If you are unfamiliar with fuzzy logic, there are several good pages available online dedicated to the subject, however we will attempt to produce a brief discussion here:

If you are maintaining an inventory on a product, and would like to know if it is time to reorder new stock for your inventory, you would more than likely provide a setpoint for when it is time to reorder. That setpoint, however, may not give you enough warning that it is time to reorder. Therefore you might also set a high setpoint to give you a warning when the inventory item is beginning to run low.

Therefore, by definition, you have varying degrees of "product inventory lowness"... example: if the item needs to be reordered at a quantity level of 25, but is considered "to be running low" at a quantity of 50. Any quantity over 50 means no reorder is required. It could be said that any quantity level between 50 and 25 represents an "increasing level of lowness". Therefore, the "level of lowness" can be quickly derived by calling:

Example Fuzzy Result
 dim ddll: set ddll = createObject("DumontDLL")
 dim i: for i = 60 to 20 step -5
   dim f: f = ddll.fuzzy( 50.0, 25.0, i )
   ddll.debug i              & " .. " & _
              f              & " .. " & _
              CInt(f)        & " .. " & _
 ' actual result  boolean     priority
 '    i     f     Cint(f)    CInt(1+(f*10))
 '   --    ---    -------    --------------
 '   60 .. 1.0 ..   1     ..     11
 '   55 .. 1.0 ..   1     ..     11
 '   50 .. 1.0 ..   1     ..     11
 '   45 .. 0.8 ..   1     ..      9
 '   40 .. 0.6 ..   1     ..      7
 '   35 .. 0.4 ..   0     ..      5
 '   30 .. 0.2 ..   0     ..      3
 '   25 .. 0.0 ..   0     ..      1
 '   20 .. 0.0 ..   0     ..      1
As you can see the "threshold" between a logical 1 and a logical 0 falls somewhere between 40 and 35. This is what is referred to as a fuzzy-result. The threshold betwen a logical 1 and a logical 0 is easily changed by changing the .high. and .low. values.

As a matter of practical application, the fuzzy calculation could be used to calculate the "order priority" of a particular product (using this scenario). Take for example the following code:

vbScript Example: calculating product order priority
 dim oPH: dfrm.field("Product Order High")
 dim oPL: dfrm.field("Product Order Low")
 dim oPA: dfrm.field("Product Actual QOH")
 dim oPP: dfrm.field("Product Order Priority")
 oPP.value = 1 + (ddll.fuzzy( oPH.value, oPL.value, oPA.value ) * 10)
The code above will compute a "Product Order Priority" in the range of 1 to 11 indicating the "level of lowness". A value of 1 indicates "top" priority (serious lowness of product inventory) and a value of 11 indicates "lowest" priority (lots of product inventory on hand). For clarity, you can apply a filter to remove all items with a priority of 11. Any priority of 10 to 1 will show, therefore, of increasing importance, what items need to be ordered.

Fuzzy logic calls can be nested, producing complex results that can respond more intelligently to various conditions within your application and produce valuable results. For reference information here is one good article on the subject: http://www.generation5.org/content/1999/fuzzyintro.asp

Definition at line 1234 of file DumontDLL.cpp.

QDumontTest* QDumontDLL::getTest ( void   )  [inline, slot]

Definition at line 1745 of file DumontDLL.h.

QString QDumontDLL::guid ( void   )  [slot]

Definition at line 1104 of file DumontDLL.cpp.

QString QDumontDLL::inputBox ( const QString  prompt = "",
const QString  title = "",
const QString  dval = "" 
) [slot]

Definition at line 892 of file DumontDLL.cpp.

long QDumontDLL::LockCount ( void   )  [slot]

Get the current lock count.

This returns the current lock count. Callers can use this function to query the currently running Dumont to see if it has already been locked into memory.

Definition at line 208 of file DumontDLL.cpp.

void QDumontDLL::log ( QString  i_fileName,
QString  i_sourceFile,
QString  i_logLine 
) [slot]

Definition at line 1037 of file DumontDLL.cpp.

QMultiDateDialog * QDumontDLL::multiDateDialog ( const QString &  i_mdd = "",
const QString &  i_defaultDate = "" 
) [slot]

Definition at line 250 of file DumontDLL.cpp.

void QDumontDLL::multiDateDialogExec ( const QString &  i_mdd = "",
const QString &  i_defaultDate = "" 
) [slot]

Definition at line 276 of file DumontDLL.cpp.

QString QDumontDLL::packDate ( QDateTime  i_dateTime  )  [inline, slot]

Definition at line 2360 of file DumontDLL.h.

QString QDumontDLL::packDate ( QDate  i_date  )  [slot]

Definition at line 1136 of file DumontDLL.cpp.

QString QDumontDLL::packDateTime ( QDateTime  i_dateTime  )  [slot]

Definition at line 1146 of file DumontDLL.cpp.

QString QDumontDLL::packTime ( QDateTime  i_dateTime  )  [inline, slot]

Definition at line 2368 of file DumontDLL.h.

QString QDumontDLL::packTime ( QTime  i_time  )  [slot]

Definition at line 1141 of file DumontDLL.cpp.

bool QDumontDLL::phoneTooShort ( void   )  [slot]

Return if Phone Number was too short.

Definition at line 976 of file DumontDLL.cpp.

QString QDumontDLL::prependZero ( QString  i_value,
long  i_count 
) [slot]

Put zeros in front of something.

Definition at line 961 of file DumontDLL.cpp.

QCommenceForm* QDumontDLL::previousForm (  )  [inline, slot]

Return the previous form.

This just returns the form that was opened previously to this form. This is often handy when you are trying to pull values from the form that your were opened from - assuming you were opened from a connection field, and not directly from a report.

Definition at line 2046 of file DumontDLL.h.

bool QDumontDLL::processMultiDates ( const QString &  mddNewCode,
const QString &  mddOrgCode,
const QString &  mappingItemName 
) [slot]

This will process all the multidates according to a specific multidate code.

mddNewCode this is the calendar item new mdd code after it was edited. It may not change... it just depends on what the user did to the calendar item.
mddOrgCode this is the calendar item original mdd code before it was edited. It may or may not have changed, but this is the original code before it was changed. It is used to find all related multidate items that have not been updated yet.
mappingItemName this is the name of the calendar map item in the Dumont category. The mapping item contains all the details necessary to get the mulidate items processed properly.

Definition at line 1403 of file DumontDLL.cpp.

QString QDumontDLL::randomKey ( int  length = 4  )  [inline, slot]

Definition at line 1833 of file DumontDLL.h.

void QDumontDLL::renameFile ( QString  i_fileName,
QString  i_newName 
) [slot]

Rename a file.

Definition at line 1025 of file DumontDLL.cpp.

void QDumontDLL::secretAgentEvent ( void   )  [slot]

Execute an Agent Event.

This is the Secret Agent processor (punn intended). It is basically a timer-driven event processor that runs in the background of Commence.DB functions. It allows the DumontDLL to handle various event-driven functions, such as assigning THID ID's to items after they are stored to the database. Some of these things can be handled by the Commence Agents, but then at the same time the Commence Agents don't have direct access to the DumontDLL functionality (yet).

This function should not be called directly. This method is called internally by the DumontDLL when it needs to process a secretAgentFunction.

Definition at line 284 of file DumontDLL.cpp.

QString QDumontDLL::selectItem ( QString  itemList,
QString  windowTitle = "Pick an Item",
bool  multiSelect = false 
) [slot]

Select an Item from a list of Items.

This function provides a pop-up item picker that allows the user to select an item from a list of items.

Definition at line 1274 of file DumontDLL.cpp.

QString QDumontDLL::spellCheck ( const QString &  text,
const QString &  dictionary = "C:/Commence/Dumont/en_GB.dic" 
) [slot]

Spell Check Some Text.

This will open a spell checking dialog window that will allow the user to check the text against a spell checking engine. The spell checker is based upon the hunspell project (http://hunspell.sourceforge.net/).

If there are no errors in the text, then the spell checking window does not open, and the original string is returned.

vbScript Example ~ Spell Checking
 Sub Form_OnLeaveField(ByVal FieldName)
   if( InStr("Note,Outcome,Billing Note",fieldName) ) then
     dim ddll: set ddll = createObject("DumontDLL")
     Field(fieldName).value = ddll.SpellCheck(Field(fieldName).value)
   end if
 End Sub
Example Dialog Window
Acknowledgement to TD Gooch for testing and feedback
String ~ Spell Checked Text. If there are no errors in the text then the original string will be returned.
text String ~ text to be checked
dictionary String ~ Reference to Dictionary Set. Defaults to C:/Commence/Dumont/en_GB.dic

Definition at line 840 of file DumontDLL.cpp.

bool QDumontDLL::start ( QCocDispatch i_application,
const QString &  dumCategory = "" 
) [slot]

Start an Application.

This does basically the same thing as Application() but follows with some start-up procedures (as specified in the dumVar() tables. These procedures can include scanning the database directories for problems, loading the data.ini file into a Commence item so that it can be reviewed from the server, writing local settings to a users .ini file and so on.


The recordUserStartOn flag sets if the flag that shows when the user logged in is set in his userVar() field.


The recordUserDumontVersion records in the userVar() field the version of Dumont that he is running.


The recordUserDataIni makes a complete copy of the users data.ini file for debugging and troubleshooting purposes.


This records a copy of active.log in Commence for analysys at the server.

Definition at line 571 of file DumontDLL.cpp.

bool QDumontDLL::start ( QCommenceForm form  )  [slot]

Definition at line 555 of file DumontDLL.cpp.

void QDumontDLL::stop ( void   )  [slot]

Let Dumont know the application is stopping.

This does basically the reverse of Start() in that it lets Dumont know that the application is stopping. Dumont can then do things like stamp various files with when the application was shut down and other housekeeping functions.

Definition at line 627 of file DumontDLL.cpp.

bool QDumontDLL::tcpConnectToServer ( const QString &  hostAddress,
long  port 
) [slot]

Definition at line 791 of file DumontDLL.cpp.

QString QDumontDLL::tcpRequest ( const QString &  request  )  [slot]

Send TCP Request.

This sends a request to a Dumont TCP Server.

Definition at line 802 of file DumontDLL.cpp.

bool QDumontDLL::tcpStartServer ( long  port  )  [slot]

Start Dumont TCP Server.

This tells Dumont to run as a TCP server. Clients can send requests to this server.

Definition at line 786 of file DumontDLL.cpp.

void QDumontDLL::test ( QString  v1,
QString  v2,
QString  v3,
QString  v4 
) [inline, slot]

Definition at line 1740 of file DumontDLL.h.

void QDumontDLL::test ( QString  v1,
int  v2,
QString  v3 
) [inline, slot]

Definition at line 1735 of file DumontDLL.h.

void QDumontDLL::test ( QString  v1,
QString  v2,
QString  v3 
) [inline, slot]

Definition at line 1730 of file DumontDLL.h.

void QDumontDLL::test ( void   )  [slot]

Definition at line 176 of file DumontDLL.cpp.

QString QDumontDLL::textEdit ( const QString &  text,
const QString &  title = "",
const QString &  prompt = "",
const QString &  dictionary = "C:/Commence/Dumont/en_GB.dic" 
) [slot]

Acknowledgement to TD Gooch for testing and feedback
String ~ Spell Checked Text. If there are no errors in the text then the original string will be returned.

Definition at line 910 of file DumontDLL.cpp.

void QDumontDLL::textFile ( QString  i_fileName,
QString  i_data 
) [slot]

Write some text to a file.

Definition at line 998 of file DumontDLL.cpp.

QString QDumontDLL::textFile ( QString  i_fileName  )  [slot]

Read some text from a file.

Definition at line 991 of file DumontDLL.cpp.

QDate QDumontDLL::unpackDate ( QString  i_date  )  [slot]

Definition at line 1155 of file DumontDLL.cpp.

QDateTime QDumontDLL::unpackDateTime ( QString  i_dateTime  )  [slot]

Definition at line 1165 of file DumontDLL.cpp.

QTime QDumontDLL::unpackTime ( QString  i_time  )  [slot]

Definition at line 1160 of file DumontDLL.cpp.

bool QDumontDLL::updateIsAvailable ( void   )  [inline, slot]

Check Dumont Source Server for program updates.

Normally the DumontDLL will periodically go automatically to the source server and check for program updates. Calling this function forces a server check and primes the DumontDLL for update if one is available from the server.

Definition at line 1878 of file DumontDLL.h.

QString QDumontDLL::var ( QString  i_var,
QString  i_item,
QString  i_value 
) [slot]

Definition at line 1074 of file DumontDLL.cpp.

QString QDumontDLL::var ( QString  i_var,
QString  i_item 
) [slot]

Definition at line 1069 of file DumontDLL.cpp.

QString QDumontDLL::version ( void   )  [inline, slot]

return current version number

The version number provides for a simple method of determining if the DumontDLL is at a high-enough version level to be used within the application.

Definition at line 1867 of file DumontDLL.h.

Member Data Documentation

Definition at line 2536 of file DumontDLL.h.

QPointer<QMultiDateDialog> QDumontDLL::m_mdd [private]

Definition at line 2542 of file DumontDLL.h.

QString QDumontDLL::m_mddCode [private]

Definition at line 2544 of file DumontDLL.h.

QString QDumontDLL::m_mddDate [private]

Definition at line 2545 of file DumontDLL.h.

Definition at line 2534 of file DumontDLL.h.

QStringList* QDumontDLL::m_secretAgentMissions [private]

Definition at line 2540 of file DumontDLL.h.

QTimer* QDumontDLL::m_secretAgentTimer [private]

Definition at line 2538 of file DumontDLL.h.

The documentation for this class was generated from the following files:

~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Comment your Code!
Commence Database User Support Group Forum
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC