Remove Smart Link action code, add a new action for Link Opposite and document a...
[synfig.git] / synfig-studio / src / synfigapp / actions / valuedesclink.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file valuedesclink.h
3 **      \brief Template File
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **      Copyright (c) 2007 Chris Moore
10 **      Copyright (c) 2010 Carlos López
11 **
12 **      This package is free software; you can redistribute it and/or
13 **      modify it under the terms of the GNU General Public License as
14 **      published by the Free Software Foundation; either version 2 of
15 **      the License, or (at your option) any later version.
16 **
17 **      This package is distributed in the hope that it will be useful,
18 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
19 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 **      General Public License for more details.
21 **      \endlegal
22 */
23 /* ========================================================================= */
24
25 /* === S T A R T =========================================================== */
26
27 #ifndef __SYNFIG_APP_ACTION_VALUEDESCLINK_H
28 #define __SYNFIG_APP_ACTION_VALUEDESCLINK_H
29
30 /* === H E A D E R S ======================================================= */
31
32 #include <synfigapp/action.h>
33 #include <synfigapp/value_desc.h>
34 #include <list>
35
36 /* === M A C R O S ========================================================= */
37
38 /* === T Y P E D E F S ===================================================== */
39
40 /* === C L A S S E S & S T R U C T S ======================================= */
41
42 namespace synfigapp {
43
44 namespace Action {
45
46 class ValueDescLink :
47         public Super
48 {
49 private:
50         friend class ValueDescLinkOpposite;
51         //! List of Value Descriptions retrieved from the action Parameters list
52         //! to be linked
53         std::list<ValueDesc> value_desc_list;
54         //! Selected value node from the Value Descriptions (maybe none)
55         //! to which the others would link
56         synfig::ValueNode::Handle link_value_node;
57         //! If poison is true then Link is not possible (two exported value nodes found)
58         bool poison;
59         //! Used to monitorize the tie decision when selecting the link value node
60         int status_level;
61         //! Message to inform the status of the tie decision when selecting the link value node
62         synfig::String status_message;
63         //! Time where the value nodes are evaluated
64         synfig::Time time;
65         //! Scalar value of the link value node. It is used for linking tangents.
66         //! In the synfig::ParamDesc list there is a value used to draw the tangents on the
67         //! canvas that is called scalar
68         synfig::Real link_scalar;
69         //! If true then link opposite is being called.
70         bool link_opposite;
71 public:
72
73         ValueDescLink();
74
75         static ParamVocab get_param_vocab();
76         static bool is_candidate(const ParamList &x);
77
78         virtual bool set_param(const synfig::String& name, const Param &);
79         virtual bool is_ready()const;
80
81         virtual void prepare();
82
83         ACTION_MODULE_EXT
84 };
85
86 class ValueDescLinkOpposite :
87         public ValueDescLink
88 {
89 public:
90
91         ValueDescLinkOpposite();
92
93         static ParamVocab get_param_vocab();
94         static bool is_candidate(const ParamList &x);
95
96         virtual bool set_param(const synfig::String& name, const Param &);
97         virtual bool is_ready()const;
98
99         virtual void prepare();
100
101         ACTION_MODULE_EXT
102 };
103
104 }; // END of namespace action
105 }; // END of namespace studio
106
107 /* === E N D =============================================================== */
108
109 #endif