File: message.hpp

package info (click to toggle)
sight 25.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 43,252 kB
  • sloc: cpp: 310,629; xml: 17,622; ansic: 9,960; python: 1,379; sh: 144; makefile: 33
file content (136 lines) | stat: -rw-r--r-- 3,357 bytes parent folder | download | duplicates (2)
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
/************************************************************************
 *
 * Copyright (C) 2015-2024 IRCAD France
 * Copyright (C) 2015 IHU Strasbourg
 *
 * This file is part of Sight.
 *
 * Sight is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Sight is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with Sight. If not, see <https://www.gnu.org/licenses/>.
 *
 ***********************************************************************/

#pragma once

#include <sight/activity/config.hpp>

#include "activity/extension/activity.hpp"

#include <data/activity.hpp>

namespace sight::activity
{

/**
 * @brief Activity information sent by signal to launch new activities in a tab.
 */
class SIGHT_ACTIVITY_CLASS_API message
{
public:

    using parameters_t = activity::extension::activity_config_params_type;

    SIGHT_ACTIVITY_API message(
        const data::activity::sptr& _activity,
        const activity::extension::activity_info& _info,
        const parameters_t& _parameters
    );

    SIGHT_ACTIVITY_API virtual ~message()
    = default;

    /// Return if the activity can be closed
    [[nodiscard]] bool is_closable() const
    {
        return m_closable;
    }

    /// Return activity title
    [[nodiscard]] const std::string& get_title() const
    {
        return m_title;
    }

    /// Return tab identifier
    [[nodiscard]] const std::string& get_tab_id() const
    {
        return m_tab_id;
    }

    /// Return appConfig identifier
    [[nodiscard]] const std::string& get_app_config_id() const
    {
        return m_app_config_id;
    }

    /// Return tab information
    [[nodiscard]] const std::string& get_tab_info() const
    {
        return m_tab_info;
    }

    /// Return activity icon path
    [[nodiscard]] const std::string& get_icon_path() const
    {
        return m_icon_path;
    }

    /// Return tooltip
    [[nodiscard]] const std::string& get_tool_tip() const
    {
        return m_tooltip;
    }

    /// Return activity
    [[nodiscard]] const data::activity::sptr& get_activity() const
    {
        return m_activity;
    }

    /// Return the map of the string association to replace in config
    [[nodiscard]] const std::map<std::string, std::string>& get_replacement_map() const
    {
        return m_replacement_map;
    }

private:

    /// Flag if activity is closable.
    bool m_closable {true};

    /// Activity title
    std::string m_title;

    /// Tab identifier
    std::string m_tab_id;

    /// config id
    std::string m_app_config_id;

    /// tab information
    std::string m_tab_info;

    /// icon path
    std::string m_icon_path;

    /// tab tooltip
    std::string m_tooltip;

    /// activity
    data::activity::sptr m_activity;

    /// map containing string to replace in activity configuration.
    std::map<std::string, std::string> m_replacement_map;
};

} // namespace sight::activity