KPWorkout

KPWorkout — Calendar entry that represents a basic workout

Synopsis




            KPWorkoutParam;
KPWorkout*  kp_workout_new                  (void);
gboolean    kp_workout_is_valid             (KPWorkout *wo);
KPWorkout*  kp_workout_copy                 (KPWorkout *wo);
void        kp_workout_set_sport            (KPWorkout *wo,
                                             const gchar *sport);
const gchar* kp_workout_get_sport           (KPWorkout *wo);
void        kp_workout_set_comment          (KPWorkout *wo,
                                             const gchar *comment);
gchar*      kp_workout_get_comment          (KPWorkout *wo);
gchar*      kp_workout_get_formatted_date   (KPWorkout *wo);
KPParamList* kp_workout_get_param_list      (KPWorkout *wo);
void        kp_workout_print                (KPWorkout *wo);
gchar*      kp_workout_get_duration_str     (KPWorkout *wo);

Description

Details

KPWorkoutParam

typedef struct {
  gchar *param;
  gchar *value;
} KPWorkoutParam;


kp_workout_new ()

KPWorkout*  kp_workout_new                  (void);

Create a new instance of KPWorkout.

Returns : A new KPWorkout.

kp_workout_is_valid ()

gboolean    kp_workout_is_valid             (KPWorkout *wo);

Check the validity of the KPWorkout.

wo : A KPWorkout
Returns : TRUE if workout is valid and FALSE otherwise.

kp_workout_copy ()

KPWorkout*  kp_workout_copy                 (KPWorkout *wo);

Copies all the data of wo and returns the copied workout.

wo : A KPWorkout
Returns : A newly-allocated copy of wo.

kp_workout_set_sport ()

void        kp_workout_set_sport            (KPWorkout *wo,
                                             const gchar *sport);

Set the sport of the workout.

wo : A KPWorkot
sport : The name of the sport, can be NULL.

kp_workout_get_sport ()

const gchar* kp_workout_get_sport           (KPWorkout *wo);

Get the sport of the workout.

wo : A KPWorkout
Returns : String that must NOT be freed.

kp_workout_set_comment ()

void        kp_workout_set_comment          (KPWorkout *wo,
                                             const gchar *comment);

Set the comment of the workout.

wo : A KPWorkout
comment : Comment string

kp_workout_get_comment ()

gchar*      kp_workout_get_comment          (KPWorkout *wo);

Get the comment of the workout.

wo : A KPWorkout
Returns : A newly-allocated string that must be freed.

kp_workout_get_formatted_date ()

gchar*      kp_workout_get_formatted_date   (KPWorkout *wo);

wo : a KPWorkout.
Returns : date in format CCYY-MM-DDThh:mm:ss. Result-string is malloc'd, so it must be freed.

kp_workout_get_param_list ()

KPParamList* kp_workout_get_param_list      (KPWorkout *wo);

wo :
Returns :

kp_workout_print ()

void        kp_workout_print                (KPWorkout *wo);

wo :

kp_workout_get_duration_str ()

gchar*      kp_workout_get_duration_str     (KPWorkout *wo);

wo :
Returns :