OOFILE  1.9
Public Member Functions | Protected Attributes | List of all members
oofRepEditLink Class Referenceabstract

oofRepEditLink similarly to dbFieldLink, links a display to an OOFILE item. More...

#include <oofrepedit.h>

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

Public Member Functions

void decRefs ()
 
virtual void describe (std::ostream &) const
 Provide human-readable information about object. More...
 
dbFieldfield () const
 purposely non-virtual as subclasses return different types More...
 
void getCurrentCoords (short &outCol, long &outRow) const
 
bool hidden () const
 
void hide (bool hideIt=true)
 
void incRefs ()
 
virtual oofString name () const
 
 oofRepEditLink (oofRepDrawable *)
 Bunch of default methods as can't implement this class - must subclass to at least provide getCellText and setCellText. More...
 
dbHelperowner () const
 
void owner (dbHelper *)
 not ctor param as can create without helper More...
 
void setCurrentCoords (short inCol, long inRow)
 
void setField (dbField *inField)
 
virtual void tellGUIcareAboutLocking () const
 
virtual ~oofRepEditLink ()
 
cell content access methods
virtual oofString getCellText (bool *outIsEditable=0, oofString *outLocationName=0, long row=-1, short col=-1)=0
 
virtual void setCellText (const oofString &, long row=-1, short col=-1)=0
 
init and cleanup code when edit dialog launches and if it changes links
virtual void enterLink (dbGUIAdapter *)
 
virtual bool leaveLink ()
 
style access
virtual oofRepTextStyletextStyle () const
 textStyle returns a writeable pointer so allows updates HOWEVER the cascading style model means this may be a pointer to a parent style so it is NOT recommended to update this value. More...
 
virtual oofRepTextStylelocalTextStyle () const
 
virtual bool allowsCellTextStyles () const
 
reflective methods to query link
virtual bool hasCustomViewDrawers () const
 
virtual oofRepCustomViewDrawercustomViewDrawer (long col) const
 
movement testing
virtual bool atFirst () const
 might override atFirst if you had irregular shape allowing first cell to be further along first row, but usually use this base method More...
 
virtual bool getLastCoords (short &outCol, long &outRow) const
 Return true to indicate we are at the last cell already, same as atFirst() More...
 
virtual bool getLeftOfCurrent (short &outCol, long &outRow) const
 
virtual bool getRightOfCurrent (short &outCol, long &outRow) const
 
virtual bool getUpFromCurrent (short &outCol, long &outRow) const
 
virtual bool getDownFromCurrent (short &outCol, long &outRow) const
 
mainly used by dbGUIadaptor
void maybeChangeTargetLink ()
 
void maybeDirty ()
 
mainly used by dbEditHelper
virtual void copyFieldToLink ()
 
virtual void copyLinkToField ()
 
virtual bool linkEqualsField () const
 
virtual void updateDerivedFieldDisplay (bool isNew)
 
virtual void readOnly (bool isReadOnly=true)
 Change readonly state of link to accept or deny data entry. More...
 
virtual bool validToLeaveLink ()
 Validate field contents, overridden if can check just contents. More...
 
virtual bool validToLeaveForm ()
 Validate unique fields to ensure can accept this record without error from database. More...
 
virtual void highlightLink ()
 Visually highlight a link, usually becoming edit focus. More...
 
void markClean ()
 
reflective calls
bool isReadOnly () const
 
bool alwaysReadOnly () const
 
bool isDirty () const
 
bool linkIsEmpty () const
 
dbGUIAdapteradapter () const
 

Protected Attributes

dbGUIAdaptermAdapter
 owned More...
 
bool mAlwaysReadOnly
 for static controls, etc; More...
 
short mCurrentCol
 
long mCurrentRow
 
oofRepDrawablemDrawable
 
dbFieldmField
 
bool mHidden
 
short mLastCol
 
long mLastRow
 
bool mMaybeDirty
 tentative flag lets us optimise comparisons More...
 
dbHelpermOwner
 
bool mReadOnly
 default is read-write More...
 
unsigned int mReferences
 

Detailed Description

oofRepEditLink similarly to dbFieldLink, links a display to an OOFILE item.

However much richer interaction is supported as the linked item (an oofRepDrawable) may have a) multiple text components, and b) multiple styles

View bands may have custom draw objects for a specific column which may not be instantiated in the program that's read in an XML-saved report. A pointer so an interested edit interface can query the type.

Future ideas - would be nice to abstract content even further and also add abstract property iteration for invisible properties such as column widths, sizes, view column headings enabling.

A link to a drawable with multiple dbViews may present those views as adjacent and so edited as contiguous cells either horizontally or vertically.

Remember all rows and cols are zero-based as normal.

outIsEditable is used to provide additional user feedback (eg: a locked symbol) that the cell is locked. However the adapter is used to disable and enable the cell without depending on user code.

Definition at line 62 of file oofrepedit.h.

Constructor & Destructor Documentation

oofRepEditLink::oofRepEditLink ( oofRepDrawable inD)

Bunch of default methods as can't implement this class - must subclass to at least provide getCellText and setCellText.

Provides defaults on the assumption of a single-celled drawable.

Definition at line 799 of file oofrepedit.cpp.

oofRepEditLink::~oofRepEditLink ( )
virtual

Definition at line 812 of file oofrepedit.cpp.

References dbFieldLink::mAdapter.

Member Function Documentation

dbGUIAdapter * dbFieldLink::adapter ( ) const
inlineinherited

Definition at line 815 of file oofgui.h.

References dbFieldLink::mAdapter.

Referenced by dbAbstractEditHelper::getLink().

bool oofRepEditLink::allowsCellTextStyles ( ) const
virtual

Reimplemented in oofRepViewEditLink, and oofRepLayoutEditLink.

Definition at line 842 of file oofrepedit.cpp.

bool dbFieldLink::alwaysReadOnly ( ) const
inlineinherited

Definition at line 770 of file oofgui.h.

References dbFieldLink::mAlwaysReadOnly.

bool oofRepEditLink::atFirst ( ) const
virtual

might override atFirst if you had irregular shape allowing first cell to be further along first row, but usually use this base method

Definition at line 894 of file oofrepedit.cpp.

References mCurrentCol, and mCurrentRow.

Referenced by OOF_mixRepAbstractCellEditor::GoToAnotherCell().

void dbFieldLink::copyFieldToLink ( )
virtualinherited
void dbFieldLink::copyLinkToField ( )
virtualinherited
oofRepCustomViewDrawer * oofRepEditLink::customViewDrawer ( long  col) const
virtual

Reimplemented in oofRepViewEditLink.

Definition at line 857 of file oofrepedit.cpp.

void OOF_mixRefCount::decRefs ( )
inherited
void OOF_PublicBase::describe ( std::ostream &  ) const
virtualinherited

Provide human-readable information about object.

Overriden to provide much more detail particularly for dbTable::describe() which provides full schema.

Reimplemented in dbConnect, dbTable, dbFixedBinary, dbChar, dbField, and dbRelRefBase.

Definition at line 342 of file oof1.cpp.

References OOF_PublicBase::name().

Referenced by OOF_Dictionary::describeVisible().

void oofRepEditLink::enterLink ( dbGUIAdapter inAdapter)
virtual
dbField * dbFieldLink::field ( ) const
inlineinherited

purposely non-virtual as subclasses return different types

Accessor for field being edited.

Used by dbGUIAdapters such as dbGUIAdaptEditPane::setFieldLink to get the field in order to query database characteristics.

Returns
dbField* to the field we link.

Definition at line 808 of file oofgui.h.

References dbFieldLink::mField.

Referenced by dbFieldLink::copyFieldToLink(), dbBoolLink::copyFieldToLink(), dbFieldLink::copyLinkToField(), dbBoolLink::copyLinkToField(), dbFieldLink::leaveLink(), dbBoolLink::linkEqualsField(), and dbGUIAdaptEditPane::setFieldLink().

virtual oofString oofRepEditLink::getCellText ( bool *  outIsEditable = 0,
oofString outLocationName = 0,
long  row = -1,
short  col = -1 
)
pure virtual
void oofRepEditLink::getCurrentCoords ( short &  outCol,
long &  outRow 
) const
inline

Definition at line 171 of file oofrepedit.h.

References mCurrentCol, and mCurrentRow.

bool oofRepEditLink::getDownFromCurrent ( short &  outCol,
long &  outRow 
) const
virtual

Reimplemented in oofRepViewEditLink, and oofRepLayoutEditLink.

Definition at line 940 of file oofrepedit.cpp.

Referenced by OOF_mixRepAbstractCellEditor::GoToAnotherCell().

bool oofRepEditLink::getLastCoords ( short &  outCol,
long &  outRow 
) const
virtual

Return true to indicate we are at the last cell already, same as atFirst()

Definition at line 904 of file oofrepedit.cpp.

References mCurrentCol, mCurrentRow, mLastCol, and mLastRow.

Referenced by OOF_mixRepAbstractCellEditor::GoToAnotherCell().

bool oofRepEditLink::getLeftOfCurrent ( short &  outCol,
long &  outRow 
) const
virtual

Definition at line 913 of file oofrepedit.cpp.

References mCurrentCol, and mCurrentRow.

Referenced by OOF_mixRepAbstractCellEditor::GoToAnotherCell().

bool oofRepEditLink::getRightOfCurrent ( short &  outCol,
long &  outRow 
) const
virtual
bool oofRepEditLink::getUpFromCurrent ( short &  outCol,
long &  outRow 
) const
virtual

Reimplemented in oofRepViewEditLink, and oofRepLayoutEditLink.

Definition at line 933 of file oofrepedit.cpp.

Referenced by OOF_mixRepAbstractCellEditor::GoToAnotherCell().

bool oofRepEditLink::hasCustomViewDrawers ( ) const
virtual

Reimplemented in oofRepViewEditLink.

Definition at line 850 of file oofrepedit.cpp.

bool OOF_PublicBase::hidden ( ) const
inlineinherited

Definition at line 51 of file oof1.h.

Referenced by OOF_Dictionary::EntryMatchesVisibility().

void OOF_PublicBase::hide ( bool  hideIt = true)
inlineinherited

Definition at line 52 of file oof1.h.

void dbFieldLink::highlightLink ( )
virtualinherited

Visually highlight a link, usually becoming edit focus.

dbAbstractEditHelper::ValidateLinks calls us to highlight the first invalid link it finds.

Definition at line 1044 of file oofgui.cpp.

References dbGUIAdapter::highlightContents(), and dbFieldLink::mAdapter.

Referenced by dbAbstractEditHelper::ValidateLinks().

void OOF_mixRefCount::incRefs ( )
inlineinherited
bool dbFieldLink::isDirty ( ) const
inlineinherited
bool dbFieldLink::isReadOnly ( ) const
inlineinherited

Definition at line 763 of file oofgui.h.

References dbFieldLink::mReadOnly.

Referenced by dbGUIAdaptLControl::ExecuteSelf(), and dbGUIAdapter::IsReadOnly().

bool oofRepEditLink::leaveLink ( )
virtual

Reimplemented from dbFieldLink.

Definition at line 872 of file oofrepedit.cpp.

References dbFieldLink::owner().

Referenced by OOF_mixRepAbstractCellEditor::GoToAnotherItem().

bool dbFieldLink::linkEqualsField ( ) const
virtualinherited
bool dbFieldLink::linkIsEmpty ( ) const
inherited
oofRepTextStyle * oofRepEditLink::localTextStyle ( ) const
virtual

Definition at line 835 of file oofrepedit.cpp.

References oofRepTextStylable::localTextStyle(), and mDrawable.

void dbFieldLink::markClean ( )
inlineinherited
void dbFieldLink::maybeChangeTargetLink ( )
inlineinherited
void dbFieldLink::maybeDirty ( )
inlineinherited
oofString OOF_PublicBase::name ( ) const
virtualinherited

Reimplemented in dbConnect, dbTable, OOF_adornerHolder, and dbField.

Definition at line 349 of file oof1.cpp.

Referenced by OOF_PublicBase::describe().

dbHelper * dbFieldLink::owner ( ) const
inlineinherited
void dbFieldLink::owner ( dbHelper inOwner)
inlineinherited

not ctor param as can create without helper

Definition at line 787 of file oofgui.h.

References dbFieldLink::mOwner.

void dbFieldLink::readOnly ( bool  becomeReadOnly = true)
virtualinherited

Change readonly state of link to accept or deny data entry.

Won't allow enabling editing if can't edit record due to locking.

Definition at line 1133 of file oofgui.cpp.

References dbTable::getGUI(), dbFieldLink::mAlwaysReadOnly, dbFieldLink::mOwner, dbFieldLink::mReadOnly, dbGUI::recordAvailable(), and dbHelper::table().

Referenced by oofRepLayoutEditLink::getCellText(), oofRepViewEditLink::getCellText(), and oofRepColHeaderEditLink::getCellText().

virtual void oofRepEditLink::setCellText ( const oofString ,
long  row = -1,
short  col = -1 
)
pure virtual
void oofRepEditLink::setCurrentCoords ( short  inCol,
long  inRow 
)
inline

Definition at line 179 of file oofrepedit.h.

References mCurrentCol, and mCurrentRow.

Referenced by OOF_mixRepAbstractCellEditor::GoToAnotherCell().

void dbFieldLink::setField ( dbField inField)
inlineinherited

Definition at line 822 of file oofgui.h.

References dbFieldLink::mField.

void oofRepEditLink::tellGUIcareAboutLocking ( ) const
virtual

Reimplemented from dbFieldLink.

Definition at line 880 of file oofrepedit.cpp.

oofRepTextStyle * oofRepEditLink::textStyle ( ) const
virtual

textStyle returns a writeable pointer so allows updates HOWEVER the cascading style model means this may be a pointer to a parent style so it is NOT recommended to update this value.

See OOFRep_DesignDecisions.txt for discussion of issues

Definition at line 828 of file oofrepedit.cpp.

References mDrawable, and oofRepTextStylable::textStyle().

void dbFieldLink::updateDerivedFieldDisplay ( bool  isNew)
virtualinherited
bool dbFieldLink::validToLeaveForm ( )
virtualinherited

Validate unique fields to ensure can accept this record without error from database.

Warning
you probably still want to call this method if you override.

Reimplemented in dbFieldPickLink.

Definition at line 1110 of file oofgui.cpp.

References dbField::copyString(), dbField::fieldIsUniqueIndexed(), dbField::fieldName(), dbFieldLink::mField, dbFieldLink::validToLeaveLink(), and dbField::valueIsDuplicate().

Referenced by dbAbstractEditHelper::ValidateLinks().

bool dbFieldLink::validToLeaveLink ( )
virtualinherited

Validate field contents, overridden if can check just contents.

Lightweight check that allows tabbing between fields in open record.

See also
validToLeaveForm for heavier check.
dbDateLink2Editor::validToLeaveLink

Reimplemented in dbDateTimeLink2Editor, and dbDateLink2Editor.

Definition at line 1099 of file oofgui.cpp.

Referenced by dbFieldLink::leaveLink(), dbFieldPickLink::leaveLink(), and dbFieldLink::validToLeaveForm().

Member Data Documentation

dbGUIAdapter* dbFieldLink::mAdapter
protectedinherited
bool dbFieldLink::mAlwaysReadOnly
protectedinherited

for static controls, etc;

Definition at line 238 of file oofgui.h.

Referenced by dbFieldLink::alwaysReadOnly(), and dbFieldLink::readOnly().

short oofRepEditLink::mCurrentCol
protected
long oofRepEditLink::mCurrentRow
protected
oofRepDrawable* oofRepEditLink::mDrawable
protected

Definition at line 108 of file oofrepedit.h.

Referenced by localTextStyle(), and textStyle().

dbField* dbFieldLink::mField
protectedinherited
bool OOF_PublicBase::mHidden
protectedinherited

Definition at line 61 of file oof1.h.

short oofRepEditLink::mLastCol
protected
long oofRepEditLink::mLastRow
protected
bool dbFieldLink::mMaybeDirty
protectedinherited

tentative flag lets us optimise comparisons

Definition at line 236 of file oofgui.h.

Referenced by dbFieldLink::isDirty(), dbFieldLink::leaveLink(), dbFieldLink::markClean(), and dbFieldLink::maybeDirty().

dbHelper* dbFieldLink::mOwner
protectedinherited
bool dbFieldLink::mReadOnly
protectedinherited

default is read-write

Definition at line 237 of file oofgui.h.

Referenced by dbFieldLink::isReadOnly(), and dbFieldLink::readOnly().

unsigned int OOF_mixRefCount::mReferences
protectedinherited

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