1 #ifndef CALENDAR_MCC_H
    2 #define CALENDAR_MCC_H
    3 
    4 /*
    5  *  Calendar.mcc
    6  *
    7  *  Copyright © 2023 Guido Mersmann <geit@geit.de>
    8  *  All rights reserved.
    9  *
   10  *  $Id: Calendar_mcc.h,v 1.26 2023/04/17 20:09:49 geit Exp $
   11  */
   12 
   13 #ifndef EXEC_TYPES_H
   14 #include <exec/types.h>
   15 #endif
   16 
   17 #ifndef LIBRARIES_CALENDAR_H
   18 #include <libraries/calendar.h>
   19 #endif
   20 
   21 #pragma pack(2)
   22 
   23 #define MUIC_Calendar  "Calendar.mcc"
   24 #define CalendarObject MUI_NewObject(MUIC_Calendar
   25 
   26 /* Attributes */
   27 
   28 #define TAGBASE_Calendar                           ( (TAG_USER | (0xfde0 << 16) ) + 0x8200 )
   29 #define MUIA_Calendar_Changed                      (TAGBASE_Calendar +  0)    /* ---N - (ULONG) */
   30 #define MUIA_Calendar_Day                          (TAGBASE_Calendar +  1)    /* ISGN - (ULONG) */
   31 #define MUIA_Calendar_Month                        (TAGBASE_Calendar +  2)    /* ISGN - (ULONG) */
   32 #define MUIA_Calendar_Year                         (TAGBASE_Calendar +  3)    /* ISGN - (ULONG) */
   33 #define MUIA_Calendar_ShowTitle                    (TAGBASE_Calendar +  4)    /* ISGN - (ULONG) */
   34 #define MUIA_Calendar_Mode                         (TAGBASE_Calendar +  6)    /* ISGN - (ULONG) */
   35 #define MUIA_Calendar_Compact                      (TAGBASE_Calendar +  7)    /* ISGN - (ULONG) */
   36 #define MUIA_Calendar_PeekOver                     (TAGBASE_Calendar +  8)    /* ISGN - (ULONG) */
   37 #define MUIA_Calendar_NotifyObject                 (TAGBASE_Calendar +  9)    /* ISG- - (Object*) - Object to send MUIM_Calendar_Notification to */
   38 #define MUIA_Calendar_CalendarDate                 (TAGBASE_Calendar + 10)    /* ISG- - (struct CalendarDate *) */
   39 #define MUIA_Calendar_DatabaseName                 (TAGBASE_Calendar + 11)    /* IS-- - (STRPTR) - calendar database file name */
   40 #define MUIA_Calendar_ShowImages                   (TAGBASE_Calendar + 12)    /* ISGN - (ULONG) - show contents images */
   41 #define MUIA_Calendar_ShowTimeLine                 (TAGBASE_Calendar + 13)    /* ISGN - (ULONG) - show contents time line */
   42 #define MUIA_Calendar_ShowWeekdays                 (TAGBASE_Calendar + 14)    /* ISGN - (ULONG) - show weekday names */
   43 #define MUIA_Calendar_CalendarDateBrowser          (TAGBASE_Calendar + 15)    /* ISG- - (struct CalendarDate *) - change view to this month/year */
   44 #define MUIA_Calendar_MonthBrowser                 (TAGBASE_Calendar + 16)    /* ISGN - (ULONG) - change view to specific month */
   45 #define MUIA_Calendar_YearBrowser                  (TAGBASE_Calendar + 17)    /* ISGN - (ULONG) - change view to specific year */
   46 #define MUIA_Calendar_DayClick                     (TAGBASE_Calendar + 18)    /* --GN - (ULONG) - notification when user clicks on day. read gives day value */
   47 #define MUIA_Calendar_DayDoubleClick               (TAGBASE_Calendar + 19)    /* --GN - (ULONG) - notification when user double clicks on day. read gives day value */
   48 #define MUIA_Calendar_ContextEventID               (TAGBASE_Calendar + 20)    /* --G- - (ULONG) - only valid within MUIM_ContextMenuBuild/MUIM_ContextMenuChoice */
   49 #define MUIA_Calendar_ContextCalendarDate          (TAGBASE_Calendar + 21)    /* --G- - (ULONG) - only valid within MUIM_ContextMenuBuild/MUIM_ContextMenuChoice */
   50 #define MUIA_Calendar_BrowserChanged               (TAGBASE_Calendar + 22)    /* ---N - (ULONG) - user changed day, month or year */
   51 
   52 
   53 /* Values for MUIA_Calendar_DayClick and MUIA_Calendar_DayDoubleClick 
   54 **
   55 ** GetAttr() on both entries will return the day number and the flags
   56 ** below to indicate if a day number is within the peek over range.
   57 **
   58 ** If MUIA_PeekOver is set to FALSE you can use the returned value
   59 ** right away. If your calendar object has peek over turned on, you
   60 ** MUST check the flags below to take a month change into evaluation.
   61 **
   62 ** For example if the calendar shows the month March and the user
   63 ** clicks on the 28th of Feburary. MUIA_Calendar_DayClick will return:
   64 ** ( 28 | MUIV_Calendar_DayClick_PreviousMonth )
   65 */
   66 
   67 #define MUIV_Calendar_DayClick_PreviousMonth        0x20000000   /* day is in previous month */
   68 #define MUIV_Calendar_DayClick_NextMonth            0x10000000   /* day is in next month */
   69 
   70 /* values for MUIA_Calendar_Mode */
   71 
   72 #define MUIV_Calendar_Mode_None                     0  /* no user side interaction possible */
   73 #define MUIV_Calendar_Mode_Days                     1  /* only the day can be modified by user */
   74 #define MUIV_Calendar_Mode_Full                     2  /* year, month and day can be modified by user */
   75 #define MUIV_Calendar_Mode_FullReadOnly             3  /* year, month and day can be modified by user, but
   76 													   ** there is no way the user can change the actual
   77 													   ** class date. Screenbar is using this mode, to allow
   78 													   ** looking into a date, see what weekday it has and
   79 													   ** if there is an entry. The cursor is only there to
   80 													   ** keep the users focus on that day, while the actual
   81 													   ** selection marks are unchangable. */
   82 
   83 /* values for MUIM_Calendar_Notification */
   84 
   85 #define MUIV_Calendar_NotifyMode_Click             0
   86 #define MUIV_Calendar_NotifyMode_DoubleClick       1
   87 
   88 /* Methods */
   89 
   90 #define MUIM_Calendar_ReadSystemDate               (TAGBASE_Calendar +  0)
   91 #define MUIM_Calendar_GetDaysInMonth               (TAGBASE_Calendar +  1)
   92 
   93 #define MUIM_Calendar_Notification                 (TAGBASE_Calendar + 11)
   94 
   95 /* Method Structure Messages */
   96 
   97 struct MUIP_Calendar_ReadSystemDate       { ULONG MethodID; };
   98 struct MUIP_Calendar_GetDaysInMonth       { ULONG MethodID; ULONG Month; ULONG Year; };
   99 
  100 struct MUIP_Calendar_Notification         { ULONG MethodID; ULONG NotificationMode; struct CalendarDate *CalendarDate; ULONG EventID; };  /* send to the class, when day entry got clicked */
  101 
  102 /* OBSOLETE DATA! DO NOT USE! */
  103 
  104 #define MUIV_Calendar_Mode_MonthYear    MUIV_Calendar_Mode_FullReadOnly
  105 #define MUIA_Calendar_ShowYear          (TAGBASE_Calendar +  5)    /* obsolete */
  106 
  107 #pragma pack()
  108 
  109 #endif /* CALENDAR_MCC_H */