#ifndef GP_EXTPREFS_H
#define GP_EXTPREFS_H
/*
**  $VER: extprefs.h 1.0 (23.9.97)
**
**  Structures and constants for communication between GetPayed and
**  Extension preferences routines.
**
**  ©1997 TigerSoft
*/

#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif
#ifndef EXEC_PORTS_H
#include <exec/ports.h>
#endif
#ifndef INTUITION_SCREENS_H
#include <intuition/screens.h>
#endif
#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif

/*
** Message header for commonication between GetPayed and extension
** preferences routines
*/

struct ExtPrefMsg {
    struct Message Msg; /* Standard Exec message */
    UWORD          Action; /* Type of action this message dictates */
    WORD           pad; /* Long allign --unused-- keep it NUL */
    LONG           ExtID; /* Unique ID for the extension. */
                          /* Read this in the startup message, then use */
                          /*  it when sending messages to GetPayed. */

    APTR            Project; /* The project the preferences is for */
    APTR            MemPool; /* The MemPool that was given to ioReadPrefs() */
    APTR            Prefs; /* A preference object as obtained by ioCreatePrefs()
                             or rhCreateRule().
                             NULL means that project currently uses the default
                             built-in preferences of your IO extension. */

    struct TagItem *Tags; /* Taglist with further information (see tags below).
                             Be prepared to handle a NULL ptr */
};

/* Action types */
#define PREFMSG_ACTION_STARTUP      0   /* A startup message */
#define PREFMSG_ACTION_STARTFAIL    1   /* Preferences failed to open */
#define PREFMSG_ACTION_TERMINATE    2   /* A termination message */
#define PREFMSG_ACTION_CHNGPREF     3   /* Preference object has changed */
#define PREFMSG_ACTION_ACTIVATE     4   /* Bring GUI to front and activate it */
#define PREFMSG_ACTION_SCRJUMP      5   /* GetPayed has jumped to another screen */
#define PREFMSG_ACTION_HIDE         6   /* GetPayed has been iconified - hide your GUI */
#define PREFMSG_ACTION_SHOW         7   /* GetPayed has been uniconified - show yourself */

/* Tags for ExtPrefMsg.Tags */
#define EPMT_DUMMY      TAG_USER    /* dummy tag value offset */
#define EPMT_SCREEN     EPMT_DUMMY+1  /* Ptr on the name of the public screen GetPayed
                                         has it's window on.
                                         Be prepared to handle a NULL ptr - simply open
                                         on default public screen in this case */
#define EPMT_PREFSTYPE  EPMT_DUMMY+2  /* Type of preferences to show for an IO extension.
                                         This indicates which type, Report IO or Project IO,
                                         the preferences window is opened for.
                                         More types may be defined in the future!
                                         See definitions below. */

/* ti_Data for EPTM_PREFSTYPE tag */
#define PREFSTYPE_PROJECT   0
#define PREFSTYPE_REPORT    1

#endif /* GP_EXTPREFS_H */
