Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

oofRepEditLink Class Reference

#include <oofrepedit.h>

Inheritance diagram for oofRepEditLink:

Inheritance graph
[legend]
Collaboration diagram for oofRepEditLink:

Collaboration graph
[legend]
List of all members.

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.


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.

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

virtual bool getLastCoords (short &outCol, long &outRow) const
 Return true to indicate we are at the last cell already, same as atFirst().

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.

virtual bool validToLeaveLink ()
 Validate field contents, overridden if can check just contents.

virtual bool validToLeaveForm ()
 Validate unique fields to ensure can accept this record without error from database.

virtual void highlightLink ()
 Visually highlight a link, usually becoming edit focus.

void markClean ()

reflective calls

bool isReadOnly () const
bool alwaysReadOnly () const
bool isDirty () const
bool linkIsEmpty () const
dbGUIAdapteradapter () const

Public Member Functions

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

virtual ~oofRepEditLink ()
void getCurrentCoords (short &outCol, long &outRow) const
void setCurrentCoords (short inCol, long inRow)
virtual void tellGUIcareAboutLocking () const
dbHelperowner () const
void owner (dbHelper *)
 not ctor param as can create without helper

dbFieldfield () const
 purposely non-virtual as subclasses return different types

void setField (dbField *inField)
bool hidden () const
void hide (bool hideIt=true)
virtual void describe (std::ostream &) const
 Provide human-readable information about object.

virtual oofString name () const
void incRefs ()
void decRefs ()

Protected Attributes

oofRepDrawablemDrawable
long mCurrentRow
long mLastRow
short mCurrentCol
short mLastCol
dbFieldmField
dbGUIAdaptermAdapter
 owned

dbHelpermOwner
bool mMaybeDirty
 tentative flag lets us optimise comparisons

bool mReadOnly
 default is read-write

bool mAlwaysReadOnly
 for static controls, etc;

bool mHidden
unsigned int mReferences

Friends

class dbAbstractEditHelper
 so it can call PreApprovedReadOnly


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.

oofRepEditLink::~oofRepEditLink  )  [virtual]
 


Member Function Documentation

dbGUIAdapter * dbFieldLink::adapter  )  const [inline, inherited]
 

bool oofRepEditLink::allowsCellTextStyles  )  const [virtual]
 

Reimplemented in oofRepLayoutEditLink, and oofRepViewEditLink.

bool dbFieldLink::alwaysReadOnly  )  const [inline, inherited]
 

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

void dbFieldLink::copyFieldToLink  )  [virtual, inherited]
 

Reimplemented in dbFieldPickLink, and dbBoolLink.

void dbFieldLink::copyLinkToField  )  [virtual, inherited]
 

Reimplemented in dbFieldPickLink, and dbBoolLink.

oofRepCustomViewDrawer * oofRepEditLink::customViewDrawer long  col  )  const [virtual]
 

Reimplemented in oofRepViewEditLink.

void OOF_mixRefCount::decRefs  )  [inherited]
 

void OOF_PublicBase::describe std::ostream &  os  )  const [virtual, inherited]
 

Provide human-readable information about object.

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

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

void oofRepEditLink::enterLink dbGUIAdapter  )  [virtual]
 

Reimplemented in oofRepViewEditLink.

dbField * dbFieldLink::field  )  const [inline, inherited]
 

purposely non-virtual as subclasses return different types

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

Returns:
dbField* to the field we link.

Reimplemented in dbUshortLink.

virtual oofString oofRepEditLink::getCellText bool *  outIsEditable = 0,
oofString outLocationName = 0,
long  row = -1,
short  col = -1
[pure virtual]
 

Implemented in oofRepLayoutEditLink, oofRepViewEditLink, and oofRepColHeaderEditLink.

void oofRepEditLink::getCurrentCoords short &  outCol,
long &  outRow
const [inline]
 

bool oofRepEditLink::getDownFromCurrent short &  outCol,
long &  outRow
const [virtual]
 

Reimplemented in oofRepLayoutEditLink, and oofRepViewEditLink.

bool oofRepEditLink::getLastCoords short &  outCol,
long &  outRow
const [virtual]
 

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

bool oofRepEditLink::getLeftOfCurrent short &  outCol,
long &  outRow
const [virtual]
 

bool oofRepEditLink::getRightOfCurrent short &  outCol,
long &  outRow
const [virtual]
 

Reimplemented in oofRepLayoutEditLink, oofRepViewEditLink, and oofRepColHeaderEditLink.

bool oofRepEditLink::getUpFromCurrent short &  outCol,
long &  outRow
const [virtual]
 

Reimplemented in oofRepLayoutEditLink, and oofRepViewEditLink.

bool oofRepEditLink::hasCustomViewDrawers  )  const [virtual]
 

Reimplemented in oofRepViewEditLink.

bool OOF_PublicBase::hidden  )  const [inline, inherited]
 

void OOF_PublicBase::hide bool  hideIt = true  )  [inline, inherited]
 

void dbFieldLink::highlightLink  )  [virtual, inherited]
 

Visually highlight a link, usually becoming edit focus.

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

void OOF_mixRefCount::incRefs  )  [inline, inherited]
 

bool dbFieldLink::isDirty  )  const [inline, inherited]
 

bool dbFieldLink::isReadOnly  )  const [inline, inherited]
 

bool oofRepEditLink::leaveLink  )  [virtual]
 

Reimplemented from dbFieldLink.

bool dbFieldLink::linkEqualsField  )  const [virtual, inherited]
 

Reimplemented in dbFieldPickLink, and dbBoolLink.

bool dbFieldLink::linkIsEmpty  )  const [inherited]
 

oofRepTextStyle * oofRepEditLink::localTextStyle  )  const [virtual]
 

void dbFieldLink::markClean  )  [inline, inherited]
 

void dbFieldLink::maybeChangeTargetLink  )  [inline, inherited]
 

void dbFieldLink::maybeDirty  )  [inline, inherited]
 

oofString OOF_PublicBase::name  )  const [virtual, inherited]
 

Reimplemented in dbTable, dbConnect, dbField, and OOF_adornerHolder.

void dbFieldLink::owner dbHelper  )  [inline, inherited]
 

not ctor param as can create without helper

dbHelper * dbFieldLink::owner  )  const [inline, inherited]
 

void dbFieldLink::readOnly bool  becomeReadOnly = true  )  [virtual, inherited]
 

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

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

virtual void oofRepEditLink::setCellText const oofString ,
long  row = -1,
short  col = -1
[pure virtual]
 

Implemented in oofRepLayoutEditLink, oofRepViewEditLink, and oofRepColHeaderEditLink.

void oofRepEditLink::setCurrentCoords short  inCol,
long  inRow
[inline]
 

void dbFieldLink::setField dbField inField  )  [inline, inherited]
 

void oofRepEditLink::tellGUIcareAboutLocking  )  const [virtual]
 

Reimplemented from dbFieldLink.

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

void dbFieldLink::updateDerivedFieldDisplay bool  isNew  )  [virtual, inherited]
 

Reimplemented in dbNumericFieldLink, dbDateLink2Editor, and dbDateTimeLink2Editor.

bool dbFieldLink::validToLeaveForm  )  [virtual, inherited]
 

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.

bool dbFieldLink::validToLeaveLink  )  [virtual, inherited]
 

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 dbDateLink2Editor, and dbDateTimeLink2Editor.


Friends And Related Function Documentation

friend class dbAbstractEditHelper [friend, inherited]
 

so it can call PreApprovedReadOnly


Member Data Documentation

dbGUIAdapter* dbFieldLink::mAdapter [protected, inherited]
 

owned

bool dbFieldLink::mAlwaysReadOnly [protected, inherited]
 

for static controls, etc;

short oofRepEditLink::mCurrentCol [protected]
 

long oofRepEditLink::mCurrentRow [protected]
 

oofRepDrawable* oofRepEditLink::mDrawable [protected]
 

dbField* dbFieldLink::mField [protected, inherited]
 

bool OOF_PublicBase::mHidden [protected, inherited]
 

short oofRepEditLink::mLastCol [protected]
 

long oofRepEditLink::mLastRow [protected]
 

bool dbFieldLink::mMaybeDirty [protected, inherited]
 

tentative flag lets us optimise comparisons

dbHelper* dbFieldLink::mOwner [protected, inherited]
 

bool dbFieldLink::mReadOnly [protected, inherited]
 

default is read-write

unsigned int OOF_mixRefCount::mReferences [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Thu Jan 1 21:47:56 2004 for OOFILE by doxygen 1.3.5