⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tododb.h

📁 个人日程管理系统
💻 H
字号:
/******************************************************************************
 *
 * Copyright (c) 1995-1999 Palm Computing, Inc. or its subsidiaries.
 * All rights reserved.
 *
 * File: ToDoDB.h
 *
 * Description:
 *		Header for the To Do Manager
 *
 * History:
 *   	1/19/95  rsf - Created
 *		10/4/99	jmp - Added 
 *
 *****************************************************************************/

#ifndef __TDTODOMGR_H__
#define __TDTODOMGR_H__

#include <DateTime.h>

#define LocalizedAppInfoStr	1000

#define todoLabelLength			12
#define todoNumFields			16

#define toDoMaxPriority			5

// Dirty flags for to do application info
#define toDoSortByPriorityDirty	0x0001

// Sort orders
#define soDueDatePriority		0
#define soPriorityDueDate		1
#define soCategoryPriority		2
#define soCategoryDueDate		3


typedef struct {
    UInt16			renamedCategories;	// bitfield of categories with a different name
	char 				categoryLabels[dmRecNumCategories][dmCategoryLength];
	UInt8 			categoryUniqIDs[dmRecNumCategories];
	UInt8				lastUniqID;	// Uniq IDs generated by the device are between
										// 0 - 127.  Those from the PC are 128 - 255.
	UInt8				reserved1;	// from the compiler word aligning things
	UInt16			reserved2;
	UInt16			dirtyAppInfo;
	UInt8				sortOrder;
	UInt8				reserved3;
} ToDoAppInfoType;

typedef ToDoAppInfoType * ToDoAppInfoPtr;

// ToDoDBRecord.
//
// All strings are null terminated and appear within the record.
//
typedef struct {
	DateType dueDate;
	UInt8 priority;		// high bit is complete flag
	char description;
} ToDoDBRecord;

typedef ToDoDBRecord				ToDoDBRecordType;
typedef ToDoDBRecord*			ToDoDBRecordPtr;

// sizeDBRecord is the minimum size for the ToDoDBRecord structure.
// It assumes empty 'description' and 'note' fields.
// sizeDBRecord allocates an extra byte for the null character
// for the note string.
#define sizeDBRecord (sizeof (ToDoDBRecord) + 1)

// ToDoItemType
//
// This is the format of a to do record used by the application.  All 
// pointers are either NULL or point to data within the PackedDB record.
// All strings are null character terminated.
//
typedef struct {
	DateType 			dueDate;
	UInt8 				priority;		// high bit is complete flag
	UInt8					reserved;
	Char *				description;
	Char *				note;
} ToDoItemType;

typedef ToDoItemType * ToDoItemPtr;


#define completeFlag 	0x80
#define priorityOnly 	~completeFlag
#define toDoNoDueDate	0xffff


// Used for ToDoChangeRecord.
typedef enum  { 
	toDoPriority,
	toDoComplete,
	toDoDueDate,
	toDoDescription,
	toDoNote,
	toDoCategory } ToDoRecordFieldType;



#ifdef __cplusplus
extern "C" {
#endif


//-------------------------------------------------------------------
// Routines
//-------------------------------------------------------------------
// sections support added by L. Burgbacher for progect
#define TODOSECT __attribute__ ((section ("todosect")))

Err ToDoNewRecord(DmOpenRef dbP, ToDoItemPtr item, UInt16 category, UInt16 *index) TODOSECT;

Err ToDoInsertNewRecord (DmOpenRef dbP, UInt16 * index) TODOSECT;

Err ToDoChangeRecord(DmOpenRef dbP, UInt16 * index, 
	ToDoRecordFieldType changedField, void * data) TODOSECT;

Err ToDoChangeSortOrder(DmOpenRef dbP, UInt8 sortOrder) TODOSECT;

Err ToDoAppInfoInit(DmOpenRef dbP) TODOSECT;

MemHandle ToDoGetAppInfo  (DmOpenRef dbP) TODOSECT;

UInt8 ToDoGetSortOrder (DmOpenRef dbP) TODOSECT;

void ToDoSort (DmOpenRef dbP) TODOSECT;

Err ToDoGetDatabase (DmOpenRef *dbPP, UInt16 mode) TODOSECT;

void ToDoSetDBBackupBit (DmOpenRef dbP) TODOSECT;


#ifdef __cplusplus
}
#endif


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -