001/**
002 * CalendarAPI.bbj
003 * @author ndecker
004 *
005 * The <code>CalendarAPI</code> is a BBj Custom Class that facilitates creating calendar objects, accessing constants, and is used in combination with the <code>BBjCalendarWidget</code>.
006 *
007 * For the full copyright and license information, please see the LICENSE.txt files distributed with this source code in the appropriate lib directory.
008 *
009 * @see <a href = 'https://fullcalendar.io' target = '_blank'>FullCalendar</a> for further information on the underlying JavaScript-based calendar.
010 *
011 * @since BBj 21.00
012*/
013package BBjCalendarWidget;
014import java.time.OffsetDateTime;
015import java.util.HashSet;
016import java.util.HashMap;
017import java.util.TreeMap;
018import java.util.Date;
019import java.io.File;
020import java.util.Vector;
021import java.text.SimpleDateFormat;
022import javax.script.ScriptEngineManager;
023import javax.script.ScriptEngine;
024import com.google.gson.Gson;
025import com.google.gson.JsonParser;
026import com.google.gson.JsonObject;
027import com.google.gson.JsonArray;
028import com.google.gson.JsonPrimitive;
029import com.google.gson.JsonElement;
030import com.google.gson.GsonBuilder;
031/**
032 * The <code>CalendarAPI</code> is a BBj Custom Class that facilitates creating calendar objects, accessing constants, and is used in combination with the <code>BBjCalendarWidget</code>.
033 *
034 * @since BBj 21.00
035*/
036public class CalendarAPI {
037/**
038 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code> method that signals that the <code>BBjCalendarWidget</code> is ready.
039 * <p>
040 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarReadyEvent.html' target = '_blank'>CalendarReadyEvent</a></code> object.
041*/
042public static BBjNumber ON_CALENDAR_READY() { }
043/**
044 * <p>
045 * <b>Note</b>: This <b>only</b> fires when the type of view changes, not when the user changes the view from one subtype to another. For example,
046 * the event <b>will</b> be triggered when the user switches from the <code>CalendarAPI.CALENDAR_VIEW_DAY_GRID_MONTH()</code> to the
047 * <code>CalendarAPI.CALENDAR_VIEW_LIST_MONTH()</code> view. But it <b>won't</b> be triggerd when the user changes from
048 * <code>CalendarAPI.CALENDAR_VIEW_DAY_GRID_MONTH()</code> to <code>CalendarAPI.CALENDAR_VIEW_DAY_GRID_WEEK()</code> since both views are
049 * the same type (dayGrid) and just the subtype (week vs. month) changes.
050 * <p>
051 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarViewChangeEvent.html' target = '_blank'>CalendarViewChangeEvent</a></code> object.
052*/
053public static BBjNumber ON_CALENDAR_VIEW_CHANGE() { }
054/**
055 * If you set a callback for this event, then add several entries to the calendar, your callback routine may be flooded because
056 * the event will fire for every event that you add.
057 * <p>
058 * When responding to this event, the <code>BBjAPI().getLastEvent()</code> call will return a <code>CalendarEntriesSetEvent</code> object.
059 * You can call the <code>CalendarEntriesSetEvent::getEntries()</code> method to return a BBjVector of <code>CalendarEntry</code> objects
060 * that corresponds to all the known entries in the calendar at that instant in time.
061 * <p>
062 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarEntriesSetEvent.html' target = '_blank'>CalendarEntriesSetEvent</a></code> object.
063 *
064 * @see <a href = 'https://documentation.basis.com/BASISHelp/WebHelp/index.htm#gridctrl/bbjvector_bbj.htm' target = '_blank'>BBjVector</a>.
065*/
066public static BBjNumber ON_CALENDAR_ENTRIES_SET() { }
067/**
068 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code> method that signals that the user has clicked on a calendar's event.
069 * <p>
070 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarEntryClickEvent.html' target = '_blank'>CalendarEntryClickEvent</a></code> object.
071*/
072public static BBjNumber ON_CALENDAR_ENTRY_CLICK() { }
073/**
074 * <p>
075 * <b>Note</b>: If you set a callback for this event, then add several events to the calendar, your callback routine may be flooded.
076 * <p>
077 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarEntryAddEvent.html' target = '_blank'>CalendarEntryAddEvent</a></code> object.
078*/
079public static BBjNumber ON_CALENDAR_ENTRY_ADD() { }
080/**
081 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code> method that signals that the calendar's event data has changed in any way.
082 * <p>
083 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarEntryChangeEvent.html' target = '_blank'>CalendarEntryChangeEvent</a></code> object.
084*/
085public static BBjNumber ON_CALENDAR_ENTRY_CHANGE() { }
086/**
087 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code> method that signals that the calendar's event data has changed in any way.
088 * <p>
089 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarEntryRemoveEvent.html' target = '_blank'>CalendarEntryRemoveEvent</a></code> object.
090*/
091public static BBjNumber ON_CALENDAR_ENTRY_REMOVE() { }
092/**
093 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code> method that signals that the user moved the mouse into the bounds of a calendar event.
094 * <p>
095 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarEntryMouseEnterEvent.html' target = '_blank'>CalendarEntryMouseEnterEvent</a></code> object.
096*/
097public static BBjNumber ON_CALENDAR_ENTRY_MOUSE_ENTER() { }
098/**
099 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code> method that signals that the user moved the mouse out of the bounds of a calendar event.
100 * <p>
101 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarEntryMouseLeaveEvent.html' target = '_blank'>CalendarEntryMouseLeaveEvent</a></code> object.
102*/
103public static BBjNumber ON_CALENDAR_ENTRY_MOUSE_LEAVE() { }
104/**
105 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code>
106 * method that signals that the user has started resizing an event by dragging one of its edges.
107 * <p>
108 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarEntryEvent.html' target = '_blank'>CalendarEntryEvent</a></code> object.
109*/
110public static BBjNumber ON_CALENDAR_ENTRY_RESIZE_START() { }
111/**
112 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code>
113 * method that signals that the user has stopped resizing an event. This event will be triggered after the user resizes an event by dragging one of its
114 * edges, even if the event doesn't change in duration. It is also triggered <b>before</b> the <code>ON_CALENDAR_ENTRY_RESIZE()</code> event is triggered.
115 * <p>
116 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarEntryEvent.html' target = '_blank'>CalendarEntryEvent</a></code> object.
117*/
118public static BBjNumber ON_CALENDAR_ENTRY_RESIZE_STOP() { }
119/**
120 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code>
121 * method that signals that the user has stopped resizing an event by dragging one of its edges and the event now has a different duration.
122 * <p>
123 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarEntryResizeEvent.html' target = '_blank'>CalendarEntryResizeEvent</a></code> object.
124*/
125public static BBjNumber ON_CALENDAR_ENTRY_RESIZE() { }
126/**
127 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code>
128 * method that signals that the user has started dragging an entry. In other words, the user has started to reposition the entire entry in the calendar
129 * as opposed to resizing the entry by dragging one of its edges.
130 * <p>
131 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarEntryEvent.html' target = '_blank'>CalendarEntryEvent</a></code> object.
132 * Note that both the <code>ON_CALENDAR_ENTRY_DRAG_START()</code> and <code>ON_CALENDAR_ENTRY_DRAG_STOP()</code> events result in a <code>CalendarEntryEvent</code> object, but
133 * the native HTML element object associated with the event will be empty.
134*/
135public static BBjNumber ON_CALENDAR_ENTRY_DRAG_START() { }
136/**
137 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code>
138 * method that signals that the user has stopped dragging an entry. In other words, the user has repositioned the entire entry in the calendar
139 * as opposed to resizing the entry by dragging one of its edges. This event is triggered after the user drags an entry, even if the entry doesn't
140 * change its date/time. It is triggered <b>before</b> the entry's information has been modified (if moved to a new date/time) and before the
141 * <code>ON_CALENDAR_ENTRY_DROP</code> callback is triggered. Because the event occurs before the entry has been modified, the entry will be
142 * the same as the <code>ON_CALENDAR_ENTRY_DRAG_START</code> event.
143 * <p>
144 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarEntryEvent.html' target = '_blank'>CalendarEntryEvent</a></code> object.
145 * Note that both the <code>ON_CALENDAR_ENTRY_DRAG_START()</code> and <code>ON_CALENDAR_ENTRY_DRAG_STOP()</code> events result in a <code>CalendarEntryEvent</code> object, but
146 * the native HTML element object associated with the event will be empty.
147*/
148public static BBjNumber ON_CALENDAR_ENTRY_DRAG_STOP() { }
149/**
150 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code>
151 * method that signals that the user has finished dragging and dropping the entry to a different day/time. In other words, the user has repositioned the entire entry in the calendar
152 * as opposed to resizing the entry by dragging one of its edges.
153 * <p>
154 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarEntryDropEvent.html' target = '_blank'>CalendarEntryDropEvent</a></code> object.
155*/
156public static BBjNumber ON_CALENDAR_ENTRY_DROP() { }
157/**
158 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code> method that signals that the calendar has received an external draggable element with event data from another source or another calendar.
159 * <p>
160 * <b>Note</b>: This event has not yet been implemented.
161*/
162public static BBjNumber ON_CALENDAR_ENTRY_RECEIVE() { }
163/**
164 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code> method that signals that the user is about to drop one of the calendar events on to another calendar.
165 * <p>
166 * <b>Note</b>: This event has not yet been implemented.
167*/
168public static BBjNumber ON_CALENDAR_ENTRY_LEAVE() { }
169/**
170 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code> method that signals that the user dropped an external draggable element or an event from another calendar onto this calendar.
171 * <p>
172 * <b>Note</b>: This event has not yet been implemented.
173*/
174public static BBjNumber ON_CALENDAR_DROP() { }
175/**
176 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code> method that signals that the calendar's date range has changed in any way.
177 * <p>
178 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarDatesSetEvent.html' target = '_blank'>CalendarDatesSetEvent</a></code> object.
179*/
180public static BBjNumber ON_CALENDAR_DATES_SET() { }
181/**
182 * <p>
183 * Note that ON_CALENDAR_DATE_CLICK event is not fired when the user clicks a day heading in a list view.
184 * <p>
185 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarDateClickEvent.html' target = '_blank'>CalendarDateClickEvent</a></code> object.
186*/
187public static BBjNumber ON_CALENDAR_DATE_CLICK() { }
188/**
189 * <p>
190 * <b>Note</b>: You must configure the calendar to enable user selections via the <code>CalendarOptions:setEnableSelectable()</code> method
191 * if you intend to set a callback for the <code>BBjCalendarWidget:ON_CALENDAR_SELECT</code> or <code>BBjCalendarWidget:ON_CALENDAR_UNSELECT</code> events.
192 * <p>
193 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarSelectEvent.html' target = '_blank'>CalendarSelectEvent</a></code> object.
194*/
195public static BBjNumber ON_CALENDAR_SELECT() { }
196/**
197 * <p>
198 * <b>Note</b>: You must configure the calendar to enable user selections via the <code>CalendarOptions:setEnableSelectable()</code> method
199 * if you intend to set a callback for the <code>BBjCalendarWidget:ON_CALENDAR_SELECT</code> or <code>BBjCalendarWidget:ON_CALENDAR_UNSELECT</code> events.
200 * <p>
201 * A selection might be cleared for a number of reasons:
202 * <ul>
203 * <li>The user clicks away from the current selection (doesn't happen when EnableUnselectAuto is false).</li>
204 * <li>The user makes a new selection. The unselect callback will be fired before the new selection occurs.</li>
205 * <li>The user moves forward or backward in the current view, or switches to a new view.</li>
206 * <li>The unselect method is called through the API.</li>
207 * </ul>
208 * <p>
209 * The <code>CalendarOptions::setEnableUnselectAuto()</code> impacts what causes the <code>BBjCalendarWidget.ON_CALENDAR_UNSELECT</code> event to be fired.
210 * If automatic unselection is enabled, then the unselection event will typically be fired after the user releases their selection mouse button.
211 * <p>
212 * Setting a callback for this event type will result in your application getting a <code><a href = 'CalendarUnselectEvent.html' target = '_blank'>CalendarUnselectEvent</a></code>.
213*/
214public static BBjNumber ON_CALENDAR_UNSELECT() { }
215/**
216 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code> method that signals that fetching a <code>CalendarEntrySource</code> succeeded.
217 * <p>
218 * Setting a callback for this event type will result in your application getting a <code>??? - TBD</code> object.
219*/
220public static BBjNumber ON_CALENDAR_ENTRY_SOURCE_SUCCESS() { }
221/**
222 * A constant value that's used with the <code><a href = 'BBjCalendarWidget.html#setCallback' target = '_blank'>BBjCalendarWidget::setCallback()</a></code> method that signals that fetching a <code>CalendarEntrySource</code> failed.
223 * <p>
224 * Setting a callback for this event type will result in your application getting a <code>??? - TBD</code> object.
225*/
226public static BBjNumber ON_CALENDAR_ENTRY_SOURCE_FAILURE() { }
227/**
228 * @return A BBjString with the dayGridWeek calendar view style.
229*/
230public static BBjString CALENDAR_VIEW_DAY_GRID_WEEK() { }
231/**
232 * @return A BBjString with the dayGridMonth calendar view style.
233*/
234public static BBjString CALENDAR_VIEW_DAY_GRID_MONTH() { }
235/**
236 * @return A BBjString with the timeGridDay calendar view style.
237*/
238public static BBjString CALENDAR_VIEW_TIME_GRID_DAY() { }
239/**
240 * @return A BBjString with the timeGridWeek calendar view style.
241*/
242public static BBjString CALENDAR_VIEW_TIME_GRID_WEEK() { }
243/**
244 * @return A BBjString with the listDay calendar view style.
245*/
246public static BBjString CALENDAR_VIEW_LIST_DAY() { }
247/**
248 * @return A BBjString with the listWeek calendar view style.
249*/
250public static BBjString CALENDAR_VIEW_LIST_WEEK() { }
251/**
252 * @return A BBjString with the listMonth calendar view style.
253*/
254public static BBjString CALENDAR_VIEW_LIST_MONTH() { }
255/**
256 * @return A BBjString with the listYear calendar view style.
257*/
258public static BBjString CALENDAR_VIEW_LIST_YEAR() { }
259/** A constant value that's used with the <code>CalendarOptions::setButtonText()</code> method that uniquely identifies the 'today' toolbar button . */
260
261public static BBjString CALENDAR_TOOLBAR_BUTTON_TODAY() { }
262/** A constant value that's used with the <code>CalendarOptions::setButtonText()</code> method that uniquely identifies the 'month' toolbar button . */
263
264public static BBjString CALENDAR_TOOLBAR_BUTTON_MONTH() { }
265/** A constant value that's used with the <code>CalendarOptions::setButtonText()</code> method that uniquely identifies the 'week' toolbar button . */
266
267public static BBjString CALENDAR_TOOLBAR_BUTTON_WEEK() { }
268/** A constant value that's used with the <code>CalendarOptions::setButtonText()</code> method that uniquely identifies the 'day' toolbar button . */
269
270public static BBjString CALENDAR_TOOLBAR_BUTTON_DAY() { }
271/** A constant value that's used with the <code>CalendarOptions::setButtonText()</code> method that uniquely identifies the 'list' toolbar button . */
272
273public static BBjString CALENDAR_TOOLBAR_BUTTON_LIST() { }
274/** A constant value that's used with the <code>setPosition()</code> method that indicates that the toolbar should be above the calendar. */
275
276public static BBjString CALENDAR_TOOLBAR_POSITION_TOP() { }
277/** A constant value that's used with the <code>setPosition()</code> method that indicates that the toolbar should be below the calendar. */
278
279public static BBjString CALENDAR_TOOLBAR_POSITION_BOTTOM() { }
280/** A constant value for the toolbar's title object that contains the current month/week/day. */
281
282public static BBjString CALENDAR_TOOLBAR_OBJECT_TITLE() { }
283/** A constant value for the toolbar's today button object that moves the calendar to the current month/week/day. */
284
285public static BBjString CALENDAR_TOOLBAR_OBJECT_TODAY() { }
286/** A constant value for the toolbar's previous button object that's used for moving the calendar back one month/week/day. */
287
288public static BBjString CALENDAR_TOOLBAR_OBJECT_PREV() { }
289/** A constant value for the toolbar's next button object that's used for moving the calendar forward one month/week/day. */
290
291public static BBjString CALENDAR_TOOLBAR_OBJECT_NEXT() { }
292/** A constant value for the toolbar's previous year button object that's used for moving the calendar back one year. */
293
294public static BBjString CALENDAR_TOOLBAR_OBJECT_PREV_YEAR() { }
295/** A constant value for the toolbar's next year button object that's used for moving the calendar forward one year. */
296
297public static BBjString CALENDAR_TOOLBAR_OBJECT_NEXT_YEAR() { }
298/** A constant value that's used with the <code>CalendarToolbarSection</code> constructor that indicates the starting, or left, section of the toolbar to be defined. */
299
300public static BBjString CALENDAR_TOOLBAR_ALIGNMENT_START() { }
301/** A constant value that's used with the <code>CalendarToolbarSection</code> constructor that indicates the center section of the toolbar to be defined. */
302
303public static BBjString CALENDAR_TOOLBAR_ALIGNMENT_CENTER() { }
304/** A constant value that's used with the <code>CalendarToolbarSection</code> constructor that indicates the ending, or right, section of the toolbar to be defined. */
305
306public static BBjString CALENDAR_TOOLBAR_ALIGNMENT_END() { }
307/**
308 * <p>
309 * When in daygrid view, it renders the entry as a solid rectangle if it is all-day or multi-day.
310 * If it's a timed entry, it renders the entry as a colored a dot. When in other views, the entry will render normally.
311 * @return A BBjString with the 'auto' display style which is the default.
312*/
313public static BBjString CALENDAR_ENTRY_DISPLAY_AUTO() { }
314/**
315 * <p>
316 * When in daygrid view, it renders the entry as a solid rectangle.
317 * When in other views, the entry will render normally.
318 * @return A BBjString with the 'auto' display style which is the default.
319*/
320public static BBjString CALENDAR_ENTRY_DISPLAY_BLOCK() { }
321/**
322 * <p>
323 * When in daygrid view, it renders the entry as a colored dot.
324 * When in other views, the entry will render normally.
325 * @return A BBjString with the 'auto' display style which is the default.
326*/
327public static BBjString CALENDAR_ENTRY_DISPLAY_LIST_ITEM() { }
328/**
329 * <p>
330 * This modifies the background of the entry's date/time frame in the calendar.
331*/
332public static BBjString CALENDAR_ENTRY_DISPLAY_BACKGROUND() { }
333/**
334 * <p>
335 * This inversely modifies the background of the entry's date/time frame in the calendar.
336*/
337public static BBjString CALENDAR_ENTRY_DISPLAY_INVERSE_BACKGROUND() { }
338/**
339 * <p>
340 * This hides the entry on the calendar.
341*/
342public static BBjString CALENDAR_ENTRY_DISPLAY_NONE() { }
343/**
344 * Creates a <code>BBjCalendarWidget</code> given a BBjWindow where the widget takes up the full size of the window.
345 *
346 * @param wnd! The BBjWindow that will contain the calendar.
347*/
348public static BBjCalendarWidget createBBjCalendarWidget(BBjWindow wnd!) { }
349/**
350 * Creates a <code>BBjCalendarWidget</code> given a BBjWindow where the widget takes up the full size of the window.
351 *
352 * @param wnd! The BBjWindow that will contain the calendar.
353 * @param debug! A BBjNumber acting as a boolean that indicates whether the widget should be placed in debug mode or not.
354*/
355public static BBjCalendarWidget createBBjCalendarWidget(BBjWindow wnd!, BBjNumber debug!) { }
356/**
357 * Creates a <code>BBjCalendarWidget</code> given a BBjWindow and control ID, and the calendar's size and position.
358 *
359 * @param wnd! The BBjWindow that will contain the calendar.
360 * @param id The unique control ID that will be used for the widget, usually wnd!.getAvailableControlID().
361 * @param x The x-position of the widget.
362 * @param y The y-position of the widget.
363 * @param w The width of the widget.
364 * @param h The height of the widget.
365*/
366public static BBjCalendarWidget createBBjCalendarWidget(BBjWindow wnd!, BBjNumber id!, BBjNumber x!, BBjNumber y!, BBjNumber w!, BBjNumber h!) { }
367/**
368 * Creates a <code>BBjCalendarWidget</code> given a BBjWindow and control ID, the calendar's size and position, and a <code><a href = 'CalendarOptions.html' target = '_blank'>CalendarOptions</a></code> object.
369 *
370 * @param wnd! The BBjWindow that will contain the calendar.
371 * @param id The unique control ID that will be used for the widget, usually wnd!.getAvailableControlID().
372 * @param x The x-position of the widget.
373 * @param y The y-position of the widget.
374 * @param w The width of the widget.
375 * @param h The height of the widget.
376 * @param options! The initial configuration for the calendar, which is determined by passing in an existing <code><a href = 'CalendarOptions.html' target = '_blank'>CalendarOptions</a></code> object or null() for defaults.
377*/
378public static BBjCalendarWidget createBBjCalendarWidget(BBjWindow wnd!, BBjNumber id!, BBjNumber x!, BBjNumber y!, BBjNumber w!, BBjNumber h!, CalendarOptions options!) { }
379/**
380 * Creates a <code>BBjCalendarWidget</code> given a BBjWindow and control ID, size and position information, a calendar configuration, initial HTML template for the calendar, and a debug flag.
381 * <p>
382 * If you choose to provide your own HTML template, you may want to base it off of the default index.html file that can be found in the BBjCalendarWidget's <code>lib/basis</code> directory.
383 *
384 * @param wnd! The BBjWindow that will contain the calendar.
385 * @param id The unique control ID that will be used for the widget, usually wnd!.getAvailableControlID().
386 * @param x The x-position of the widget.
387 * @param y The y-position of the widget.
388 * @param w The width of the widget.
389 * @param h The height of the widget.
390 * @param options! The initial configuration for the calendar, which is determined by passing in an existing <code><a href = 'CalendarOptions.html' target = '_blank'>CalendarOptions</a></code> object or null() for defaults.
391 * @param template! The client's HTML template to use in order to build the calendar. You probably won't ever have to specify this, but it's possible if you wish to override the default HTML for the widget's BBjHtmlView. Specifying null() or an empty string causes the plug-in to use the default template.
392 * @param debug! A BBjNumber acting as a boolean that indicates whether the widget should be placed in debug mode or not.
393*/
394public static BBjCalendarWidget createBBjCalendarWidget(BBjWindow wnd!, BBjNumber id!, BBjNumber x!, BBjNumber y!, BBjNumber w!, BBjNumber h!, CalendarOptions options!, BBjString template!, BBjNumber debug!) { }
395/**
396 * Creates a <code>CalendarView</code> object given a view type. The provided view type should be one of the constants such as <code>CalendarAPI.CALENDAR_VIEW_DAY_GRID_MONTH()</code>, <code>CalendarAPI.CALENDAR_VIEW_TIME_GRID_WEEK()</code>, etc.
397 *
398 * @param BBjString type! One of the view type constants such as <code>CalendarAPI.CALENDAR_VIEW_DAY_GRID_MONTH()</code>, <code>CalendarAPI.CALENDAR_VIEW_TIME_GRID_WEEK()</code>, etc.
399 *
400 * @return CalendarView A CalendarView object.
401*/
402public static CalendarView createCalendarView(BBjString type!) { }
403/**
404 * Creates a <code>CalendarView</code> given a JsonObject representation of the view object.
405 *
406 * @param JsonObject json! A JsonObject representation of the <code>CalendarView</code>.
407 *
408 * @return CalendarView A CalendarView object.
409*/
410public static CalendarView createCalendarView(JsonObject json!) { }
411/**
412 * Creates an instance of the <code><a href = 'CalendarOptions.html' target = '_blank'>CalendarOptions</a></code> class with default values.
413*/
414public static CalendarOptions createCalendarOptions() { }
415/**
416 * Creates a <code>CalendarToolbar</code> using the default toolbar position of <code>CalendarAPI.CALENDAR_TOOLBAR_POSITION_TOP()</code>.
417 *
418 * @return CalendarToolbar A <code>CalendarToolbar</code> object.
419*/
420public static CalendarToolbar createCalendarToolbar() { }
421/**
422 * Creates a <code>CalendarToolbar</code> given the desired toolbar position, e.g. <code>CalendarAPI.CALENDAR_TOOLBAR_POSITION_TOP()</code> or <code>CalendarAPI.CALENDAR_TOOLBAR_POSITION_BOTTOM()</code>.
423 *
424 * @param BBjString position! The desired toolbar position, e.g. <code>CalendarAPI.CALENDAR_TOOLBAR_POSITION_TOP()</code> or <code>CalendarAPI.CALENDAR_TOOLBAR_POSITION_BOTTOM()</code>.
425 *
426 * @return CalendarToolbar A <code>CalendarToolbar</code> object.
427*/
428public static CalendarToolbar createCalendarToolbar(BBjString position!) { }
429/**
430 * Creates a <code>CalendarToolbar</code> given the desired toolbar position, e.g. <code>CalendarAPI.CALENDAR_TOOLBAR_POSITION_TOP()</code> or <code>CalendarAPI.CALENDAR_TOOLBAR_POSITION_BOTTOM()</code>.
431 *
432 * @param BBjString position! The desired toolbar position, e.g. <code>CalendarAPI.CALENDAR_TOOLBAR_POSITION_TOP()</code> or <code>CalendarAPI.CALENDAR_TOOLBAR_POSITION_BOTTOM()</code>.
433 * @param CalendarToolbarSection startSection! A previously-defined <code>CalendarToolbarSection</code> object for the start position in the toolbar.
434 * @param CalendarToolbarSection centerSection! A previously-defined <code>CalendarToolbarSection</code> object for the center position in the toolbar.
435 * @param CalendarToolbarSection endSection! A previously-defined <code>CalendarToolbarSection</code> object for the end position in the toolbar.
436 *
437 * @return CalendarToolbar A <code>CalendarToolbar</code> object.
438*/
439public static CalendarToolbar createCalendarToolbar(BBjString position!, CalendarToolbarSection startSection!, CalendarToolbarSection centerSection!, CalendarToolbarSection endSection!) { }
440/**
441 * Creates a <code>CalendarToolbar</code> given the desired toolbar position, e.g. <code>CalendarAPI.CALENDAR_TOOLBAR_POSITION_TOP()</code> or
442 * <code>CalendarAPI.CALENDAR_TOOLBAR_POSITION_BOTTOM()</code> along with comma-delimited string representations of the start, center, and end sections.
443 *
444 * @param BBjString position! The desired toolbar position, e.g. <code>CalendarAPI.CALENDAR_TOOLBAR_POSITION_TOP()</code> or <code>CalendarAPI.CALENDAR_TOOLBAR_POSITION_BOTTOM()</code>.
445 * @param BBjString startSection! A comma-delimited string representation of the start section of the toolbar.
446 * @param BBjString centerSection! A comma-delimited string representation of the center section of the toolbar.
447 * @param BBjString endSection! A comma-delimited string representation of the end section of the toolbar.
448 *
449 * @return CalendarToolbar A <code>CalendarToolbar</code> object.
450*/
451public static CalendarToolbar createCalendarToolbar(BBjString position!, BBjString startSection!, BBjString centerSection!, BBjString endSection!) { }
452/**
453 * Creates a <code>CalendarToolbarSection</code>. There are three possible alignments, or positions, for the section that include:
454 * <ul>
455 * <li><code>CalendarAPI.CALENDAR_TOOLBAR_ALIGNMENT_START()</code> - The left-most section of the toolbar.</li>
456 * <li><code>CalendarAPI.CALENDAR_TOOLBAR_ALIGNMENT_CENTER()</code> - The center section of the toolbar.</li>
457 * <li><code>CalendarAPI.CALENDAR_TOOLBAR_ALIGNMENT_END()</code> - The right-most section of the toolbar.</li>
458 * </ul>
459 *
460 * @param BBjString alignment! The component's alignment which may be one of the following string values: "start", "center", or "end".
461*/
462public static CalendarToolbarSection createCalendarToolbarSection(BBjString alignment!) { }
463/**
464 * Creates a <code>CalendarToolbarSection</code> that takes an alignment and a set of options that would normally be set via the setObjects() method.
465 * There are three possible alignments, or positions, for the section that include:
466 * <ul>
467 * <li><code>CalendarAPI.CALENDAR_TOOLBAR_ALIGNMENT_START()</code> - The left-most section of the toolbar.</li>
468 * <li><code>CalendarAPI.CALENDAR_TOOLBAR_ALIGNMENT_CENTER()</code> - The center section of the toolbar.</li>
469 * <li><code>CalendarAPI.CALENDAR_TOOLBAR_ALIGNMENT_END()</code> - The right-most section of the toolbar.</li>
470 * </ul>
471 *
472 * @param BBjString alignment! The component's alignment which may be one of the following string values: "start", "center", or "end".
473 * @param BBjString objects! A comma-separated list of objects to include in the section, like <code>CalendarAPI.CALENDAR_TOOLBAR_OBJECT_*</code>.
474*/
475public static CalendarToolbarSection createCalendarToolbarSection(BBjString alignment!, BBjString objects!) { }
476/**
477 * Creates a <code>CalendarEntry</code> given a JsonObject representation of the <code>CalendarEntry</code> object.
478*/
479public static CalendarEntry createCalendarEntry(JsonObject json!) { }
480/**
481 * Creates a <code>CalendarEntry</code> given an entry title and starting date/time string.
482 *
483 * @param BBjString title! The entry's title.
484 * @param BBjString start! The entry's starting date/time in an ISO 8601 date/time format.
485 *
486 * @see <a href = 'https://www.w3.org/TR/NOTE-datetime' target = '_blank'>Date and Time Formats</a> for information on ISO 8601 date/time formats.
487*/
488public static CalendarEntry createCalendarEntry(BBjString title!, BBjString start!) { }
489/**
490 * Creates a <code>CalendarEntry</code> given an entry title, starting date/time string, and ending date/time string.
491 *
492 * @param BBjString title! The entry's title.
493 * @param BBjString start! The entry's starting date/time in an ISO 8601 date/time format.
494 * @param BBjString end! The entry's ending date/time in an ISO 8601 date/time format.
495 *
496 * @see <a href = 'https://www.w3.org/TR/NOTE-datetime' target = '_blank'>Date and Time Formats</a> for information on ISO 8601 date/time formats.
497*/
498public static CalendarEntry createCalendarEntry(BBjString title!, BBjString start!, BBjString end!) { }
499/**
500 * Creates a <code>CalendarEntrySource</code> with default values.
501*/
502public static CalendarEntrySource createCalendarEntrySource() { }
503/**
504 * Creates a <code>CalendarEntrySource</code> given a unique ID that identifes the entry source
505 * for later use, such as with the <code>BBjCalendarWidget::getEntrySourceById()</code> method,
506 * and a URL to access the feed.
507 *
508 * @param BBjString id! A string that identifies the source so that it can be uniquely identified and used in other method calls.
509 * @param BBjString url! A BBjString filled with the URL for the entry source.
510*/
511public static CalendarEntrySource createCalendarEntrySource(BBjString id!, BBjString url!) { }
512/**
513 * Creates a <code>CalendarEntrySource</code> given a unique ID that identifes the entry source
514 * for later use, such as with the <code>BBjCalendarWidget::getEntrySourceById()</code> method, along with the URL and
515 * colors for the source's entries.
516 * <p>
517 * <b>Note</b>: Colors may be specified as any valid CSS color, so <code>"red"</code>, <code>"rgb(255, 0, 0)"</code>, <code>"#ff0000"</code>, <code>"#f00"</code>, <code>"hsl(0, 100%, 50%)"</code>, and all the versions of those formats that include an alpha channel are valid ways of specifying the color red.
518 * <p>
519 * <b>Note</b>: You may pass in a <code>null()</code> or empty string for any of the colors as a way to indicate that the default entry color should be used for this source.
520 *
521 * @param BBjString id! A string that identifies the source so that it can be uniquely identified and used in other method calls. If null(), it will be auto-generated and you can retrieve the id by calling the <code>getId()</code> method on the source.
522 * @param BBjString url! A BBjString filled with the URL for the entry source.
523 * @param BBjString backgroundColor! The background color for the source's entries, or <code>null()</code> or an empty string to indicate that the default entry color should be used.
524 * @param BBjString borderColor! The border color for the source's entries, or <code>null()</code> or an empty string to indicate that the default entry color should be used.
525 * @param BBjString textColor! The text color for the source's entries, or <code>null()</code> or an empty string to indicate that the default entry color should be used.
526*/
527public static CalendarEntrySource createCalendarEntrySource(BBjString id!, BBjString url!, BBjString backgroundColor!, BBjString borderColor!, BBjString textColor!) { }
528/**
529 * Contructs a <code>CalendarEntrySourceGoogle</code> object for the provided Google Calendar ID.
530 *
531 * @param BBjString calendarId! The "Calendar ID" string from the settings page for that specific public Google calendar, e.g. "abcd1234@group.calendar.google.com". This ID is specific to the desired Google calendar and is different from the source's ID.
532 *
533 * @see <a href = 'https://fullcalendar.io/docs/google-calendar' target = '_blank'>https://fullcalendar.io/docs/google-calendar</a> for information on FullCalendar integration with Google calendars
534 * @see <a href = 'https://console.developers.google.com/' target = '_blank'>Google Developer Console</a> for information on creating Goolge developer API keys
535*/
536public static CalendarEntrySourceGoogle createCalendarEntrySourceGoogle(BBjString id!, BBjString calendarId!) { }
537/**
538 * Creates a <code>CalendarEntrySourceGoogle</code> object for the provided Google Calendar ID specifying a color scheme for the source's entries.
539 * <p>
540 * <b>Note</b>: In order to access public Google calendars programmatically, you need to
541 * sign up for a developer's account and generate an API key. See the <code>CalendarOptions::setGoogleCalendarApiKey()</code>
542 * method for documentation links and setting the API key.
543 * <p>
544 * <b>Note</b>: Colors may be specified as any valid CSS color, so <code>"red"</code>, <code>"rgb(255, 0, 0)"</code>, <code>"#ff0000"</code>, <code>"#f00"</code>, <code>"hsl(0, 100%, 50%)"</code>, and all the versions of those formats that include an alpha channel are valid ways of specifying the color red.
545 * <p>
546 * <b>Note</b>: You may pass in a <code>null()</code> or empty string for any of the colors as a way to indicate that the default entry color should be used for this source.
547 *
548 * @param BBjString id! A string that identifies the source so that it can be uniquely identified and used in other method calls. If null(), it will be auto-generated and you can retrieve the id by calling the <code>getId()</code> method on the source.
549 * @param BBjString calendarId! The "Calendar ID" string from the settings page for the specific public Google calendar, e.g. "abcd1234@group.calendar.google.com".
550 * @param BBjString backgroundColor! The background color for the source's entries, or <code>null()</code> or an empty string to indicate that the default entry color should be used.
551 * @param BBjString borderColor! The border color for the source's entries, or <code>null()</code> or an empty string to indicate that the default entry color should be used.
552 * @param BBjString textColor! The text color for the source's entries, or <code>null()</code> or an empty string to indicate that the default entry color should be used.
553 *
554 * @see <a href = 'https://fullcalendar.io/docs/google-calendar' target = '_blank'>https://fullcalendar.io/docs/google-calendar</a> for information on FullCalendar integration with Google calendars
555 * @see <a href = 'https://console.developers.google.com/' target = '_blank'>Google Developer Console</a> for information on creating Goolge developer API keys
556*/
557public static CalendarEntrySourceGoogle createCalendarEntrySourceGoogle(BBjString id!, BBjString calendarId!, BBjString backgroundColor!, BBjString borderColor!, BBjString textColor!) { }
558/**
559 * Creates a <code>CalendarEntrySourceiCalendar</code> for an iCalendar feed given a unique ID that identifes the entry source
560 * for later use, such as with the <code>BBjCalendarWidget::getEntrySourceById()</code> method,
561 * and a URL to access the feed.
562 *
563 * @param BBjString id! A string that identifies the source so that it can be uniquely identified and used in other method calls. If null(), it will be auto-generated and you can retrieve the id by calling the <code>getId()</code> method on the source.
564 * @param BBjString url! A BBjString filled with the URL for the iCalendar feed.
565 *
566 * @see <a href = 'https://fullcalendar.io/docs/google-calendar' target = '_blank'>https://fullcalendar.io/docs/google-calendar</a> for information on FullCalendar integration with Google calendars
567 * @see <a href = 'https://icalendar.org/' target = '_blank'>https://icalendar.org/</a> for information on the iCalendar specification
568*/
569public static CalendarEntrySourceiCalendar createCalendarEntrySourceiCalendar(BBjString id!, BBjString url!) { }
570/**
571 * Creates a <code>CalendarEntrySourceiCalendar</code> for an iCalendar feed given a unique ID that identifes the entry source
572 * for later use, such as with the <code>BBjCalendarWidget::getEntrySourceById()</code> method,
573 * a URL to access the feed, and a color scheme for the source's entries.
574 *
575 * <p>
576 * <b>Note</b>: Colors may be specified as any valid CSS color, so <code>"red"</code>, <code>"rgb(255, 0, 0)"</code>, <code>"#ff0000"</code>, <code>"#f00"</code>, <code>"hsl(0, 100%, 50%)"</code>, and all the versions of those formats that include an alpha channel are valid ways of specifying the color red.
577 * <p>
578 * <b>Note</b>: You may pass in a <code>null()</code> or empty string for any of the colors as a way to indicate that the default entry color should be used for this source.
579 *
580 * @param BBjString id! A string that identifies the source so that it can be uniquely identified and used in other method calls. If null(), it will be auto-generated and you can retrieve the id by calling the <code>getId()</code> method on the source.
581 * @param BBjString url! A BBjString filled with the URL for the iCalendar feed.
582 * @param BBjString backgroundColor! The background color for the source's entries, or <code>null()</code> or an empty string to indicate that the default entry color should be used.
583 * @param BBjString borderColor! The border color for the source's entries, or <code>null()</code> or an empty string to indicate that the default entry color should be used.
584 * @param BBjString textColor! The text color for the source's entries, or <code>null()</code> or an empty string to indicate that the default entry color should be used.
585 *
586 * @see <a href = 'https://fullcalendar.io/docs/google-calendar' target = '_blank'>https://fullcalendar.io/docs/google-calendar</a> for information on FullCalendar integration with Google calendars
587 * @see <a href = 'https://icalendar.org/' target = '_blank'>https://icalendar.org/</a> for information on the iCalendar specification
588*/
589public static CalendarEntrySourceiCalendar createCalendarEntrySourceiCalendar(BBjString id!, BBjString url!, BBjString backgroundColor!, BBjString borderColor!, BBjString textColor!) { }
590/**
591 * Returns a BBjVector filled with all possible calendar view type constants such as <code>CalendarAPI.CALENDAR_VIEW_DAY_GRID_MONTH()</code>, <code>CalendarAPI.CALENDAR_VIEW_TIME_GRID_WEEK()</code>, etc.
592 *
593 * @return BBjVector A BBjVector filled with all possible calendar view type constants such as <code>CalendarAPI.CALENDAR_VIEW_DAY_GRID_MONTH()</code>, <code>CalendarAPI.CALENDAR_VIEW_TIME_GRID_WEEK()</code>, etc.
594*/
595public static BBjVector getAllViewTypes() { }
596/**
597 * Returns a formatted, or pretty-printed version of the supplied JSON object sorted alphabetically by key.
598 *
599 * @param JsonObject json! The JSON object to be formatted.
600 * @return BBjString A BBjString that is a string representation of the supplied JSON object after it has been formatted, or an empty string if the provided JsonObject was null().
601*/
602public static BBjString getJsonObjectAsFormattedString(JsonObject json!) { }
603/**
604 * Returns a JSON array version of the supplied BBjVector.
605 *
606 * @param BBjVector vector! The BBjVector to be converted to a JSON array.
607 * @return JsonArray A JSON array version of the supplied BBjVector.
608*/
609public static JsonArray getBBjVectorAsJsonArray(BBjVector vector!) { }
610/**
611 * Returns a BBjVector version of the supplied JSON array.
612 *
613 * @param JsonArray array! The JSON array to be converted to a BBjVector.
614 * @return BBjVector A BBjVector version of the supplied JSON array.
615*/
616public static BBjVector getJsonArrayAsBBjVector(JsonArray array!) { }
617/**
618 * <b>DEPRECATED</b> Returns a formatted date string if the provided date string can be parsed into a valid date, or null() if the date string is invalid.
619 *
620 * @param BBjString dateString! A string that contains a date representation.
621 *
622 * @return BBjString A formatted date representation of the provided date string, or null() if the date string cannot be parsed into an ISO formatted date.
623 *
624 * @deprecated Deprecated in BBj 22.00 because Java <a href = 'https://openjdk.java.net/jeps/372' target = '_blank'>removed</a> the Nashorn JavaScript engine in Java 15. Therefore, this static method has moved to the BBjCalendarWidget class because the BBjHtmlView control used by the BBjCalendarWidget can execute JavaScript in a non-static context. Please use the <code><a href = 'BBjCalendarWidget.html#getValidDateString' target = '_blank'>BBjCalendarWidget::getValidDateString()</a></code> method instead.
625*/
626public static BBjString getValidDateString(BBjString dateString!) { }
627/**
628 * <b>DEPRECATED</b> Returns a formatted time string if the provided time string can be parsed into a valid time, or null() if the time string is invalid.
629 *
630 * @param BBjString timeString! A string that contains a time representation.
631 *
632 * @return BBjString A formatted time representation of the provided time string, or null() if the time string cannot be parsed into an ISO formatted time.
633 *
634 * @deprecated Deprecated in BBj 22.00 because Java <a href = 'https://openjdk.java.net/jeps/372' target = '_blank'>removed</a> the Nashorn JavaScript engine in Java 15. Therefore, this static method has moved to the BBjCalendarWidget class because the BBjHtmlView control used by the BBjCalendarWidget can execute JavaScript in a non-static context. Please use the <code><a href = 'BBjCalendarWidget.html#getValidTimeString' target = '_blank'>BBjCalendarWidget::getValidTimeString()</a></code> method instead.
635*/
636public static BBjString getValidTimeString(BBjString timeString!) { }
637/**
638 * <b>DEPRECATED</b> Returns an ISO 8601 formatted date/time string if the provided date/time string can be parsed into a valid date, or null() if the date string is invalid.
639 *
640 * @param BBjString dateTimeString! A string that contains a date/time representation.
641 *
642 * @return BBjString An ISO 8601 formatted date representation of the provided date string, or null() if the date string cannot be parsed into an ISO formatted date/time string.
643 *
644 * @deprecated Deprecated in BBj 22.00 because Java <a href = 'https://openjdk.java.net/jeps/372' target = '_blank'>removed</a> the Nashorn JavaScript engine in Java 15. Therefore, this static method has moved to the BBjCalendarWidget class because the BBjHtmlView control used by the BBjCalendarWidget can execute JavaScript in a non-static context. Please use the <code><a href = 'BBjCalendarWidget.html#getValidDateTimeString' target = '_blank'>BBjCalendarWidget::getValidDateTimeString()</a></code> method instead.
645*/
646public static BBjString getValidDateTimeString(BBjString dateTimeString!) { }
647/**
648 * <b>DEPRECATED</b> Returns the difference between the client's local time and UTC in minutes. For example, if your time zone is
649 * UTC+10, then -600 will be returned because UTC is 600 minutes behind the local time zone. Another way to view
650 * it is that the return value is the number of minutes that should be added to the local time in order to find
651 * UTC. Note that daylight savings time prevents this value from being a constant.
652 *
653 * @return BBjNumber The number of minutes needed to add to the local time to result in UTC.
654 *
655 * @deprecated Deprecated in BBj 22.00 because Java <a href = 'https://openjdk.java.net/jeps/372' target = '_blank'>removed</a> the Nashorn JavaScript engine in Java 15. Therefore, this static method has moved to the BBjCalendarWidget class because the BBjHtmlView control used by the BBjCalendarWidget can execute JavaScript in a non-static context. Please use the <code><a href = 'BBjCalendarWidget.html#getLocalTimeZoneOffsetFromUtc' target = '_blank'>BBjCalendarWidget::getLocalTimeZoneOffsetFromUtc()</a></code> method instead.
656*/
657public static BBjNumber getLocalTimeZoneOffsetFromUtc() { }
658}