Link to: source code | other
data directory
Copyright Turtle Creek Software 1996-2006. All Rights Reserved.
This class manages accounting class info for the Goldenseal job cost accounting software,
project management software, construction
estimating software
and construction project estimating software.
class DB_ObjectClassInfo : public DB_PersistentObject
{
public:
static CLASS_DESC *sDescriptor;
static DB_PersistentObject *MakeNew() { return TCS_NEW DB_ObjectClassInfo; }
static Boolean StoreWindowInfo(const DBClass inClass, const SWindowPosInfo inInfo,
const UInt8 order);
static Boolean StoreFormType(const DBClass inClass, const UInt8 formType);
static Boolean FetchWindowInfo(const DBClass outClass, SWindowPosInfo &outInfo,
UInt8 &outOrder);
static Boolean IsValidCustomTag(const TagType inTag);
static Boolean AutoEntersDate(const DBClass inClass);
static void SetAutoEntersDate(const DBClass inClass, const Boolean inValue);
static Boolean NewShowsTemplates(const DBClass inClass);
static void SetNewShowsTemplates(const DBClass inClass, const Boolean inValue);
static UInt8 GetOpenToBreakdown(const DBClass inClass);
static void SetOpenToBreakdown(const DBClass inClass, const UInt8 inValue);
static SInt32 GetCustomFieldCount(const DBClass inClass);
static CTextString GetCustomFieldName(const DBClass inClass, const UInt8 index);
DB_ObjectClassInfo();
virtual ~DB_ObjectClassInfo() {}
virtual DBid GetDBClassID(void) const { return id_ObjectClassInfo; }
virtual void CopyFrom(DB_PersistentObject */*source*/, const UInt8 /*copyFlags*/) {}
virtual NeoSize GetFileLength(const CNeoFormat *aFormat) const;
virtual Boolean GetMemberValue(const NeoTag aTag, const NeoTag aType,
void *aValue) const;
virtual Boolean SetMemberValue(const NeoTag aTag, const NeoTag aType,
const void *aValue);
virtual void ReadObject(CNeoStream *aStream, const NeoTag aTag);
virtual void WriteObject(CNeoStream *aStream, const NeoTag aTag);
DBid GetCurrentRecordID() const { return mCurrentRecord; }
void SetCurrentRecordID(const DBid inID);
DBid GetOwnerID() const { return mOwnerID; }
void SetOwnerID(const DBid inID);
DBClass GetFormType() const { return mRecentFormType; }
void SetFormType(const UInt8 inID);
DBid GetCurrentPrintForm() const { return mCurrentPrintForm; }
void SetCurrentPrintForm(const DBid inID);
//Boolean AddCalculator(const DBClass classID, const DBid calcID);
//Boolean RemoveCalculator(const DBClass classID, const DBid calcID);
Boolean AddCustomField(const SMemberInfo &memberInfo);
//Boolean RemoveCustomField(const TagType fieldTag);
SInt32 GetCustomFieldCount() { return mCustomFieldArray.GetCount(); }
SInt32 GetCustomFieldIndex(const TagType tag);
Boolean GetCustomFieldInfo(const TagType tag, SMemberInfo &memberInfo);
Boolean FetchCustomFieldInfo(const SInt32 index, SMemberInfo &memberInfo);
void UpdateDescriptor();
//void UpdateCalculators(const Boolean inValue = true);
Boolean IsCurrentlyDisplayed() const { return mIsCurrentlyDisplayed; }
void SetIsCurrentlyDisplayed(const Boolean inValue = true);
Boolean WasChangedRemotely() const { return mWasChangedRemotely; }
void SetChangedRemotely(const Boolean inValue = true)
{
mWasChangedRemotely = inValue;
MakeDirty(); // rev TCS 10/24/00
}
void SetWindowInfo(const SWindowPosInfo inInfo, const UInt8 order);
Boolean GetWindowInfo(SWindowPosInfo &outInfo, UInt8 &outOrder);
void SetAutoEntersDate(const Boolean inValue) { mShowsBlankDate = !inValue; }
Boolean AutoEntersDate() const { return !mShowsBlankDate; }
void SetNewShowsTemplates(const Boolean inValue) { mNewShowsTemplates = !inValue; }
Boolean NewShowsTemplates() const { return !mNewShowsTemplates; }
void SetWindowIsShaded(const Boolean inValue) { mWindowIsShaded = !inValue; }
Boolean WindowIsShaded() const { return mWindowIsShaded; }
void SetOpenToBreakdown(const UInt8 inValue) { mOpenToBreakdown = inValue; }
UInt8 GetOpenToBreakdown() const { return mOpenToBreakdown; }
void SetNewRowCostArea(const UInt8 inValue) { mNewRowCostArea = inValue; }
UInt8 GetNewRowCostArea() const { return mNewRowCostArea; }
TMemberArray FetchCustomFieldArray() const { return mCustomFieldArray; }
CTextString FetchCustomFieldName(const UInt8 index) const;
DBid GetDefaultIconID() const { return mDefaultIconID; }
void SetDefaultIconID(const DBid inValue) { mDefaultIconID = inValue; }
void LoadCustomFields(DB_ClassDescriptor *desc);
virtual void FillDataReport(CTCS_Table *table, CNeoStream *stream) const;
virtual void SetEndSafetyTag() { mEndSafetyTag = tag_endsafetytag; }
protected:
// stored arrays
TMemberArray mCustomFieldArray;
TTagArray mIndexedFieldArray; // TCS 2/14/03
CTextString mSpareText; // TCS 2/14/03. NOT USED-- formerly for help text
// stored members (all calculated-- we never copy this class)
DBid mOwnerID, // changed from UInt8 TCS 9/30/00
mCurrentRecord,
mCurrentPrintForm,
mDefaultIconID;
UInt8 mRecentFormType,
mWindowState,
mWindowOrder; // TCS 11/18/00
// *** NEVER insert members before this bitfield!!!
UInt8 mWindowIsStored:1,
mShowsBlankDate:1, // TCS 4/11/01
mNeedsMainAccount:1,
mNeedsJobAccount:1,
mNeedsCategory:1,
mWindowIsShaded:1, // TCS 7/23/01
mWindowIsDocked:1, // TCS 9/23/02
mNewShowsTemplates:1; // TCS 11/27/03
TCS_Rect mWindowBounds,
mDockedWindowBounds; // TCS 9/23/02
UInt16 mWindowParams; // TCS 11/28/00 rev 4/10/01
UInt8 mRecentPrintRange,
mOpenToBreakdown, // TCS 3/11/03
mNewRowCostArea,
mExpansionEnum;
CMoney mExpansionMoney;
TagType mEndSafetyTag; // TCS 9/8/02
// temporary members (non-persistent)
// - DO NOT ADD TO cCopyFileLength or cFileLength rev TCS 3/9/01
UInt8 mIsCurrentlyDisplayed:1,
mWasChangedRemotely:1,
filler:6;
UInt8 mOCIPadding;
enum
{
cCopyFileLength = 0,
cFileLength = cCopyFileLength + 4*sizeof(DBid) +
4*sizeof(UInt8) +
2*sizeof(TCS_Rect) +
sizeof(UInt16) +
sizeof(DBid) +
sizeof(CMoney) +
sizeof(TagType)
};
}; |