#ifndef RECCOON_MENU_H
#define RECCOON_MENU_H TRUE
/*
**  $Filename: Reccoon/Menu.h $
**  $Release: 0.65 $
**  $Revision: 65.1 $
**  $Date: 95/11/08 $
**
**  Reccoon menu commands and structures.
**
**  (C) Copyright 1991-94 Niclas Emdelius.
**  (C) Copyright 1995    Henric Andersson.
**          All Rights Reserved
*/

#ifndef RECCOON_RECCOON_H
#include <Reccoon/Reccoon2.h>
#endif

#define MNU_PROMPT 100
#define MNU_FILENAME (PATHSIZE+30)
#define MNU_ARGS 60

/*** These new structures are NOT active yet!  But they WILL be, I promise! ***/

struct new_Menu
{
    struct new_MenuFile *   menufiles;
    struct new_PromptFile * prompts;
    struct new_MenuKey *    keys;

    unsigned int        selectable :1;  // Ehum? What is this for? (Can't remember, unused)
    unsigned int        hotkeyed   :1;
    unsigned int        unused     :30;
};

struct new_MenuFile
{
    struct new_MenuFile *   next;
    UWORD           minaccess;
    UWORD           maxaccess;
    UBYTE           filename[MNU_FILENAME];
};

struct new_PromptFile
{
    struct new_MenuFile *   next;
    UWORD           minaccess;
    UWORD           maxaccess;
    UBYTE           filename[MNU_FILENAME];
};

struct new_MenuKey
{
    struct new_MenuKey *    next;
    struct new_MenuComm *   comms;
    UBYTE           key[16];
};

struct new_MenuComm
{
    struct new_MenuComm *   next;
    UWORD           minaccess;
    UWORD           maxaccess;
    UWORD           bitmask;
    UWORD           bits;
    UWORD           comm;
    UBYTE           args[MNU_ARGS];
};

/*** Here comes the old menustructures. ***/

struct menufunc
{
    UBYTE       menu_min[64];       // Min access
    UBYTE       menu_max[64];       // Max access
    UBYTE       menu_function[64];  // Menu function
    UBYTE       menu_args[64][50];  // Menu argument(s?)
};

struct menu
{
    unsigned int        hotkey :1;      // 1= Hotkeyed menu (unused)
    unsigned int        unused :31;
    UBYTE           menu_file[20];      // Default menu file name
    UBYTE           menu_prompt[20];    // Default prompt file name
    struct   menufunc   entry[5];       // Menu functions
};

/*** Menu commands, common for both FPL and Rcn menus  ***/

#define LOGOFF              1 // LogOff user.                               (Textfile)
#define LOG                 2 // Enter line in logfile                      Textline
#define YELL                3 // page Sysop
#define LINKMENU            4 // Jump to another menu                       MenuPage
#define EXECUTE             5 // Execute a DOS command                      (Command)
#define PREVIOUS            6 // Link previous Menu
#define PUTBUFF             7 // Put string to input buffer                 String
#define DROPBUFF            8 // Clear input buffer
#define USERLIST            9 // Show the UserList
#define RUNDOOR             10 // Run a Reccoon door program                Name
#define MSGAREA             11 // Goto a certain Msg area                   (Areanum)
#define QUEST               12 // Give user questions                       FileName
#define SHOWMENU            13 // Show current menu
#define GETRETURN           14 // Wait for return key                       (Prompt)
#define SHOWFILE            15 // Show a text file                          FileName
#define ECHO                16 // Send a string to user                     String
#define CLS                 17 // Clear Screen
#define EXPSHOWMENU         18 // SHOWMENU - ignore expertmode
#define PARRUNDOOR          19 // Run Paragon door                          FileName
#define PASSWORD            20 // Prompt for Password                       Password

#define WRITE               21 // Write a message                           (To)
#define WAITINGMAIL         23 // Check for waiting mail
#define BACKMSGAREA         24 // Goto msgarea-1
#define NEXTMSGAREA         25 // Goto next message area
#define READFORWARD         26 // Read messages forward                     (start)
#define READNEW             27 // Read new messages
#define READREVERSE         28 // Read reverse                              (start)
#define READMARKED          29 // Read marked messages
#define GLOBALREADNEW       30 // Global readnew                            (SIG)
#define SEARCHNODELIST      31 // Search the Nodelist                       (Searchstring)
#define SCANMSG             32 // Scan messages                             (Searchstring)
#define MSGSIG              33 // Change message SIG                        (SIG)
#define LISTMSGAREAS        34 // List message areas
#define LISTMSGSIGS         35 // List message SIGs

#define PRM_MENU            40 // Change menu type                          (type)
#define PRM_HANDLE          41 // Change handle                             (handle)
#define PRM_SCRLENGTH       42 // Change screen length                      (length)
#define PRM_USERNAME        43 // Change username                           (Name)
#define PRM_CITY            44 // Change City                               (City)
#define PRM_ACCESS          45 // Change Access level                       (Access)
#define PRM_TELE            46 // Change Telenr                             (Tele)
#define PRM_COMPUT          47 // Change computer                           (comp#)
#define PRM_EXPERT          48 // Toggle expertmode                         (on/off)
#define PRM_HOTKEYS         49 // Toggle HotKeys                            (on/off)

// Also take a look at menucommands 70-79

#define GOFILEAREA          50 // Go to a file area                         (Area)
#define DOWNLOAD            51 // Download marked files.
#define MARKFILE            52 // Markfile                                  (Filename)
#define DOSMARKFILE         53 // Mark DOS file                             (Filename)
#define ADDFILE             54 // Add a file to current area                (filename)
#define NEXTFILAREA         55 // Go to next file area
#define BACKFILAREA         56 // Go to filearea-1
#define LIMARKEDFIL         57 // List marked files
#define UPLOAD              58 // Upload file(s)
#define FILESIG             59 // Change file-SIG                           (SIG)
//#define LISTALLFILES 60   // list all files.
#define LISTFILAREAS        61 // List message areas
#define LISTFILSIGS         62 // List message SIGs
//#define LISTNEWFILES 63   // List new files
//#define GLOBALLISTNEWFILES 64 // List new files global
#define REMOVEFILES         65 // Remove files from markedfiles
//#define LISTSEARCH 66     // List files with searchstring                 (string)
//#define GLBLISTSEARCH 67  // Global list files w/ search                  (string)
#define VIEWARCHIVE         68 // View archive contents                     (Filename)
#define PRM_PROTOCOL        69 // Change users ul/dl protocol               none (Yet)

#define PRM_ZIP             70 // Change ZipCode                            (Zip)
#define PRM_FSED            71 // Toggle FSEditor                           (On/Off)
#define PRM_CLUDGES         72 // Toggle MessageCludges                     (On/Off)
#define PRM_LASTREAD        73 // *Set lastread-pointers                    (Pointer)
#define PRM_PASSWORD        74 // Change password                           (password)
#define PRM_XLATE           75 // Character translation                     (number)
#define PRM_BIRTH           76 // Birthday                                  (YYMMDD)
#define PRM_OPTIMIZE        77 // Optimize textoutput                       (On/Off)
#define PRM_ADDRESS         78 // Change address                            (address)

#define PREVMSGAREA         80 // Previous Msgarea
#define PREVFILAREA         81 // Previous Filearea
#define SIG                 82 // Change both file&msg SIG                  (SIG)
#define BRODCAST            83 // Send message to all nodes                 (string)
#define RETURNFPL           84 // Return to FPL-Script
#define SHOWNONSTOP         85 // Show a textfile without pauses            Filename
#define SHOWANYFILE         86 // Show a textfile with full path            Path&Filename
#define SHOWANYNONSTOP      87 // Show a textfile nonstop with path         Path&Filename

#define GLBLIST_NS_ALL      90 // Global-list, Nosort, all                  (Sig)
#define GLBLIST_NS_NEW      91 // Global-list, Nosort, new                  (Sig)
#define GLBLIST_NS_SEARCH   92 // Global-list, Nosort, search               (String)
#define GLBLIST_NS_SEARCHUL 93 // Global-list, Nosort, search uploader      (Name)
#define GLBLIST_NS_UNVAL    94 // Global-list, Nosort, list unval           (Sig)

#define GLBLIST_ON_ALL      95 // Global-list, Old-new, all                 (Sig)
#define GLBLIST_ON_NEW      96 // Global-list, Old-new, new                 (Sig)
#define GLBLIST_ON_SEARCH   97 // Global-list, Old-new, search              (String)
#define GLBLIST_ON_SEARCHUL 98 // Global-list, Old-new, search uploader     (Name)
#define GLBLIST_ON_UNVAL    99 // Global-list, Old-new, list unval          (Sig)

#define GLBLIST_NO_ALL      100 // Global-list, New-old, all                (Sig)
#define GLBLIST_NO_NEW      101 // Global-list, New-old, new                (Sig)
#define GLBLIST_NO_SEARCH   102 // Global-list, New-old, search             (String)
#define GLBLIST_NO_SEARCHUL 103 // Global-list, New-old, search uploader    (Name)
#define GLBLIST_NO_UNVAL    104 // Global-list, New-old, list unval         (Sig)

#define GLBLIST_A_ALL       132 // Global-list, Alpha, all                  (Sig)
#define GLBLIST_A_NEW       133 // Global-list, Alpha, new                  (Sig)
#define GLBLIST_A_SEARCH    134 // Global-list, Alpha, search               (String)
#define GLBLIST_A_SEARCHUL  135 // Global-list, Alpha, search uploader      (Name)
#define GLBLIST_A_UNVAL     136 // Global-list, Alpha, list unval           (Sig)

#define LIST_NS_ALL         105 // List, Nosort, all                        (Area)
#define LIST_NS_NEW         106 // List, Nosort, new                        (Area)
#define LIST_NS_SEARCH      107 // List, Nosort, search                     (String)
#define LIST_NS_SEARCHUL    108 // List, Nosort, search uploader            (Name)
#define LIST_NS_UNVAL       109 // List, Nosort, list unval                 (Area)

#define LIST_ON_ALL         110 // List, Old-new, all                       (Area)
#define LIST_ON_NEW         111 // List, Old-new, new                       (Area)
#define LIST_ON_SEARCH      112 // List, Old-new, search                    (String)
#define LIST_ON_SEARCHUL    113 // List, Old-new, search uploader           (Name)
#define LIST_ON_UNVAL       114 // List, Old-new, list unval                (Area)

#define LIST_NO_ALL         115 // List, New-old, all                       (Area)
#define LIST_NO_NEW         116 // List, New-old, new                       (Area)
#define LIST_NO_SEARCH      117 // List, New-old, search                    (String)
#define LIST_NO_SEARCHUL    118 // List, New-old, search uploader           (Name)
#define LIST_NO_UNVAL       119 // List, New-old, list unval                (Area)

#define LIST_A_ALL          137 // List, Alpha, all                         (Area)
#define LIST_A_NEW          138 // List, Alpha, new                         (Area)
#define LIST_A_SEARCH       139 // List, Alpha, search                      (String)
#define LIST_A_SEARCHUL     140 // List, Alpha, search uploader             (Name)
#define LIST_A_UNVAL        141 // List, Alpha, list unval                  (Area)

#define RUNAREXX            120 // Launch an ARexx-script                   Filename
#define FPLHOOK             121 // Call a FPL-Hook                          FunctionName
#define SIMPLEDOS           122 // Execute a DOS-command. No input.         Command
#define SETNODESTATUS       123 // Set status for current node              String
#define RUNFPL              124 // Run a fpl-script                         Filename
#define DOSDOOR             125 // Run a DOS-door                           Commandline
#define BIRTHDAY            126 // Checks for user birthday (And displays Birthday)

#define TOGMSGTAG           127 // Toggles msgtag for area X                (Area)
#define TOGFILETAG          128 // Toggles filetag for area X               (Area)
#define LINKFILE            129 // Like LinkMenu, but uses the defined page from FileBase
#define LINKMSG             130 // Like LinkMenu, but uses the defined page from MsgBase
#define ENTERCHAT           131 // Starts the chat (USE WITH CARE!)
#define GLOBALMARKFILE      142 // Marks file(s) globally                   (FileName)

// FPL only commands

enum{
    FPLM_GETKEY=20000,  // Get menuchoise from user     [bool noecho, bool nowait, bool hotkey]
    FPLM_SETMENU,       // Set menu textfile            <string Filename>
    FPLM_SETPROMPT,     // Set prompt textfile          <string filename>
    FPLM_GETLEVEL,      // Get user's accesslevel       none
    FPLM_GETGFX,        // Get user's graphicsmode      none
    FPLM_GETNAME,       // Get user's name              none
    FPLM_GETHANDLE,     // Get user's handle            none
    FPLM_GETMSGSIG,     // Get current msgSIG           none
    FPLM_GETMSGAREA,    // Get current msgarea          none
    FPLM_GETFILESIG,    // Get current fileSIG          none
    FPLM_GETFILEAREA,   // Get current filearea         none
    FPLM_GETAGE,        // Get user's age               none
    FPLM_SETMENUNUM,    // Set current menu-number      <number>
    FPLM_GETMENUNUM,    // Get current menu-number      none
    FPLM_GETULB,        // Get bytes upload             none
    FPLM_GETULF,        // Get files upload             none
    FPLM_GETDLB,        // Get bytes download           none
    FPLM_GETDLF,        // Get files download           none
    FPLM_GETSTRING,     // Get string from user         <maxlength> [flags]
    FPLM_GETTIMEUSED,   // Get time used                none
    FPLM_GETTIMELEFT,   // Get remaning time            none
    FPLM_ADDTIME,       // Add time to user             <minutes>
    FPLM_GETLINE,       // Get current line-number      none
    FPLM_YESNO,         // Prompt user for Y/n          <prompt> [Y-key] [N-key]
    FPLM_NOYES,         // Prompt user for y/N          <prompt> [Y-key] [N-key]
    FPLM_GETBPS,        // Get current BPS-rate (modem<>modem)  none
    FPLM_GETBAUD,       // Get current linkbaud (dtr<>modem)    none
    FPLM_COOKSTRING,    // Use cookstring to format string  <String>
    FPLM_GETUSERNR      // Get current user number      <none>
};

/* All standard-lib functions are not yet implmemended */

// FPL standard-lib functions. Almost like the ANSI-C standard.

// file-functions.

enum{
    FPLST_FCLOSE=30000, // fclose()
    FPLST_FFLUSH,       // fflush()
    FPLST_FOPEN,        // fopen()
    FPLST_FREOPEN,      // freopen()
    FPLST_FPRINTF,      // fprintf() (future)
    FPLST_FSCANF,       // fscanf()  (future)
    FPLST_FGETC,        // fgetc()
    FPLST_FGETS,        // fgets()
    FPLST_FPUTC,        // fputc()
    FPLST_FPUTS,        // fputs()
    FPLST_FREAD,        // fread()
    FPLST_FWRITE,       // fwrite()
    FPLST_FGETPOS,      // fgetpos()
    FPLST_FSEEK,        // fseek()
    FPLST_FSETPOS,      // fsetpos()
    FPLST_FTELL,        // ftell()
    FPLST_REWIND,       // rewind()
    FPLST_FEOF,         // feof()
    FPLST_FERROR,       // ferror()
    FPLST_PRINTF,       // printf()  (not stdio)
    FPLST_SPRINTF,      // sprintf()
    FPLST_PUTS,         // puts()    (not stdio)

// String functions  (fpl got some built-in functions too)

    FPLST_STRCPY,       // strcpy()
    FPLST_STRNCPY,      // strncpy()
    FPLST_STRICMP       // stricmp()
};


/*** Want more commands?  Give me suggestions! ***/

#endif
