aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/advanceddockingsystem/dockareawidget.cpp
blob: 522b6b985ee886564dc10161f51eb79c6ba0e11e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
// Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later

#include "dockareawidget.h"

#include "ads_globals_p.h"
#include "dockareatabbar.h"
#include "dockareatitlebar.h"
#include "dockcomponentsfactory.h"
#include "dockcontainerwidget.h"
#include "dockmanager.h"
#include "dockoverlay.h"
#include "docksplitter.h"
#include "dockwidget.h"
#include "dockwidgettab.h"
#include "floatingdockcontainer.h"

#include <QList>
#include <QLoggingCategory>
#include <QMenu>
#include <QPushButton>
#include <QScrollArea>
#include <QScrollBar>
#include <QSplitter>
#include <QStackedLayout>
#include <QStyle>
#include <QVector>
#include <QWheelEvent>
#include <QXmlStreamWriter>

#include <iostream>

namespace ADS
{
    static const char *const INDEX_PROPERTY = "index";
    static const char *const ACTION_PROPERTY = "action";

    /**
     * Internal dock area layout mimics stack layout but only inserts the current
     * widget into the internal QLayout object.
     * \warning Only the current widget has a parent. All other widgets
     * do not have a parent. That means, a widget that is in this layout may
     * return nullptr for its parent() function if it is not the current widget.
     */
    class DockAreaLayout
    {
    private:
        QBoxLayout *m_parentLayout;
        QList<QWidget *> m_widgets;
        int m_currentIndex = -1;
        QWidget *m_currentWidget = nullptr;

    public:
    /**
      * Creates an instance with the given parent layout
      */
        DockAreaLayout(QBoxLayout *parentLayout)
            : m_parentLayout(parentLayout)
        {}

        /**
         * Returns the number of widgets in this layout
         */
        int count() const { return m_widgets.count(); }

        /**
         * Inserts the widget at the given index position into the internal widget
         * list
         */
        void insertWidget(int index, QWidget *widget)
        {
            widget->setParent(nullptr);
            if (index < 0)
                index = m_widgets.count();

            m_widgets.insert(index, widget);
            if (m_currentIndex < 0) {
                setCurrentIndex(index);
            } else {
                if (index <= m_currentIndex)
                    ++m_currentIndex;
            }
        }

        /**
         * Removes the given widget from the layout
         */
        void removeWidget(QWidget *widget)
        {
            if (currentWidget() == widget) {
                auto layoutItem = m_parentLayout->takeAt(1);
                if (layoutItem)
                    layoutItem->widget()->setParent(nullptr);

                m_currentWidget = nullptr;
                m_currentIndex = -1;
            } else if (indexOf(widget) < m_currentIndex) {
                --m_currentIndex;
            }
            m_widgets.removeOne(widget);
        }

        /**
         * Returns the current selected widget
         */
        QWidget *currentWidget() const { return m_currentWidget; }

        /**
         * Activates the widget with the give index.
         */
        void setCurrentIndex(int index)
        {
            QWidget *prev = currentWidget();
            QWidget *next = widget(index);
            if (!next || (next == prev && !m_currentWidget))
                return;

            bool reenableUpdates = false;
            QWidget *parent = m_parentLayout->parentWidget();

            if (parent && parent->updatesEnabled()) {
                reenableUpdates = true;
                parent->setUpdatesEnabled(false);
            }

            if (auto layoutItem = m_parentLayout->takeAt(1))
                layoutItem->widget()->setParent(nullptr);

            m_parentLayout->addWidget(next);
            if (prev)
                prev->hide();

            m_currentIndex = index;
            m_currentWidget = next;

            if (reenableUpdates)
                parent->setUpdatesEnabled(true);
        }

        /**
         * Returns the index of the current active widget
         */
        int currentIndex() const { return m_currentIndex; }

        /**
         * Returns true if there are no widgets in the layout
         */
        bool isEmpty() const { return m_widgets.empty(); }

        /**
         * Returns the index of the given widget
         */
        int indexOf(QWidget *widget) const { return m_widgets.indexOf(widget); }

        /**
         * Returns the widget for the given index
         */
        QWidget *widget(int index) const
        {
            return (index < m_widgets.size()) ? m_widgets.at(index) : nullptr;
        }

        /**
         * Returns the geometry of the current active widget
         */
        QRect geometry() const { return m_widgets.empty() ? QRect() : currentWidget()->geometry(); }
    };

    /**
     * Private data class of DockAreaWidget class (pimpl)
     */
    struct DockAreaWidgetPrivate
    {
        DockAreaWidget *q = nullptr;
        QBoxLayout *m_layout = nullptr;
        DockAreaLayout *m_contentsLayout = nullptr;
        DockAreaTitleBar *m_titleBar = nullptr;
        DockManager *m_dockManager = nullptr;
        bool m_updateTitleBarButtons = false;
        DockWidgetAreas m_allowedAreas = AllDockAreas;
        QSize m_minSizeHint;

        /**
         * Private data constructor
         */
        DockAreaWidgetPrivate(DockAreaWidget *parent);

        /**
         * Creates the layout for top area with tabs and close button
         */
        void createTitleBar();

        /**
         * Returns the dock widget with the given index
         */
        DockWidget *dockWidgetAt(int index)
        {
            return qobject_cast<DockWidget *>(m_contentsLayout->widget(index));
        }

        /**
         * Convenience function to ease title widget access by index
         */
        DockWidgetTab *tabWidgetAt(int index) { return dockWidgetAt(index)->tabWidget(); }

        /**
         * Returns the tab action of the given dock widget
         */
        QAction *dockWidgetTabAction(DockWidget *dockWidget) const
        {
            return qvariant_cast<QAction *>(dockWidget->property(ACTION_PROPERTY));
        }

        /**
         * Returns the index of the given dock widget
         */
        int dockWidgetIndex(DockWidget *dockWidget) const
        {
            return dockWidget->property(INDEX_PROPERTY).toInt();
        }

        /**
         * Convenience function for tabbar access
         */
        DockAreaTabBar *tabBar() const { return m_titleBar->tabBar(); }

        /**
         * Updates the enable state of the close and detach button
         */
        void updateTitleBarButtonStates();

        /**
         * Scans all contained dock widgets for the max. minimum size hint
         */
        void updateMinimumSizeHint()
        {
            m_minSizeHint = QSize();
            for (int i = 0; i < m_contentsLayout->count(); ++i)
            {
                auto widget = m_contentsLayout->widget(i);
                m_minSizeHint.setHeight(qMax(m_minSizeHint.height(),
                                             widget->minimumSizeHint().height()));
                m_minSizeHint.setWidth(qMax(m_minSizeHint.width(),
                                            widget->minimumSizeHint().width()));
            }
        }
    };
    // struct DockAreaWidgetPrivate

    DockAreaWidgetPrivate::DockAreaWidgetPrivate(DockAreaWidget *parent)
        : q(parent)
    {}

    void DockAreaWidgetPrivate::createTitleBar()
    {
        m_titleBar = componentsFactory()->createDockAreaTitleBar(q);
        m_layout->addWidget(m_titleBar);
        QObject::connect(tabBar(),
                         &DockAreaTabBar::tabCloseRequested,
                         q,
                         &DockAreaWidget::onTabCloseRequested);
        QObject::connect(m_titleBar,
                         &DockAreaTitleBar::tabBarClicked,
                         q,
                         &DockAreaWidget::setCurrentIndex);
        QObject::connect(tabBar(), &DockAreaTabBar::tabMoved, q, &DockAreaWidget::reorderDockWidget);
    }

    void DockAreaWidgetPrivate::updateTitleBarButtonStates()
    {
        if (q->isHidden()) {
            m_updateTitleBarButtons = true;
            return;
        }

        m_titleBar->button(TitleBarButtonClose)
            ->setEnabled(q->features().testFlag(DockWidget::DockWidgetClosable));
        m_titleBar->button(TitleBarButtonUndock)
            ->setEnabled(q->features().testFlag(DockWidget::DockWidgetFloatable));
        m_titleBar->updateDockWidgetActionsButtons();
        m_updateTitleBarButtons = false;
    }

    DockAreaWidget::DockAreaWidget(DockManager *dockManager, DockContainerWidget *parent)
        : QFrame(parent)
        , d(new DockAreaWidgetPrivate(this))
    {
        d->m_dockManager = dockManager;
        d->m_layout = new QBoxLayout(QBoxLayout::TopToBottom);
        d->m_layout->setContentsMargins(0, 0, 0, 0);
        d->m_layout->setSpacing(0);
        setLayout(d->m_layout);

        d->createTitleBar();
        d->m_contentsLayout = new DockAreaLayout(d->m_layout);
        if (d->m_dockManager)
            emit d->m_dockManager->dockAreaCreated(this);
    }

    DockAreaWidget::~DockAreaWidget()
    {
        qCInfo(adsLog) << Q_FUNC_INFO;
        delete d->m_contentsLayout;
        delete d;
    }

    DockManager *DockAreaWidget::dockManager() const { return d->m_dockManager; }

    DockContainerWidget *DockAreaWidget::dockContainer() const
    {
        return internal::findParent<DockContainerWidget *>(this);
    }

    void DockAreaWidget::addDockWidget(DockWidget *dockWidget)
    {
        insertDockWidget(d->m_contentsLayout->count(), dockWidget);
    }

    void DockAreaWidget::insertDockWidget(int index, DockWidget *dockWidget, bool activate)
    {
        d->m_contentsLayout->insertWidget(index, dockWidget);
        dockWidget->setDockArea(this);
        dockWidget->tabWidget()->setDockAreaWidget(this);
        auto tabWidget = dockWidget->tabWidget();
        // Inserting the tab will change the current index which in turn will
        // make the tab widget visible in the slot
        d->tabBar()->blockSignals(true);
        d->tabBar()->insertTab(index, tabWidget);
        d->tabBar()->blockSignals(false);
        tabWidget->setVisible(!dockWidget->isClosed());
        dockWidget->setProperty(INDEX_PROPERTY, index);
        d->m_minSizeHint.setHeight(qMax(d->m_minSizeHint.height(),
                                        dockWidget->minimumSizeHint().height()));
        d->m_minSizeHint.setWidth(qMax(d->m_minSizeHint.width(),
                                       dockWidget->minimumSizeHint().width()));
        if (activate)
            setCurrentIndex(index);

        // If this dock area is hidden, then we need to make it visible again
        // by calling dockWidget->toggleViewInternal(true);
        if (!this->isVisible() && d->m_contentsLayout->count() > 1 && !dockManager()->isRestoringState())
            dockWidget->toggleViewInternal(true);

        d->updateTitleBarButtonStates();
    }

    void DockAreaWidget::removeDockWidget(DockWidget *dockWidget)
    {
        qCInfo(adsLog) << Q_FUNC_INFO;
        auto nextOpen = nextOpenDockWidget(dockWidget);

        d->m_contentsLayout->removeWidget(dockWidget);
        auto tabWidget = dockWidget->tabWidget();
        tabWidget->hide();
        d->tabBar()->removeTab(tabWidget);
        DockContainerWidget *dockContainerWidget = dockContainer();
        if (nextOpen) {
            setCurrentDockWidget(nextOpen);
        } else if (d->m_contentsLayout->isEmpty() && dockContainerWidget->dockAreaCount() >= 1) {
            qCInfo(adsLog) << "Dock Area empty";
            dockContainerWidget->removeDockArea(this);
            this->deleteLater();
        } else {
            // if contents layout is not empty but there are no more open dock
            // widgets, then we need to hide the dock area because it does not
            // contain any visible content
            hideAreaWithNoVisibleContent();
        }

        d->updateTitleBarButtonStates();
        updateTitleBarVisibility();
        d->updateMinimumSizeHint();
        auto topLevelDockWidget = dockContainerWidget->topLevelDockWidget();
        if (topLevelDockWidget)
            topLevelDockWidget->emitTopLevelChanged(true);

#if (ADS_DEBUG_LEVEL > 0)
        dockContainerWidget->dumpLayout();
#endif
    }

    void DockAreaWidget::hideAreaWithNoVisibleContent()
    {
        this->toggleView(false);

        // Hide empty parent splitters
        auto splitter = internal::findParent<DockSplitter *>(this);
        internal::hideEmptyParentSplitters(splitter);

        //Hide empty floating widget
        DockContainerWidget *container = this->dockContainer();
        if (!container->isFloating()
            && DockManager::testConfigFlag(DockManager::HideSingleCentralWidgetTitleBar))
            return;

        updateTitleBarVisibility();
        auto topLevelWidget = container->topLevelDockWidget();
        auto floatingWidget = container->floatingWidget();
        if (topLevelWidget) {
            if (floatingWidget)
                floatingWidget->updateWindowTitle();

            DockWidget::emitTopLevelEventForWidget(topLevelWidget, true);
        } else if (container->openedDockAreas().isEmpty() && floatingWidget) {
            floatingWidget->hide();
        }
    }

    void DockAreaWidget::onTabCloseRequested(int index)
    {
        qCInfo(adsLog) << Q_FUNC_INFO << "index" << index;
        auto *currentDockWidget = dockWidget(index);
        if (currentDockWidget->features().testFlag(DockWidget::DockWidgetDeleteOnClose))
            currentDockWidget->closeDockWidgetInternal();
        else
            currentDockWidget->toggleView(false);
    }

    DockWidget *DockAreaWidget::currentDockWidget() const
    {
        int currentIdx = currentIndex();
        if (currentIdx < 0)
            return nullptr;

        return dockWidget(currentIdx);
    }

    void DockAreaWidget::setCurrentDockWidget(DockWidget *dockWidget)
    {
        if (dockManager()->isRestoringState())
            return;

        internalSetCurrentDockWidget(dockWidget);
    }

    void DockAreaWidget::internalSetCurrentDockWidget(DockWidget *dockWidget)
    {
        int index = indexOf(dockWidget);
        if (index < 0)
            return;

        setCurrentIndex(index);
    }

    void DockAreaWidget::setCurrentIndex(int index)
    {
        auto currentTabBar = d->tabBar();
        if (index < 0 || index > (currentTabBar->count() - 1)) {
            qWarning() << Q_FUNC_INFO << "Invalid index" << index;
            return;
        }

        auto cw = d->m_contentsLayout->currentWidget();
        auto nw = d->m_contentsLayout->widget(index);
        if (cw == nw && !nw->isHidden())
            return;

        emit currentChanging(index);
        currentTabBar->setCurrentIndex(index);
        d->m_contentsLayout->setCurrentIndex(index);
        d->m_contentsLayout->currentWidget()->show();
        emit currentChanged(index);
    }

    int DockAreaWidget::currentIndex() const { return d->m_contentsLayout->currentIndex(); }

    QRect DockAreaWidget::titleBarGeometry() const { return d->m_titleBar->geometry(); }

    QRect DockAreaWidget::contentAreaGeometry() const { return d->m_contentsLayout->geometry(); }

    int DockAreaWidget::indexOf(DockWidget *dockWidget)
    {
        return d->m_contentsLayout->indexOf(dockWidget);
    }

    QList<DockWidget *> DockAreaWidget::dockWidgets() const
    {
        QList<DockWidget *> dockWidgetList;
        for (int i = 0; i < d->m_contentsLayout->count(); ++i)
            dockWidgetList.append(dockWidget(i));

        return dockWidgetList;
    }

    int DockAreaWidget::openDockWidgetsCount() const
    {
        int count = 0;
        for (int i = 0; i < d->m_contentsLayout->count(); ++i) {
            if (!dockWidget(i)->isClosed())
                ++count;
        }
        return count;
    }

    QList<DockWidget *> DockAreaWidget::openedDockWidgets() const
    {
        QList<DockWidget *> dockWidgetList;
        for (int i = 0; i < d->m_contentsLayout->count(); ++i) {
            DockWidget *currentDockWidget = dockWidget(i);
            if (!currentDockWidget->isClosed())
                dockWidgetList.append(dockWidget(i));
        }
        return dockWidgetList;
    }

    int DockAreaWidget::indexOfFirstOpenDockWidget() const
    {
        for (int i = 0; i < d->m_contentsLayout->count(); ++i) {
            if (!dockWidget(i)->isClosed())
                return i;
        }

        return - 1;
    }

    int DockAreaWidget::dockWidgetsCount() const { return d->m_contentsLayout->count(); }

    DockWidget *DockAreaWidget::dockWidget(int index) const
    {
        return qobject_cast<DockWidget *>(d->m_contentsLayout->widget(index));
    }

    void DockAreaWidget::reorderDockWidget(int fromIndex, int toIndex)
    {
        qCInfo(adsLog) << Q_FUNC_INFO;
        if (fromIndex >= d->m_contentsLayout->count() || fromIndex < 0
            || toIndex >= d->m_contentsLayout->count() || toIndex < 0 || fromIndex == toIndex) {
            qCInfo(adsLog) << "Invalid index for tab movement" << fromIndex << toIndex;
            return;
        }

        auto widget = d->m_contentsLayout->widget(fromIndex);
        d->m_contentsLayout->removeWidget(widget);
        d->m_contentsLayout->insertWidget(toIndex, widget);
        setCurrentIndex(toIndex);
    }

    void DockAreaWidget::toggleDockWidgetView(DockWidget *dockWidget, bool open)
    {
        Q_UNUSED(dockWidget)
        Q_UNUSED(open)
        updateTitleBarVisibility();
    }

    void DockAreaWidget::updateTitleBarVisibility()
    {
        DockContainerWidget *container = dockContainer();
        if (!container)
            return;

        if (DockManager::testConfigFlag(DockManager::AlwaysShowTabs))
            return;

        if (d->m_titleBar) {
            bool hidden = container->hasTopLevelDockWidget() && (container->isFloating()
                          || DockManager::testConfigFlag(DockManager::HideSingleCentralWidgetTitleBar));
            d->m_titleBar->setVisible(!hidden);
        }
    }

    void DockAreaWidget::markTitleBarMenuOutdated()
    {
        if (d->m_titleBar)
            d->m_titleBar->markTabsMenuOutdated();
    }

    void DockAreaWidget::saveState(QXmlStreamWriter &stream) const
    {
        stream.writeStartElement("area");
        stream.writeAttribute("tabs", QString::number(d->m_contentsLayout->count()));
        auto localDockWidget = currentDockWidget();
        QString name = localDockWidget ? localDockWidget->objectName() : "";
        stream.writeAttribute("current", name);
        qCInfo(adsLog) << Q_FUNC_INFO << "TabCount: " << d->m_contentsLayout->count()
                       << " Current: " << name;
        for (int i = 0; i < d->m_contentsLayout->count(); ++i)
            dockWidget(i)->saveState(stream);

        stream.writeEndElement();
    }

    DockWidget *DockAreaWidget::nextOpenDockWidget(DockWidget *dockWidget) const
    {
        auto openDockWidgets = openedDockWidgets();
        if (openDockWidgets.count() > 1
            || (openDockWidgets.count() == 1 && openDockWidgets[0] != dockWidget)) {
            DockWidget *nextDockWidget;
            if (openDockWidgets.last() == dockWidget) {
                nextDockWidget = openDockWidgets[openDockWidgets.count() - 2];
            } else {
                int nextIndex = openDockWidgets.indexOf(dockWidget) + 1;
                nextDockWidget = openDockWidgets[nextIndex];
            }

            return nextDockWidget;
        } else {
            return nullptr;
        }
    }

    DockWidget::DockWidgetFeatures DockAreaWidget::features(eBitwiseOperator mode) const
    {
        if (BitwiseAnd == mode) {
            DockWidget::DockWidgetFeatures features(DockWidget::AllDockWidgetFeatures);
            for (const auto dockWidget : dockWidgets())
                features &= dockWidget->features();

            return features;
        } else {
            DockWidget::DockWidgetFeatures features(DockWidget::NoDockWidgetFeatures);
            for (const auto dockWidget : dockWidgets())
                features |= dockWidget->features();

            return features;
        }
    }

    void DockAreaWidget::toggleView(bool open)
    {
        setVisible(open);

        emit viewToggled(open);
    }

    void DockAreaWidget::setVisible(bool visible)
    {
        Super::setVisible(visible);
        if (d->m_updateTitleBarButtons)
            d->updateTitleBarButtonStates();
    }

    void DockAreaWidget::setAllowedAreas(DockWidgetAreas areas)
    {
        d->m_allowedAreas = areas;
    }

    DockWidgetAreas DockAreaWidget::allowedAreas() const
    {
        return d->m_allowedAreas;
    }

    QAbstractButton *DockAreaWidget::titleBarButton(eTitleBarButton which) const
    {
        return d->m_titleBar->button(which);
    }

    void DockAreaWidget::closeArea()
    {
        // If there is only one single dock widget and this widget has the
        // DeleteOnClose feature, then we delete the dock widget now
        auto openDockWidgets = openedDockWidgets();
        if (openDockWidgets.count() == 1
            && openDockWidgets[0]->features().testFlag(DockWidget::DockWidgetDeleteOnClose)) {
            openDockWidgets[0]->closeDockWidgetInternal();
        } else {
            for (auto dockWidget : openedDockWidgets())
                dockWidget->toggleView(false);
        }
    }

    void DockAreaWidget::closeOtherAreas() { dockContainer()->closeOtherAreas(this); }

    DockAreaTitleBar *DockAreaWidget::titleBar() const { return d->m_titleBar; }

    QSize DockAreaWidget::minimumSizeHint() const
    {
        return d->m_minSizeHint.isValid() ? d->m_minSizeHint : Super::minimumSizeHint();
    }

} // namespace ADS