planner-scale-utils.h 2.33 KB
Newer Older
Richard Hult's avatar
Richard Hult committed
1 2
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
Richard Hult's avatar
Richard Hult committed
3
 * Copyright (C) 2005 Imendio AB
Richard Hult's avatar
Richard Hult committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 * Copyright (C) 2002 CodeFactory AB
 * Copyright (C) 2002 Richard Hult <richard@imendio.com>
 * Copyright (C) 2002 Mikael Hallendal <micke@imendio.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
Josué Abarca's avatar
Josué Abarca committed
20 21
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
Richard Hult's avatar
Richard Hult committed
22 23
 */

Richard Hult's avatar
Richard Hult committed
24 25
#ifndef __PLANNER_SCALE_UTILS_H__
#define __PLANNER_SCALE_UTILS_H__
Richard Hult's avatar
Richard Hult committed
26 27 28

#include <libplanner/mrp-time.h>

Richard Hult's avatar
Richard Hult committed
29
#if 0
Richard Hult's avatar
Richard Hult committed
30

Richard Hult's avatar
Richard Hult committed
31 32 33 34 35 36 37 38 39
YEAR,     /* Short: N/A     Medium: 2002      Long: N/A         */
HALFYEAR, /* Short: N/A     Medium: H1        Long: 2002, H1    */
QUARTER,  /* Short: Q1      Medium: N/A       Long: 2002, Qtr 1 */
MONTH,    /* Short: J       Medium: Jan       Long: Jan '02     */
WEEK,     /* Short: Wk 19   Medium: Week 19   Long: Week 19 '02 */
DAY,      /* Short: 1       Medium: Mon 1     Long: Mon, Apr 1  */
HALFDAY,  /* Short: 1       Medium: 1         Long: 1           */
TWO_HOURS,/* Short: 1       Medium: 1         Long: 1           */
HOUR      /* Short: 1       Medium: 1         Long: 1           */
Richard Hult's avatar
Richard Hult committed
40

Richard Hult's avatar
Richard Hult committed
41
#endif
Richard Hult's avatar
Richard Hult committed
42 43

typedef enum {
Richard Hult's avatar
Richard Hult committed
44 45 46 47
	PLANNER_SCALE_FORMAT_SHORT,
	PLANNER_SCALE_FORMAT_MEDIUM,
	PLANNER_SCALE_FORMAT_LONG
} PlannerScaleFormat;
Richard Hult's avatar
Richard Hult committed
48 49

typedef struct {
Richard Hult's avatar
Richard Hult committed
50
	MrpTimeUnit        major_unit;
Richard Hult's avatar
Richard Hult committed
51
	PlannerScaleFormat major_format;
52

Richard Hult's avatar
Richard Hult committed
53
	MrpTimeUnit        minor_unit;
Richard Hult's avatar
Richard Hult committed
54
	PlannerScaleFormat minor_format;
Richard Hult's avatar
Richard Hult committed
55 56

	/* Nonworking intervals shorter than this is not drawn (seconds). */
Richard Hult's avatar
Richard Hult committed
57
	gint               nonworking_limit;
Richard Hult's avatar
Richard Hult committed
58
} PlannerScaleConf;
Richard Hult's avatar
Richard Hult committed
59

Richard Hult's avatar
Richard Hult committed
60
extern const PlannerScaleConf *planner_scale_conf;
Richard Hult's avatar
Richard Hult committed
61

Richard Hult's avatar
Richard Hult committed
62
gchar * planner_scale_format_time (mrptime            t,
Richard Hult's avatar
Richard Hult committed
63
				   MrpTimeUnit   unit,
Richard Hult's avatar
Richard Hult committed
64 65
				   PlannerScaleFormat format);
gint    planner_scale_clamp_zoom  (gdouble            zoom);
Richard Hult's avatar
Richard Hult committed
66 67


Richard Hult's avatar
Richard Hult committed
68
#endif /* __PLANNER_SCALE_UTILS_H__ */