~aleteoryx/muditaos

ref: 196c02686ae5b344e6814800b7cb8aa2473f15ea muditaos/module-gui/gui/SwitchData.hpp -rw-r--r-- 1.9 KiB
196c0268 — Przemyslaw Brudny [EGD-2395] Added BottomTop orientation support for listView. Created SMSThreadViewWindow and SMSOutputWidget. MessagesStyle moved from global Style.hpp. Fixes in Text. ListView fixes, BoxLayout callback for requestedSize. Added smsInput into list. Drafts handling added. 5 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once

#include <string>

namespace gui
{

    /// base class storing information sent along with switch message
    /// for extended use with windows please inherit from this class to extend it
    ///
    /// used combined with:
    /// * Application->switchWindow(...) function changing window within current application
    /// * Application::handleSwitchWindow(...) ApplicationManager call changing window between apps (and within current
    /// if requested)
    class SwitchData
    {
      protected:
        std::string description = "";

      public:
        SwitchData() = default;
        SwitchData(const std::string &description) : description{description} {};
        virtual ~SwitchData() = default;
        virtual const std::string &getDescription() const
        {
            return description;
        };
        virtual void setDescription(const std::string desc)
        {
            description = desc;
        };
        /// informs ApplicationManager to not close caller application when switching from app to app
        bool disableAppClose = false;
        /// informs App window stack that requested window should be ignored on windows stack.
        ///
        /// This affects window back mechanics. Having switchWindow calls like that:
        /// `WinA = { ignoreCurrentWindowOnStack = true } => WinB  => WinC`
        /// requesting getting back in WinC will result in:
        /// `WinC => WinA`
        bool ignoreCurrentWindowOnStack = false;
    };

    class SwitchSpecialChar : public SwitchData
    {
      public:
        std::string requester = "";
        enum class Type
        {
            Request,
            Response,
        } type = Type::Request;
        SwitchSpecialChar(Type type, const std::string requester, const std::string &description = "")
            : SwitchData(description), requester(requester), type(type)
        {}
        virtual ~SwitchSpecialChar() = default;
    };

} /* namespace gui */