initial version
[synfig.git] / synfig-studio / trunk / src / gtkmm / valuelink.h
1 /* === S I N F G =========================================================== */
2 /*!     \file valuelink.h
3 **      \brief ValueBase Link Header
4 **
5 **      $Id: valuelink.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2004 Adrian Bentley
9 **
10 **      This software and associated documentation
11 **      are CONFIDENTIAL and PROPRIETARY property of
12 **      the above-mentioned copyright holder.
13 **
14 **      You may not copy, print, publish, or in any
15 **      other way distribute this software without
16 **      a prior written agreement with
17 **      the copyright holder.
18 **      \endlegal
19 */
20 /* ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __SINFG_VALUELINK_H
25 #define __SINFG_VALUELINK_H
26
27 /* === H E A D E R S ======================================================= */
28 #include <sinfg/valuenode.h>
29
30 /* === M A C R O S ========================================================= */
31
32 /* === T Y P E D E F S ===================================================== */
33
34 /* === C L A S S E S & S T R U C T S ======================================= */
35
36 namespace studio {
37
38 /* NOTE: DO NOT USE THE INDEX BASED INTERFACE... THINGS WILL CHANGE
39 */
40 class ValueBaseLink : public sinfg::LinkableValueNode
41 {
42         typedef std::vector<ValueNode::Handle> list_type;
43         list_type       list;
44
45 protected:
46         //stuff I don't want
47         virtual bool set_link_vfunc(int i,sinfg::ValueNode::Handle x) {return false;}
48         virtual LinkableValueNode* create_new()const {return 0;}
49         
50         //new stuff I need
51         list_type::const_iterator findlink(sinfg::ValueNode::Handle x) const;
52         list_type::iterator findlink(sinfg::ValueNode::Handle x);
53         
54 public: //linkable interface
55         
56         //stuff I do want       
57         virtual sinfg::ValueNode::LooseHandle get_link_vfunc(int i)const;
58         virtual int link_count()const;
59         
60         //I have to support the thing because it's too much work otherwise
61         virtual sinfg::String link_local_name(int i)const;
62         virtual sinfg::String link_name(int i)const;
63
64 public:
65         ValueBaseLink();
66         virtual ~ValueBaseLink();
67
68         //don't want
69         virtual int get_link_index_from_name(const sinfg::String &name)const;
70
71         //new add and subtract stuff
72         virtual void add(sinfg::ValueNode::Handle v);
73         virtual void remove(sinfg::ValueNode::Handle v);
74
75 };
76         
77 }; // END of namespace studio
78
79 /* === E N D =============================================================== */
80
81 #endif