9#ifndef ff_cocoa_cppinterface_h
10#define ff_cocoa_cppinterface_h
14#ifndef DOXYGEN_SHOULD_IGNORE_THIS
28class FCVirtualCanvasInstructions;
30#ifdef PDK_FRAMEWORK_STREAMS
34#ifdef PDK_FRAMEWORK_FILEDIALOGS
41typedef SInt32 EMENUID;
42EMENUID _cocoalink_MapMenuPositionCommand(
int mainmenuidx,
int dropdownidx,
int submenuidx);
43EMENUID _cocoalink_MapMenuItemTextCommand(
const FCString &topMenu,
const FCString &itemText);
44bool _cocoalink_ExecuteOSMenuCommand(EMENUID osmenucmd);
46#ifdef PDK_FRAMEWORK_DEBUG
47void _cocoalink_DebugOutMenuInfo(
int menuixd_horiz,
int menuixd_vert);
60void* _cocoalink_ChangeNSPointerValue(
void* oldvalue,
void* pointervalue);
68void* _cocoalink_DeallocateNSValue(
void* value);
81void* _cocoalink_GetNSString(
void*
object,
const FCString* pString);
89void _cocoalink_ToLowerCase(
void* fcstringobject);
97void _cocoalink_ToUpperCase(
void* fcstringobject);
100void _cocoalink_CFURLRefToPath(CFURLRef urlref,
FCString* pString);
103CFURLRef _cocoalink_PathToCFURLRef(
const FCString* pString);
106bool __cocoalink_PathFromNSWindow(
void* hWnd,
FCString *pString);
115void _cocoalink_SetNSString(
FCString* pString,
void*
object);
118bool _cocoalink_ToCharFromFCString(
const FCString* pString,
char* pszBuffer,
const int maxsize,
const bool preferPlatform);
119inline bool _cocoalink_ToUTF8FromFCString(
const FCString* pString,
char* pszBuffer,
const int maxsize)
120{
return _cocoalink_ToCharFromFCString(pString, pszBuffer, maxsize,
false); }
121inline bool _cocoalink_ToCharFromFCString(
const FCString* pString,
char* pszBuffer,
const int maxsize)
122{
return _cocoalink_ToCharFromFCString(pString, pszBuffer, maxsize,
true); }
125bool _cocoalink_FromCharToFCString(
FCString* pString,
const char* pszBuffer,
const bool preferPlatform);
126inline bool _cocoalink_FromUTF8ToFCString(
FCString* pString,
const char* pszBuffer)
128 if (_cocoalink_FromCharToFCString(pString, pszBuffer,
false))
130 return _cocoalink_FromCharToFCString(pString, pszBuffer,
true);
132inline bool _cocoalink_FromCharToFCString(
FCString* pString,
const char* pszBuffer)
134 if (_cocoalink_FromCharToFCString(pString, pszBuffer,
true))
136 return _cocoalink_FromCharToFCString(pString, pszBuffer,
false);
139#ifdef PDK_FRAMEWORK_FORMAT
141int _cocoalink_FormatStringWithArguments(
FCString* pStringDest,
FCString* pStringArgs, va_list ap);
150void* _cocoalink_DeallocateNSString(
void*
object);
152#ifdef PDK_FRAMEWORK_DIALOGS
159uint32_t _cocoalink_GetCurrentModifierKeys();
161bool _cocoalink_IsAppDarkModeAppearance();
163#ifdef PDK_FRAMEWORK_IMAGECTRL
165void* _cocoalink_LoadImage(
int source,
const char* data,
long dataLength,
float* pWidth,
float* pHeight);
166void _cocoalink_ReleaseImage(
void* image);
171double _fcuicocoa_GetHiResTimer();
177class _FCSystemGlyphInfo_cocoa
181 _FCSystemGlyphInfo_cocoa(
FCSystemGlyphInfo *pLinkedObject) { _pObject = pLinkedObject; }
183 bool LoadInfo(
FCFontInfo* pFontInfo,
unsigned int glyphno);
191 double _starttime, _resulttime;
204 bool IsFontAvailable(
const char* pszFontName);
206 void StartPerformanceTimer();
207 void StopPerformanceTimer();
208 double ReturnPerformanceTiming();
210 bool DisplayWebURL(
FCString* pURLString);
211 bool DisplayShellFolder(
FCString* pFolderString);
213 bool TextToClipboard(
const char* pszText,
bool utf8);
215 void GetDecimalSeparator(
FCString* pString);
216 void GetUserLocaleName(
FCString* pString);
219 void* GetActiveWindow();
222 void ActivateWindow(
void* hwnd);
226class _FCStrings_cocoa
232 _pLinkedObject = pObject;
234 bool LoadFolderFiles(
FCString* pFolderName);
235 bool LoadSubfolders(
FCString* pFolderName);
236 bool LoadSystemFontNames();
239#ifdef PDK_FRAMEWORK_STREAMS
241class _FCTextFileUTF8Stream_cocoa
247 _pLinkedObject = pObject;
253#ifdef PDK_FRAMEWORK_FILEDIALOGS
255class _FCFileOpenDialog_cocoa
261 _pLinkedObject = pObject;
267class _FCFileSaveAsDialog_cocoa
273 _pLinkedObject = pObject;
279class _FCFolderBrowseDialog_cocoa
285 _pLinkedObject = pObject;
292#ifdef PDK_FRAMEWORK_DIALOGS
306class _FCWindowController_cocoa
308 bool _allowphysicalwindowclosing;
314 bool _modelessCanBecomeMainWindow;
318 virtual ~_FCWindowController_cocoa();
324 void* _GetInstance() {
return _self; }
328 bool IsModalDialog() {
return _ismodaldialog; }
330 bool ModelessCancelCanEscape()
const;
332 bool GetModelessCanBecomeMainWindow()
const {
return _modelessCanBecomeMainWindow; }
333 void SetModelessCanBecomeMainWindow(
bool state) { _modelessCanBecomeMainWindow = state; }
343 void NotYetImplementedError(
const char* pszMethodName);
345 void SetWindowCaption(
FCString *pString);
347 void GetWindowCaption(
FCString *pString);
349 void GetWindowContentRect(__FloatRect* pRect);
350 void SetWindowFrameRect(__FloatRect* pRect);
351 void GetWindowFrameRect(__FloatRect* pRect);
352 float GetWindowTitleHeight();
353 void SetMaximumResizeWidth(
float width);
354 void SetMaximumResizeHeight(
float height);
355 void SetWindowAlpha(
int alphavalue);
356 void SetInitialFocus();
358 bool IsWindowLoaded()
const;
359 bool IsWindowVisible();
360 bool IsDarkAppearanceMode()
const;
361 void ActivateWindow();
362 void ShowWindow(
bool showstate);
364 void DestroyWindow();
366 void RepaintWindow();
369 void ClearAllPopupItems(
int dlgid);
370 int GetPopupItemCount(
int dlgid)
const;
371 void AppendPopupItem(
int dlgid,
FCString* pString);
372 void InsertPopupString(
int dlgid,
int index,
FCString* pString);
374 void DeletePopupItem(
int dlgid,
int lineidx);
375 void SelectPopupItem(
int dlgid,
int lineidx);
376 int GetSelectedPopupItem(
int dlgid)
const;
377 bool GetPopupItemText(
int dlgid,
int lineidx,
FCString* pString)
const;
378 bool AssurePopupWidthForText(
int dlgid);
381 void ClearAllComboBoxItems(
int dlgid);
382 int GetComboBoxItemCount(
int dlgid);
383 void AppendComboBoxItem(
int dlgid,
FCString* pString);
384 int GetSelectedComboBoxItem(
int dlgid);
385 void SelectComboBoxItem(
int dlgid,
int lineidx);
386 bool AssureComboBoxWidthForText(
int dlgid);
389 void ClearShortcutKey(
int dlgid);
392 void* _GetCocoaID(
int dlgid);
394 bool CreateUIControl(
FCControl* pControl);
396#ifdef PDK_FRAMEWORK_DIAGNOSE
398 void _GetControllerClassName(
int dlgid,
FCString* pClassName);
399 bool IsSameClass(
const FCString* pClassGot,
const FCString* pClassExpected);
402 void SetDlgItemVisible(
int dlgid,
bool show);
403 bool GetDlgItemVisible(
int dlgid);
405 void SetDlgItemBold(
int dlgid,
bool boldstate);
406 void SetDlgItemFont(
int dlgid,
const FCFontInfo *fontInfo);
407 bool GetDlgItemFont(
int dlgid,
FCFontInfo *fontInfo);
408 void SetDlgItemTextColor(
int dlgid,
int red,
int green,
int blue);
409 void SetDlgItemKeyboardFocus(
int dlgid);
411 void SetDlgItemEnable(
int dlgid,
bool enable);
412 bool GetDlgItemEnable(
int dlgid)
const;
414 void SetDlgItemCheck(
int dlgid,
int state);
415 int GetDlgItemCheck(
int dlgid);
417 bool AssureDlgItemWidthForText(
int dlgid);
418 void SetDlgItemText(
int dlgid,
const FCString* pString);
419 void SetDlgItemTextAndResize(
int dlgid,
const FCString* pString);
420 bool GetDlgItemText(
int dlgid,
FCString* pString);
422 bool GetDlgItemRect(
int dlgid, __FloatRect* pRect);
423 void SetDlgItemWidth(
int dlgid,
float width);
424 void SetDlgItemHeight(
int dlgid,
float height);
425 void SetDlgItemPos(
int dlgid,
float x,
float y,
bool repaint =
true);
426 void SetDlgItemSize(
int dlgid,
float width,
float height,
bool repaint =
true);
428 bool RedrawDlgItemImmediate(
int dlgid);
431 void SetStepperMinMax(
int dlgid,
int min,
int max);
432 int GetStepperMin(
int dlgid);
433 int GetStepperMax(
int dlgid);
434 void SetStepperValue(
int dlgid,
int value);
437 void SetSliderMin(
int dlgid,
int value);
438 int GetSliderMin(
int dlgid);
439 void SetSliderMax(
int dlgid,
int value);
440 int GetSliderMax(
int dlgid);
441 void SetSliderThumbValue(
int dlgid,
int value);
442 int GetSliderThumbValue(
int dlgid);
445 void SetImageForImageControl(
int dlgid,
void *image);
448 void TableViewUseLeftCheckboxColumn(
int dlgid);
449 void TableViewSetNoHeader(
int dlgid);
450 void TableViewExpandLastColumn(
int dlgid);
451 int TableViewGetColumnCount(
int dlgid,
bool includecheckboxcolumn);
452 int TableViewGetColumnWidth(
int dlgid,
int columnindex);
453 void TableViewSetColumnTitle(
int dlgid,
int columnindex,
FCString* pTitle);
454 bool TableViewAddColumn(
int dlgid,
FCString* pTitle,
float columnwidth,
int fontsize);
455 void TableViewDeleteAllColumns(
int dlgid);
456 void TableViewRedraw(
int dlgid);
457 void TableViewScrollToTop(
int dlgid);
458 int TableViewGetSelectedLine(
int dlgid);
459 void TableViewSelectLine(
int dlgid,
int lineindex,
bool ensurevisible,
bool extendselection);
460 bool TableViewIsLineSelected(
int dlgid,
int lineindex);
461 bool TableViewHasCheckboxes(
int dlgid);
462 void TableViewUpdateCheckbox(
int dlgid,
int rowindex);
464 void TableViewDeselectLine(
int dlgid,
int lineindex);
465 void TableViewClearSelection(
int dlgid);
466 bool TableViewGetAlternatingRows(
int dlgid)
const;
467 void TableViewSetAlternatingRows(
int dlgid,
bool value);
470 void OutlineViewSetupColumn(
int dlgid,
int fontheight);
471 FCTreeNode* OutlineViewGetSelectedNode(
int dlgid);
472 bool OutlineViewCollapseAllContainers(
int dlgid);
473 bool OutlineViewExpandAllContainers(
int dlgid);
474 bool OutlineViewSetSelectedNode(
int dlgid,
FCTreeNode* pNode);
475 bool OutlineViewExpandNode(
int dlgid,
FCTreeNode* pNode);
476 void OutlineViewAssureConnected(
FCCtrlTree* pControl);
477 void OutlineViewRefreshData(
int dlgid);
480 void SwitcherAddPage(
int dlgid,
FCString* pString);
481 int SwitcherGetPageCount(
int dlgid);
482 int SwitcherGetSelectedPage(
int dlgid);
483 void SwitcherSetSelectedPage(
int dlgid,
int index);
485#ifdef PDK_FRAMEWORK_CANVASCTRL
487 void CanvasUpdateContent(
int dlgid, FCVirtualCanvasInstructions* pInstructions);
491 void EditScrollToBottom(
int dlgid);
494 bool TextEditorGetTotalTextRange(
int dlgid,
FCRange* pRange)
const;
495 int TextEditorGetLineForPosition(
int dlgid,
int pos)
const;
496 bool TextEditorGetLineRangeForLine(
int dlgid,
int line,
FCRange* pRange)
const;
497 bool TextEditorGetLineRangeForPosition(
int dlgid,
int pos,
FCRange* pRange)
const;
498 bool TextEditorGetSelection(
int dlgid,
FCRange* pRange)
const;
499 bool TextEditorSetSelection(
int dlgid,
const FCRange* pRange);
500 bool TextEditorGetTextInRange(
int dlgid,
FCString *pText,
const FCRange* pRange)
const;
501 bool TextEditorReplaceTextInRange(
int dlgid,
const FCString *pText,
const FCRange* pRange);
503 void TextEditorInsertTextAtCursor(
int dlgid,
const FCString *pText);
504 FCString* TextEditorCreateRTFString(
int dlgid)
const;
505 FCString* TextEditorCreateEnigmaString(
int dlgid,
const FCRange* pRange)
const;
506 bool TextEditorSetRTFString(
int dlgid,
const FCString* pString);
507 FCFontInfo* TextEditorCreateFontInfoAtIndex(
int dlgid,
int index)
const;
508 bool TextEditorSetFontInRange(
int dlgid,
const FCFontInfo* pFont,
const FCRange* pRange,
bool enabled);
509 bool TextEditorSetFontSizeInRange(
int dlgid,
int size,
const FCRange* pRange,
bool enabled);
510 bool TextEditorSetFontBoldInRange(
int dlgid,
bool state,
const FCRange* pRange,
bool enabled);
511 bool TextEditorSetFontItalicInRange(
int dlgid,
bool state,
const FCRange* pRange,
bool enabled);
512 void TextEditorSetWordWrap(
int dlgid,
bool wordwrap);
513 void TextEditorSetUseRichText(
int dlgid,
bool state);
514 bool TextEditorGetUseRichText(
int dlgid)
const;
515 void TextEditorSetAutomaticEditing(
int dlgid,
bool state);
516 void TextEditorSetTabstopWidth(
int dlgid,
double value);
517 FCRanges * TextEditorCreateRangesForString(
int dlgid,
const FCString* pSearchString,
unsigned int options,
const FCRange* pRange)
const;
518 void TextEditorResetUndoState(
int dlgid);
519 bool TextEditorSetColorInRange(
int dlgid,
int red,
int green,
int blue,
bool reset,
bool background,
const FCRange* pRange,
bool enabled);
520 std::tuple<int, int, int> TextEditorGetColorAtIndex(
int dlgid,
int index,
bool background)
const;
521 FCRanges* TextEditorGetColorChanges(
int dlgid,
bool background)
const;
522 int TextEditorGetNumberOfLines(
int dlgid)
const;
523 double TextEditorGetVerticalScrollPosition(
int dlgid)
const;
524 void TextEditorScrollToTop(
int dlgid);
525 void TextEditorScrollToBottom(
int dlgid);
526 void TextEditorScrollToVerticalPosition(
int dlgid,
double vpos);
527 void TextEditorScrollToLine(
int dlgid,
int line);
528 double TextEditorGetLineSpacing(
int dlgid)
const;
529 void TextEditorSetLineSpacing(
int dlgid,
double value);
530 FCString* TextEditorCreateCharacterAtIndex(
int dlgid,
int pos);
531 bool TextEditorTextToClipboard(
int dlgid,
const FCRange* pRange)
const;
533 void TextEditorSetReadOnly(
int dlgid,
bool readonly);
534 bool TextEditorGetReadOnly(
int dlgid)
const;
537 bool TimeridExists(
int timerid);
538 void CreateTimer(
int timerid,
int duration_in_ms);
539 void KillTimer(
int timerid);
540 void KillAllTimers();
545 void Notify_InitWindow();
548 void Notify_OkButtonPressed();
549 void Notify_CancelButtonPressed();
550 void Notify_ButtonPressed(
int controlid);
551 void Notify_HandleCommand(
int controlid);
552 void Notify_TextSelectionChanged(
int controlid);
553 void Notify_ScrollChanged(
int controlid);
554 void Notify_DataListHandleDoubleClick(
int controlid,
int lineindex);
555 void Notify_DataListHandleCommand(
int controlid,
int lineindex);
556 void Notify_WindowActivated(
bool activate);
557 void Notify_WindowResized(
float newwidth,
float newheight,
float oldwidth,
float oldheight);
558 void Notify_DarkModeIsChanging(
bool isDarkMode);
559 void Notify_OSMenuCommandExecuted(EMENUID menuCommand);
560 void Notify_WindowClose();
561 void Notify_HandleSwitcherSelect(
int controlid,
int switcherindex);
562 void Notify_StepperPressed(
void* sender,
int controlid);
563 void Notify_Timer(
int timerid);
564 void Notify_MouseTrackingStarted(
FCControl *pControl);
565 void Notify_MouseTrackingStopped(
FCControl *pControl);
566 bool Notify_WindowCanClose();
567 bool Notify_HandleKeyboardCommand(
FCControl *pControl,
int character);
570 void StoreModifierKeysToWindow();
Base class for all other dialog/window classes.
Definition ff_dialogs.h:563
Base class for all UI controls in a dialog.
Definition ff_dialogs.h:1536
Class that handles a contol with multiple lines of data, arranged in columns.
Definition ff_dialogs.h:4292
A tree UI control.
Definition ff_dialogs.h:5175
Class that specifies Enigma text style. This includes font, size, efx, superscript,...
Definition ff_base.h:1757
Class to display the operating system's "Open File" modal dialog box.
Definition ff_dialogs.h:214
Class to display the operating system's "Save File As" modal dialog box.
Definition ff_dialogs.h:288
Class to display the operating system's modal folder browser dialog box.
Definition ff_dialogs.h:326
Class for document-independent font information.
Definition ff_base.h:1138
Class that encapsulates a range (start, length)
Definition ff_base.h:5570
Simple collection class for FCRange class objects.
Definition ff_basecollection.h:1525
Class that provides storage for text. This is to achieve platform-transparent text handling,...
Definition ff_base.h:1877
Collection class for FCString class objects.
Definition ff_basecollection.h:1085
An object to handle glyph information returned by the system.
Definition ff_base.h:5279
Class for UTF-8text streams.
Definition ff_stream.h:292
Class representing a single node item in a FCCtrlTree control.
Definition ff_dialogs.h:4965