~aleteoryx/muditaos

ref: 1ab84f774fd4cb6f2284157c3e1425df4986348b muditaos/module-gui/gui/widgets/visitor/GuiVisitor.hpp -rw-r--r-- 1.1 KiB
1ab84f77 — Kuba [EGD-7720] Unmounting file system on system closure 4 years ago
                                                                                
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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

namespace gui
{
    class Item;
    class Rect;
    class Text;
    class Window;
    class Label;
    class BottomBar;
    class ListItem;

    namespace status_bar
    {
        class StatusBar;
    }

    /// The general purpose abstract interface for enabling Double-Dispatch behavior throughout `gui::Item`'s
    /// inheritance hierarchy.
    class GuiVisitor
    {
      public:
        virtual void visit(gui::Item &item)                  = 0;
        virtual void visit(gui::Rect &item)                  = 0;
        virtual void visit(gui::Text &item)                  = 0;
        virtual void visit(gui::Window &item)                = 0;
        virtual void visit(gui::Label &item)                 = 0;
        virtual void visit(gui::BottomBar &item)             = 0;
        virtual void visit(gui::status_bar::StatusBar &item) = 0;
        virtual void visit(gui::ListItem &item)              = 0;
        virtual ~GuiVisitor()                                = default;
    };
} // namespace gui