Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

Specifying Recurring Dates (Periods)
[Query Object Framework]


Files

file  FreqSpec.h
 Period / Date Frequency Specification.


Typedefs

typedef enum gncp_FreqType FreqType
typedef enum gncp_UIFreqType UIFreqType
typedef gncp_freq_spec FreqSpec

Enumerations

enum  gncp_FreqType {
  INVALID, ONCE, DAILY, WEEKLY,
  MONTHLY, MONTH_RELATIVE, COMPOSITE
}
enum  gncp_UIFreqType {
  UIFREQ_NONE, UIFREQ_ONCE, UIFREQ_DAILY, UIFREQ_DAILY_MF,
  UIFREQ_WEEKLY, UIFREQ_BI_WEEKLY, UIFREQ_SEMI_MONTHLY, UIFREQ_MONTHLY,
  UIFREQ_QUARTERLY, UIFREQ_TRI_ANUALLY, UIFREQ_SEMI_YEARLY, UIFREQ_YEARLY,
  UIFREQ_NUM_UI_FREQSPECS
}

Functions

FreqSpec * xaccFreqSpecMalloc (QofBook *book)
void xaccFreqSpecCleanUp (FreqSpec *fs)
void xaccFreqSpecFree (FreqSpec *fs)
FreqType xaccFreqSpecGetType (FreqSpec *fs)
void xaccFreqSpecSetUIType (FreqSpec *fs, UIFreqType newUIFreqType)
UIFreqType xaccFreqSpecGetUIType (FreqSpec *fs)
void xaccFreqSpecSetNone (FreqSpec *fs)
void xaccFreqSpecSetOnceDate (FreqSpec *fs, const GDate *when)
void xaccFreqSpecSetDaily (FreqSpec *fs, const GDate *initial_date, guint interval_days)
void xaccFreqSpecSetWeekly (FreqSpec *fs, const GDate *inital_date, guint interval_weeks)
void xaccFreqSpecSetMonthly (FreqSpec *fs, const GDate *inital_date, guint interval_months)
void xaccFreqSpecSetMonthRelative (FreqSpec *fs, const GDate *inital_date, guint interval_months)
void xaccFreqSpecSetComposite (FreqSpec *fs)
void xaccFreqSpecGetFreqStr (FreqSpec *fs, GString *str)
int xaccFreqSpecGetOnce (FreqSpec *fs, GDate *outGD)
int xaccFreqSpecGetDaily (FreqSpec *fs, int *outRepeat)
int xaccFreqSpecGetWeekly (FreqSpec *fs, int *outRepeat, int *outDayOfWeek)
int xaccFreqSpecGetMonthly (FreqSpec *fs, int *outRepeat, int *outDayOfMonth, int *outMonthOffset)
GList * xaccFreqSpecCompositeGet (FreqSpec *fs)
void xaccFreqSpecCompositeAdd (FreqSpec *fs, FreqSpec *fsToAdd)
void xaccFreqSpecGetNextInstance (FreqSpec *fs, const GDate *in_date, GDate *out_date)
int gnc_freq_spec_compare (FreqSpec *a, FreqSpec *b)


Typedef Documentation

typedef enum gncp_FreqType FreqType
 

Frequency specification.

typedef enum gncp_UIFreqType UIFreqType
 

The user's conception of the frequency. It is expected that this list will grow, while the former [FreqType] will not.

Ideally this is not here, but what can you do?


Enumeration Type Documentation

enum gncp_FreqType
 

Frequency specification.

enum gncp_UIFreqType
 

The user's conception of the frequency. It is expected that this list will grow, while the former [FreqType] will not.

Ideally this is not here, but what can you do?


Function Documentation

int gnc_freq_spec_compare (  FreqSpec *  a,
FreqSpec *  b
) 
 

qsort-style comparison of FreqSpecs. More frequently-occuring FreqSpecs are sorted before less-frequent FreqSpecs. FIXME: What to do for composites?

void xaccFreqSpecCleanUp (  FreqSpec *  fs  ) 
 

destroys any private data belonging to the FreqSpec. Use this for a stack object.

void xaccFreqSpecCompositeAdd (  FreqSpec *  fs,
FreqSpec *  fsToAdd
) 
 

Adds a FreqSpec to the list in a COMPOSITE FreqSpec; if the FreqSpec is not COMPOSITE, this is an assertion failure.

GList* xaccFreqSpecCompositeGet (  FreqSpec *  fs  ) 
 

Returns the list of FreqSpecs in a COMPOSITE FreqSpec. It is an error to use this if the type is not COMPOSITE. The caller should not modify this list; only add/remove composites and use this fn to get the perhaps-changed list head.

void xaccFreqSpecFree (  FreqSpec *  fs  ) 
 

Frees a heap allocated FreqSpec. This is the opposite of xaccFreqSpecMalloc().

int xaccFreqSpecGetDaily (  FreqSpec *  fs,
int *  outRepeat
) 
 

DOCUMENT ME!

void xaccFreqSpecGetFreqStr (  FreqSpec *  fs,
GString *  str
) 
 

Returns a human-readable string of the Frequency. This uses UIFreqType to unroll the internal structure. It is an assertion failure if the FreqSpec data doesn't match the UIFreqType. Caller allocates the GString [natch].

int xaccFreqSpecGetMonthly (  FreqSpec *  fs,
int *  outRepeat,
int *  outDayOfMonth,
int *  outMonthOffset
) 
 

DOCUMENT ME!

void xaccFreqSpecGetNextInstance (  FreqSpec *  fs,
const GDate *  in_date,
GDate *  out_date
) 
 

Computes the next instance of the FreqSpec after a given input date. The object pointed at by 'out_date' is set to the computed value. The 'in_date' can be any date. It is gaurenteed that the 'out_date' is strictly greater than the 'in_date'. That is, if the 'in_date' happens to be a repeat date (e.g. a previous out_date), then the out_date will be the next repeat date after that.

int xaccFreqSpecGetOnce (  FreqSpec *  fs,
GDate *  outGD
) 
 

DOCUMENT ME!

FreqType xaccFreqSpecGetType (  FreqSpec *  fs  ) 
 

Gets the type of a FreqSpec.

UIFreqType xaccFreqSpecGetUIType (  FreqSpec *  fs  ) 
 

Returns the frequency part of the FreqSpec, specifically, one of the 'user-interface' enumerants.

int xaccFreqSpecGetWeekly (  FreqSpec *  fs,
int *  outRepeat,
int *  outDayOfWeek
) 
 

DOCUMENT ME!

FreqSpec* xaccFreqSpecMalloc (  QofBook *  book  ) 
 

Allocates memory for a FreqSpec and initializes it.

void xaccFreqSpecSetComposite (  FreqSpec *  fs  ) 
 

Sets the type to COMPOSITE. Disposes of any previous data. You must Add some repeats to the composite before using it for repeating.

void xaccFreqSpecSetDaily (  FreqSpec *  fs,
const GDate *  initial_date,
guint  interval_days
) 
 

Sets the type to DAILY. Disposes of any previous data. Uses the start date to figure out how many days after epoch (1/1/1900) this repeat would have first occurred on if it had been running back then. This is used later to figure out absolute repeat dates.

void xaccFreqSpecSetMonthly (  FreqSpec *  fs,
const GDate *  inital_date,
guint  interval_months
) 
 

Sets the type to MONTHLY. Disposes of any previous data. Uses the inital date to figure out the day of the month to use.

void xaccFreqSpecSetMonthRelative (  FreqSpec *  fs,
const GDate *  inital_date,
guint  interval_months
) 
 

Sets the type to MONTH_RELATIVE. Disposes of any previous data. Uses the inital date to figure out the day of the month to use.

void xaccFreqSpecSetOnceDate (  FreqSpec *  fs,
const GDate *  when
) 
 

Sets the type to once-off, and initialises the date it occurs on. Disposes of any previous data.

void xaccFreqSpecSetUIType (  FreqSpec *  fs,
UIFreqType  newUIFreqType
) 
 

Sets the type of a FreqSpec. Setting the type re-initializes any spec-data; this means destroying any sub-types in the case of COMPOSITE.

Warning:
THESE FUNCTIONS HAVE NOT BEEN MAINTAINED THROUGH BEN'S CHANGES. They need to be checked.

void xaccFreqSpecSetWeekly (  FreqSpec *  fs,
const GDate *  inital_date,
guint  interval_weeks
) 
 

Sets the type to WEEKLY. Disposes of any previous data. Uses the inital date to figure out the day of the week to use.


Generated on Sun May 23 15:41:47 2004 for QOF by doxygen 1.3.6-20040222