KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
KDDWBindingsCore/TitleBar_c.cpp
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2019 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6
7 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8
9 Contact KDAB at <info@kdab.com> for commercial licensing options.
10*/
11#include "TitleBar_c.h"
12
13
14#include <iostream>
15
16#include <cassert>
17
18
19namespace Dartagnan {
20
21typedef int (*CleanupCallback)(void *thisPtr);
23
24template<typename T>
25struct ValueWrapper
26{
27 T value;
28};
29
30}
32namespace KDDWBindingsCore {
38 : ::KDDockWidgets::Core::TitleBar(parent)
39{
40}
42 : ::KDDockWidgets::Core::TitleBar(arg__1)
43{
44}
46{
47 return ::KDDockWidgets::Core::TitleBar::closeButtonEnabled();
48}
50{
51 return ::KDDockWidgets::Core::TitleBar::floatButtonToolTip();
52}
54{
55 return ::KDDockWidgets::Core::TitleBar::floatButtonVisible();
56}
58{
59 return ::KDDockWidgets::Core::TitleBar::floatingWindow();
60}
62{
63 return ::KDDockWidgets::Core::TitleBar::group();
64}
66{
67 return ::KDDockWidgets::Core::TitleBar::hasIcon();
68}
70{
71 return ::KDDockWidgets::Core::TitleBar::isCloseButtonEnabled();
72}
74{
75 return ::KDDockWidgets::Core::TitleBar::isCloseButtonVisible();
76}
78{
79 return ::KDDockWidgets::Core::TitleBar::isFloatButtonVisible();
80}
82{
83 return ::KDDockWidgets::Core::TitleBar::isFloating();
84}
86{
87 return ::KDDockWidgets::Core::TitleBar::isFocused();
88}
90{
91 if (m_isMDICallback) {
92 const void *thisPtr = this;
93 return m_isMDICallback(const_cast<void *>(thisPtr));
94 } else {
95 return ::KDDockWidgets::Core::TitleBar::isMDI();
96 }
97}
99{
100 return ::KDDockWidgets::Core::TitleBar::isMDI();
101}
103{
104 return ::KDDockWidgets::Core::TitleBar::isOverlayed();
105}
107{
108 return ::KDDockWidgets::Core::TitleBar::isStandalone();
109}
111{
112 if (m_isWindowCallback) {
113 const void *thisPtr = this;
114 return m_isWindowCallback(const_cast<void *>(thisPtr));
115 } else {
116 return ::KDDockWidgets::Core::TitleBar::isWindow();
117 }
118}
120{
121 return ::KDDockWidgets::Core::TitleBar::isWindow();
122}
124{
125 return ::KDDockWidgets::Core::TitleBar::mainWindow();
126}
128{
129 return ::KDDockWidgets::Core::TitleBar::maximizeButtonVisible();
130}
140{
141 return ::KDDockWidgets::Core::TitleBar::onDoubleClicked();
142}
164{
166 const void *thisPtr = this;
167 m_setParentView_implCallback(const_cast<void *>(thisPtr), parent);
168 } else {
170 }
171}
181{
182 return ::KDDockWidgets::Core::TitleBar::supportsAutoHideButton();
183}
185{
186 return ::KDDockWidgets::Core::TitleBar::supportsFloatingButton();
187}
189{
190 return ::KDDockWidgets::Core::TitleBar::supportsMaximizeButton();
191}
193{
194 return ::KDDockWidgets::Core::TitleBar::supportsMinimizeButton();
195}
197{
198 return ::KDDockWidgets::Core::TitleBar::tabBar();
199}
201{
202 return ::KDDockWidgets::Core::TitleBar::title();
203}
205{
206 return ::KDDockWidgets::Core::TitleBar::titleBarIsFocusable();
207}
219
220}
221}
223{
224 return reinterpret_cast<KDDockWidgets::Core::TitleBar *>(ptr);
225}
230extern "C" {
236{
237 auto parent = reinterpret_cast<KDDockWidgets::Core::FloatingWindow *>(parent_);
239 return reinterpret_cast<void *>(ptr);
240}
242{
243 auto parent = reinterpret_cast<KDDockWidgets::Core::Group *>(parent_);
245 return reinterpret_cast<void *>(ptr);
246}
248{
249 auto arg__1 = reinterpret_cast<KDDockWidgets::Core::View *>(arg__1_);
251 return reinterpret_cast<void *>(ptr);
252}
253// closeButtonEnabled() const
255{
256 const auto &result = fromPtr(thisObj)->closeButtonEnabled();
257 return result;
258}
259// floatButtonToolTip() const
261{
262 const auto &result = new Dartagnan::ValueWrapper<QString> { fromPtr(thisObj)->floatButtonToolTip() };
263 return result;
264}
265// floatButtonVisible() const
267{
268 const auto &result = fromPtr(thisObj)->floatButtonVisible();
269 return result;
270}
271// floatingWindow() const
273{
274 const auto &result = fromPtr(thisObj)->floatingWindow();
275 return result;
276}
277// group() const
279{
280 const auto &result = fromPtr(thisObj)->group();
281 return result;
282}
283// hasIcon() const
285{
286 const auto &result = fromPtr(thisObj)->hasIcon();
287 return result;
288}
289// isCloseButtonEnabled() const
291{
292 const auto &result = fromPtr(thisObj)->isCloseButtonEnabled();
293 return result;
294}
295// isCloseButtonVisible() const
297{
298 const auto &result = fromPtr(thisObj)->isCloseButtonVisible();
299 return result;
300}
301// isFloatButtonVisible() const
303{
304 const auto &result = fromPtr(thisObj)->isFloatButtonVisible();
305 return result;
306}
307// isFloating() const
309{
310 const auto &result = fromPtr(thisObj)->isFloating();
311 return result;
312}
313// isFocused() const
315{
316 const auto &result = fromPtr(thisObj)->isFocused();
317 return result;
318}
319// isMDI() const
321{
322 const auto &result = [&] {auto targetPtr = fromPtr(thisObj);auto wrapperPtr = dynamic_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper*>(targetPtr);if (wrapperPtr) { return wrapperPtr->isMDI_nocallback();} else { return targetPtr->isMDI();} }();
323 return result;
324}
325// isOverlayed() const
327{
328 const auto &result = fromWrapperPtr(thisObj)->isOverlayed();
329 return result;
330}
331// isStandalone() const
333{
334 const auto &result = fromPtr(thisObj)->isStandalone();
335 return result;
336}
337// isWindow() const
339{
340 const auto &result = [&] {auto targetPtr = fromPtr(thisObj);auto wrapperPtr = dynamic_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper*>(targetPtr);if (wrapperPtr) { return wrapperPtr->isWindow_nocallback();} else { return targetPtr->isWindow();} }();
341 return result;
342}
343// mainWindow() const
345{
346 const auto &result = fromPtr(thisObj)->mainWindow();
347 return result;
348}
349// maximizeButtonVisible() const
351{
352 const auto &result = fromPtr(thisObj)->maximizeButtonVisible();
353 return result;
354}
355// onAutoHideClicked()
360// onCloseClicked()
362{
363 fromPtr(thisObj)->onCloseClicked();
364}
365// onDoubleClicked()
367{
368 const auto &result = fromPtr(thisObj)->onDoubleClicked();
369 return result;
370}
371// onFloatClicked()
373{
374 fromPtr(thisObj)->onFloatClicked();
375}
376// onMaximizeClicked()
381// onMinimizeClicked()
386// setCloseButtonEnabled(bool arg__1)
388{
389 fromPtr(thisObj)->setCloseButtonEnabled(arg__1);
390}
391// setFloatButtonVisible(bool arg__1)
393{
394 fromPtr(thisObj)->setFloatButtonVisible(arg__1);
395}
396// setParentView_impl(KDDockWidgets::Core::View * parent)
398{
399 auto parent = reinterpret_cast<KDDockWidgets::Core::View *>(parent_);
401}
402// setTitle(const QString & title)
403void c_KDDockWidgets__Core__TitleBar__setTitle_QString(void *thisObj, const char *title_)
404{
405 const auto title = QString::fromUtf8(title_);
406 fromPtr(thisObj)->setTitle(title);
407 free(( char * )title_);
408}
409// singleDockWidget() const
411{
412 const auto &result = fromPtr(thisObj)->singleDockWidget();
413 return result;
414}
415// supportsAutoHideButton() const
417{
418 const auto &result = fromPtr(thisObj)->supportsAutoHideButton();
419 return result;
420}
421// supportsFloatingButton() const
423{
424 const auto &result = fromPtr(thisObj)->supportsFloatingButton();
425 return result;
426}
427// supportsMaximizeButton() const
429{
430 const auto &result = fromPtr(thisObj)->supportsMaximizeButton();
431 return result;
432}
433// supportsMinimizeButton() const
435{
436 const auto &result = fromPtr(thisObj)->supportsMinimizeButton();
437 return result;
438}
439// tabBar() const
441{
442 const auto &result = fromPtr(thisObj)->tabBar();
443 return result;
444}
445// title() const
447{
448 const auto &result = new Dartagnan::ValueWrapper<QString> { fromPtr(thisObj)->title() };
449 return result;
450}
451// titleBarIsFocusable() const
453{
454 const auto &result = fromPtr(thisObj)->titleBarIsFocusable();
455 return result;
456}
457// toggleMaximized()
459{
460 fromPtr(thisObj)->toggleMaximized();
461}
462// updateButtons()
464{
465 fromPtr(thisObj)->updateButtons();
466}
468{
469 delete fromPtr(thisObj);
470}
471void c_KDDockWidgets__Core__TitleBar__registerVirtualMethodCallback(void *ptr, void *callback, int methodId)
472{
473 auto wrapper = fromWrapperPtr(ptr);
474 switch (methodId) {
475 case 544:
476 wrapper->m_isMDICallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::Callback_isMDI>(callback);
477 break;
478 case 548:
479 wrapper->m_isWindowCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::Callback_isWindow>(callback);
480 break;
481 case 331:
482 wrapper->m_setParentView_implCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::Callback_setParentView_impl>(callback);
483 break;
484 case 567:
485 wrapper->m_singleDockWidgetCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::Callback_singleDockWidget>(callback);
486 break;
487 }
488}
489}
static KDDockWidgets::Core::TitleBar * fromPtr(void *ptr)
void * c_KDDockWidgets__Core__TitleBar__constructor_FloatingWindow(void *parent_)
bool c_KDDockWidgets__Core__TitleBar__isFloating(void *thisObj)
void c_KDDockWidgets__Core__TitleBar_Finalizer(void *cppObj)
void c_KDDockWidgets__Core__TitleBar__onCloseClicked(void *thisObj)
bool c_KDDockWidgets__Core__TitleBar__closeButtonEnabled(void *thisObj)
bool c_KDDockWidgets__Core__TitleBar__supportsMaximizeButton(void *thisObj)
void c_KDDockWidgets__Core__TitleBar__onMinimizeClicked(void *thisObj)
void * c_KDDockWidgets__Core__TitleBar__floatButtonToolTip(void *thisObj)
bool c_KDDockWidgets__Core__TitleBar__supportsAutoHideButton(void *thisObj)
bool c_KDDockWidgets__Core__TitleBar__isWindow(void *thisObj)
bool c_KDDockWidgets__Core__TitleBar__onDoubleClicked(void *thisObj)
bool c_KDDockWidgets__Core__TitleBar__supportsFloatingButton(void *thisObj)
bool c_KDDockWidgets__Core__TitleBar__supportsMinimizeButton(void *thisObj)
bool c_KDDockWidgets__Core__TitleBar__floatButtonVisible(void *thisObj)
void * c_KDDockWidgets__Core__TitleBar__tabBar(void *thisObj)
bool c_KDDockWidgets__Core__TitleBar__hasIcon(void *thisObj)
void c_KDDockWidgets__Core__TitleBar__setCloseButtonEnabled_bool(void *thisObj, bool arg__1)
void * c_KDDockWidgets__Core__TitleBar__constructor_View(void *arg__1_)
bool c_KDDockWidgets__Core__TitleBar__isMDI(void *thisObj)
bool c_KDDockWidgets__Core__TitleBar__isOverlayed(void *thisObj)
void * c_KDDockWidgets__Core__TitleBar__singleDockWidget(void *thisObj)
void * c_KDDockWidgets__Core__TitleBar__mainWindow(void *thisObj)
void c_KDDockWidgets__Core__TitleBar__setFloatButtonVisible_bool(void *thisObj, bool arg__1)
void c_KDDockWidgets__Core__TitleBar__onFloatClicked(void *thisObj)
void c_KDDockWidgets__Core__TitleBar__toggleMaximized(void *thisObj)
void * c_KDDockWidgets__Core__TitleBar__title(void *thisObj)
bool c_KDDockWidgets__Core__TitleBar__isStandalone(void *thisObj)
void c_KDDockWidgets__Core__TitleBar__setParentView_impl_View(void *thisObj, void *parent_)
bool c_KDDockWidgets__Core__TitleBar__isFocused(void *thisObj)
bool c_KDDockWidgets__Core__TitleBar__isCloseButtonVisible(void *thisObj)
bool c_KDDockWidgets__Core__TitleBar__titleBarIsFocusable(void *thisObj)
void c_KDDockWidgets__Core__TitleBar__registerVirtualMethodCallback(void *ptr, void *callback, int methodId)
void * c_KDDockWidgets__Core__TitleBar__constructor_Group(void *parent_)
bool c_KDDockWidgets__Core__TitleBar__maximizeButtonVisible(void *thisObj)
void c_KDDockWidgets__Core__TitleBar__setTitle_QString(void *thisObj, const char *title_)
void * c_KDDockWidgets__Core__TitleBar__floatingWindow(void *thisObj)
void * c_KDDockWidgets__Core__TitleBar__group(void *thisObj)
bool c_KDDockWidgets__Core__TitleBar__isCloseButtonEnabled(void *thisObj)
void c_KDDockWidgets__Core__TitleBar__destructor(void *thisObj)
void c_KDDockWidgets__Core__TitleBar__onAutoHideClicked(void *thisObj)
void c_KDDockWidgets__Core__TitleBar__updateButtons(void *thisObj)
static KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper * fromWrapperPtr(void *ptr)
bool c_KDDockWidgets__Core__TitleBar__isFloatButtonVisible(void *thisObj)
void c_KDDockWidgets__Core__TitleBar__onMaximizeClicked(void *thisObj)
void(* Callback_setParentView_impl)(void *, KDDockWidgets::Core::View *parent)
virtual void setParentView_impl(View *parent)
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
TabBar * tabBar() const
Returns the tab bar which is under this title bar. It's only nullptr for the case of having a Floatin...
bool isFocused() const
returns whether any of the DockWidgets this TitleBar controls has a child focus Not to be confused wi...
bool supportsMinimizeButton() const
returns whether this title bar supports a minimize button
bool isStandalone() const
Returns whether this titlebar is standalone. See comment in the ctor.
void setTitle(const QString &title)
Core::DockWidget * singleDockWidget() const override final
Core::Group * group() const
getter for m_group
bool supportsAutoHideButton() const
returns whether this title bar supports the auto-hide button
void updateButtons()
updates the close button enabled state
bool supportsMaximizeButton() const
returns whether this title bar supports a maximize/restore button
bool isFloating() const
Returns true if this title-bar is the title bar of a floating window.
bool hasIcon() const
returns whether this title bar has an icon
bool supportsFloatingButton() const
returns whether this title bar supports a floating/docking button
FloatingWindow * floatingWindow() const
getter for m_floatingWindow
MainWindow * mainWindow() const
If this title bar belongs to a dock widget docked into the main window, returns the main window Retur...
int(* CleanupCallback)(void *thisPtr)
Definition Config_c.cpp:21
static CleanupCallback s_cleanupCallback
Definition Config_c.cpp:22
Class to abstract QAction, so code still works with QtQuick and Flutter.
QString fromUtf8(const char *str, int size)

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8