KDDockWidgets API Documentation 2.1
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}
168{
170 const void *thisPtr = this;
171 m_setParentView_implCallback(const_cast<void *>(thisPtr), parent);
172 } else {
174 }
175}
185{
186 return ::KDDockWidgets::Core::TitleBar::supportsAutoHideButton();
187}
189{
190 return ::KDDockWidgets::Core::TitleBar::supportsFloatingButton();
191}
193{
194 return ::KDDockWidgets::Core::TitleBar::supportsMaximizeButton();
195}
197{
198 return ::KDDockWidgets::Core::TitleBar::supportsMinimizeButton();
199}
201{
202 return ::KDDockWidgets::Core::TitleBar::tabBar();
203}
205{
206 return ::KDDockWidgets::Core::TitleBar::title();
207}
209{
210 return ::KDDockWidgets::Core::TitleBar::titleBarIsFocusable();
211}
223
224}
225}
227{
228 return reinterpret_cast<KDDockWidgets::Core::TitleBar *>(ptr);
229}
234extern "C" {
240{
241 auto parent = reinterpret_cast<KDDockWidgets::Core::FloatingWindow *>(parent_);
243 return reinterpret_cast<void *>(ptr);
244}
246{
247 auto parent = reinterpret_cast<KDDockWidgets::Core::Group *>(parent_);
249 return reinterpret_cast<void *>(ptr);
250}
252{
253 auto arg__1 = reinterpret_cast<KDDockWidgets::Core::View *>(arg__1_);
255 return reinterpret_cast<void *>(ptr);
256}
257// closeButtonEnabled() const
259{
260 const auto &result = fromPtr(thisObj)->closeButtonEnabled();
261 return result;
262}
263// floatButtonToolTip() const
265{
266 const auto &result = new Dartagnan::ValueWrapper<QString> { fromPtr(thisObj)->floatButtonToolTip() };
267 return result;
268}
269// floatButtonVisible() const
271{
272 const auto &result = fromPtr(thisObj)->floatButtonVisible();
273 return result;
274}
275// floatingWindow() const
277{
278 const auto &result = fromPtr(thisObj)->floatingWindow();
279 return result;
280}
281// group() const
283{
284 const auto &result = fromPtr(thisObj)->group();
285 return result;
286}
287// hasIcon() const
289{
290 const auto &result = fromPtr(thisObj)->hasIcon();
291 return result;
292}
293// isCloseButtonEnabled() const
295{
296 const auto &result = fromPtr(thisObj)->isCloseButtonEnabled();
297 return result;
298}
299// isCloseButtonVisible() const
301{
302 const auto &result = fromPtr(thisObj)->isCloseButtonVisible();
303 return result;
304}
305// isFloatButtonVisible() const
307{
308 const auto &result = fromPtr(thisObj)->isFloatButtonVisible();
309 return result;
310}
311// isFloating() const
313{
314 const auto &result = fromPtr(thisObj)->isFloating();
315 return result;
316}
317// isFocused() const
319{
320 const auto &result = fromPtr(thisObj)->isFocused();
321 return result;
322}
323// isMDI() const
325{
326 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();} }();
327 return result;
328}
329// isOverlayed() const
331{
332 const auto &result = fromWrapperPtr(thisObj)->isOverlayed();
333 return result;
334}
335// isStandalone() const
337{
338 const auto &result = fromPtr(thisObj)->isStandalone();
339 return result;
340}
341// isWindow() const
343{
344 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();} }();
345 return result;
346}
347// mainWindow() const
349{
350 const auto &result = fromPtr(thisObj)->mainWindow();
351 return result;
352}
353// maximizeButtonVisible() const
355{
356 const auto &result = fromPtr(thisObj)->maximizeButtonVisible();
357 return result;
358}
359// onAutoHideClicked()
364// onCloseClicked()
366{
367 fromPtr(thisObj)->onCloseClicked();
368}
369// onDoubleClicked()
371{
372 const auto &result = fromPtr(thisObj)->onDoubleClicked();
373 return result;
374}
375// onFloatClicked()
377{
378 fromPtr(thisObj)->onFloatClicked();
379}
380// onMaximizeClicked()
385// onMinimizeClicked()
390// setCloseButtonEnabled(bool arg__1)
392{
393 fromPtr(thisObj)->setCloseButtonEnabled(arg__1);
394}
395// setCloseButtonVisible(bool arg__1)
397{
398 fromPtr(thisObj)->setCloseButtonVisible(arg__1);
399}
400// setFloatButtonVisible(bool arg__1)
402{
403 fromPtr(thisObj)->setFloatButtonVisible(arg__1);
404}
405// setParentView_impl(KDDockWidgets::Core::View * parent)
407{
408 auto parent = reinterpret_cast<KDDockWidgets::Core::View *>(parent_);
410}
411// setTitle(const QString & title)
412void c_KDDockWidgets__Core__TitleBar__setTitle_QString(void *thisObj, const char *title_)
413{
414 const auto title = QString::fromUtf8(title_);
415 fromPtr(thisObj)->setTitle(title);
416 free(( char * )title_);
417}
418// singleDockWidget() const
420{
421 const auto &result = fromPtr(thisObj)->singleDockWidget();
422 return result;
423}
424// supportsAutoHideButton() const
426{
427 const auto &result = fromPtr(thisObj)->supportsAutoHideButton();
428 return result;
429}
430// supportsFloatingButton() const
432{
433 const auto &result = fromPtr(thisObj)->supportsFloatingButton();
434 return result;
435}
436// supportsMaximizeButton() const
438{
439 const auto &result = fromPtr(thisObj)->supportsMaximizeButton();
440 return result;
441}
442// supportsMinimizeButton() const
444{
445 const auto &result = fromPtr(thisObj)->supportsMinimizeButton();
446 return result;
447}
448// tabBar() const
450{
451 const auto &result = fromPtr(thisObj)->tabBar();
452 return result;
453}
454// title() const
456{
457 const auto &result = new Dartagnan::ValueWrapper<QString> { fromPtr(thisObj)->title() };
458 return result;
459}
460// titleBarIsFocusable() const
462{
463 const auto &result = fromPtr(thisObj)->titleBarIsFocusable();
464 return result;
465}
466// toggleMaximized()
468{
469 fromPtr(thisObj)->toggleMaximized();
470}
471// updateButtons()
473{
474 fromPtr(thisObj)->updateButtons();
475}
477{
478 delete fromPtr(thisObj);
479}
480void c_KDDockWidgets__Core__TitleBar__registerVirtualMethodCallback(void *ptr, void *callback, int methodId)
481{
482 auto wrapper = fromWrapperPtr(ptr);
483 switch (methodId) {
484 case 553:
485 wrapper->m_isMDICallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::Callback_isMDI>(callback);
486 break;
487 case 557:
488 wrapper->m_isWindowCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::Callback_isWindow>(callback);
489 break;
490 case 331:
491 wrapper->m_setParentView_implCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::Callback_setParentView_impl>(callback);
492 break;
493 case 577:
494 wrapper->m_singleDockWidgetCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::Callback_singleDockWidget>(callback);
495 break;
496 }
497}
498}
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__setCloseButtonVisible_bool(void *thisObj, bool arg__1)
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