OOFILE  1.9
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dbGUI Class Reference

Abstract manager coordinating dbHelper objects that manage interaction on a window. More...

#include <oofgui.h>

Inheritance diagram for dbGUI:
Inheritance graph
[legend]
Collaboration diagram for dbGUI:
Collaboration graph
[legend]

Public Member Functions

void addReceiver (oofReceiver *)
 Append receiver to end of list. More...
 
bool askAllReturningAny (bool returnAny, OOFmsgT msg, unsigned long senderDefined=0, const oofReceiver *skipping=0)
 
oofReceiveraskAllStoppingAtFirst (bool stopOn, OOFmsgT msg, unsigned long senderDefined=0, const oofReceiver *skipping=0)
 
void broadcast (OOFmsgT msg, unsigned long senderDefined=0, const oofReceiver *skipping=0)
 Broadcast a message to all anonymous subscribers. More...
 
void cloneRecord ()
 
 dbGUI (dbTable *)
 
void deleteRecord ()
 
void goFirstRecord ()
 
void goLastRecord ()
 
void goNextRecord ()
 
void goPrevRecord ()
 
void gotoCurrentOrNewRec ()
 Provide a current record for the form to edit. More...
 
bool isBroadcasting () const
 
bool leaveRecord ()
 Get permission to leave record and unlock including commmit/abort transactions. More...
 
dbTablemainTable () const
 
void newRecord ()
 
void removeReceiver (const oofReceiver *)
 
void revertRecord ()
 
void saveRecord ()
 
locking
bool recordAvailable () const
 Editing-aware check if record available. More...
 
void dontCareIfLocked ()
 
void careIfLocked ()
 

Protected Member Functions

void BroadcastShutdown ()
 
bool ConfirmDelete (const char *confirmMessage=0)
 
bool ConfirmRevert ()
 
dbAbstractBrowseHelperGetDisplayTableHandler (void *ioParam)
 

Protected Attributes

bool mLostReceiversWhileBroadcasting
 simple flag that removeReceiver was called during nested broadcast More...
 
unsigned long mNestedBroadcastingDepth
 aid to debugging and removeReceiver More...
 
OOF_ExpandableLongArraymReceivers
 owned More...
 

implement per-platform, no generic implementation

bool msgForOOFILE (const MessageT, void *ioParam)
 
void goHighlightedRecord (dbAbstractBrowseHelper *inBrowser)
 
void changedSelection (oofReceiver *dontNeedToTell=0)
 
bool isOOFILEcommandEnabled (long commandID, Boolean &outEnabled) const
 
static bool isOOFILEmsg (const MessageT)
 

Detailed Description

Abstract manager coordinating dbHelper objects that manage interaction on a window.

Maps between framework-specific actions and the OOFILE equivalents, eg: providing stepping through records.

Definition at line 301 of file oofgui.h.

Constructor & Destructor Documentation

dbGUI::dbGUI ( dbTable inTable)

Definition at line 50 of file oofgui.cpp.

Member Function Documentation

void oofBroadcaster::addReceiver ( oofReceiver addingReceiver)
inherited

Append receiver to end of list.

Includes assertion to check if already in list.

Definition at line 181 of file oofmsg.cpp.

References OOF_ExpandableLongArray::append(), OOF_ExpandableLongArray::find(), and oofBroadcaster::mReceivers.

Referenced by oofSingleListener::oofSingleListener(), oofReceiver::subscribeTo(), and oofSingleListener::subscribeTo().

bool oofBroadcaster::askAllReturningAny ( bool  returnAny,
OOFmsgT  msg,
unsigned long  senderDefined = 0,
const oofReceiver skipping = 0 
)
inherited
oofReceiver * oofBroadcaster::askAllStoppingAtFirst ( bool  stopOn,
OOFmsgT  msg,
unsigned long  senderDefined = 0,
const oofReceiver skipping = 0 
)
inherited
void oofBroadcaster::broadcast ( OOFmsgT  msg,
unsigned long  senderDefined = 0,
const oofReceiver skipping = 0 
)
inherited

Broadcast a message to all anonymous subscribers.

Parameters
msgconstant value indicating the action or event that has occurred.
senderDefinedadditional param for caller to pass through
skippinga receiver to be skipped when broadcasting, to avoid circular messages
Todo:
use void* for senderDefined so can cope with values >32bits eg oidT in HUGE databases or 64bit pointers.

Definition at line 82 of file oofmsg.cpp.

References OOF_ExpandableLongArray::count(), OOF_ExpandableLongArray::deleteAllMatching(), oofBroadcaster::mLostReceiversWhileBroadcasting, oofBroadcaster::mNestedBroadcastingDepth, oofBroadcaster::mReceivers, oofReceiver::receiveMsg(), and OOF_ExpandableLongArray::value().

Referenced by dbTable::addOIDtoSelection(), dbTable::appendSelection(), oofBroadcaster::BroadcastShutdown(), dbTable::clearSelection(), oofGraphSettingsCompleter::completePromises(), oofRepTextStyleCompleter::completePromises(), dbTable::deleteRecord(), dbTable::difference_with(), dbTable::dropRecordFromSelection(), dbTable::insert(), dbTable::intersection_with(), dbTable::invert(), leaveRecord(), dbAbstractEditHelper::LoadData(), dbTable::loadRelatedContextJoiningFromTo(), newRecord(), dbRelRefBase::relateFromRecord(), dbRelRefBase::relateRecord(), dbTable::removeSelection(), dbTable::resumeSorting(), revertRecord(), dbTable::revertRecord(), saveRecord(), dbTable::saveRecord(), dbTable::search(), dbTable::searchSelection(), dbRelRefBase::selectAllRelated(), dbTable::selectJustOID(), dbTable::setSelection(), dbTable::suspendSorting(), dbTable::union_with(), dbTable::union_with_no_overlap(), and dbTable::unloadRecord().

void oofBroadcaster::BroadcastShutdown ( )
protectedinherited
void dbGUI::careIfLocked ( )
inline

Definition at line 604 of file oofgui.h.

Referenced by dbFieldLink::tellGUIcareAboutLocking().

void dbGUI::changedSelection ( oofReceiver dontNeedToTell = 0)
void dbGUI::cloneRecord ( )

Definition at line 130 of file oofgui.cpp.

References changedSelection(), dbTable::cloneRecord(), and leaveRecord().

bool dbGUI::ConfirmDelete ( const char *  confirmMessage = 0)
protected

Definition at line 61 of file oofgui.cpp.

References IDYES, oofYNC::msgBox(), and oofYNC::setDefaultButton().

bool dbGUI::ConfirmRevert ( )
protected

Definition at line 76 of file oofgui.cpp.

References IDYES, oofYNC::msgBox(), and oofYNC::setDefaultButton().

Referenced by revertRecord().

void dbGUI::deleteRecord ( )

Definition at line 111 of file oofgui.cpp.

References changedSelection(), and dbTable::deleteRecord().

void dbGUI::dontCareIfLocked ( )
inline

Definition at line 597 of file oofgui.h.

dbAbstractBrowseHelper * dbGUI::GetDisplayTableHandler ( void *  ioParam)
protected
void dbGUI::goFirstRecord ( )
void dbGUI::goHighlightedRecord ( dbAbstractBrowseHelper inBrowser)
void dbGUI::goLastRecord ( )
void dbGUI::goNextRecord ( )
void dbGUI::goPrevRecord ( )
void dbGUI::gotoCurrentOrNewRec ( )

Provide a current record for the form to edit.

Definition at line 225 of file oofgui.cpp.

References changedSelection(), dbTable::isEmpty(), dbTable::isRecordLoaded(), dbTable::newRecord(), and dbTable::start().

bool oofBroadcaster::isBroadcasting ( ) const
inlineinherited

Definition at line 160 of file oofmsg.h.

References oofBroadcaster::mNestedBroadcastingDepth.

bool dbGUI::isOOFILEcommandEnabled ( long  commandID,
Boolean &  outEnabled 
) const

Definition at line 277 of file oofpp.cpp.

References cmd_dbClone, cmd_dbDel, cmd_dbFirst, cmd_dbLast, cmd_dbNew, cmd_dbNext, and cmd_dbPrev.

bool dbGUI::isOOFILEmsg ( const MessageT  inMessage)
static

Definition at line 325 of file oofpp.cpp.

References kFirstOOFILEcmd, and kLastOOFILEcmd.

bool dbGUI::leaveRecord ( )

Get permission to leave record and unlock including commmit/abort transactions.

Query all dependent dbHelper and other oofListener subscribers and leave if possible. Clears locks and transactions automatically.

Todo:

more sophisticated transaction unlocking

confirm that we need to commitRecord if cancelling

Definition at line 245 of file oofgui.cpp.

References dbTable::abortTransaction(), oofBroadcaster::askAllStoppingAtFirst(), oofBroadcaster::broadcast(), dbTable::commitTransaction(), dbTable::isDirty(), OOFmsg_AttemptLeaveRecord, OOFmsg_SaveRecord, dbTable::saveRecord(), dbTable::transactionDirty(), and dbTable::unlockRecord().

Referenced by cloneRecord(), goFirstRecord(), goLastRecord(), goNextRecord(), goPrevRecord(), and newRecord().

dbTable * dbGUI::mainTable ( ) const
inline

Definition at line 577 of file oofgui.h.

Referenced by dbAbstractBrowseHelper::receiveMsg().

bool dbGUI::msgForOOFILE ( const MessageT  inMessage,
void *  ioParam 
)
void dbGUI::newRecord ( )
bool dbGUI::recordAvailable ( ) const
inline

Editing-aware check if record available.

it is possible a screen like a settings screen may have dbEditHelper's on a given table without intending to edit it, so will call dbGUI::dontCareIfLocked

Definition at line 589 of file oofgui.h.

References dbTable::lockedCurrentRecord().

Referenced by dbBrowseHelper::appendSelection(), dbBrowseHelper::clearSelection(), dbFieldLink::readOnly(), and dbBrowseHelper::removeSelection().

void oofBroadcaster::removeReceiver ( const oofReceiver rcvrPtr)
inherited
void dbGUI::revertRecord ( )
void dbGUI::saveRecord ( )

Member Data Documentation

bool oofBroadcaster::mLostReceiversWhileBroadcasting
protectedinherited

simple flag that removeReceiver was called during nested broadcast

Definition at line 98 of file oofmsg.h.

Referenced by oofBroadcaster::broadcast(), and oofBroadcaster::removeReceiver().

unsigned long oofBroadcaster::mNestedBroadcastingDepth
protectedinherited

aid to debugging and removeReceiver

Definition at line 97 of file oofmsg.h.

Referenced by oofBroadcaster::broadcast(), oofBroadcaster::isBroadcasting(), and oofBroadcaster::removeReceiver().

OOF_ExpandableLongArray* oofBroadcaster::mReceivers
protectedinherited

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