BALL
1.4.1
|
00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: selectable.h,v 1.20 2005/12/23 17:01:41 amoll Exp $ 00005 // 00006 00007 #ifndef BALL_CONCEPT_SELECTABLE_H 00008 #define BALL_CONCEPT_SELECTABLE_H 00009 00010 #ifndef BALL_COMMON_H 00011 # include <BALL/common.h> 00012 #endif 00013 00014 #ifndef BALL_CONCEPT_PERSISTENTOBJECT_H 00015 # include <BALL/CONCEPT/persistentObject.h> 00016 #endif 00017 00018 #define BALL_SELECTABLE_DEFAULT_SELECTION false 00019 00020 namespace BALL 00021 { 00022 00036 class BALL_EXPORT Selectable 00037 { 00038 public: 00039 00043 00047 Selectable() 00048 ; 00049 00055 Selectable(const Selectable& selectable, bool deep = true) 00056 ; 00057 00061 virtual ~Selectable() 00062 ; 00063 00067 virtual void clear() 00068 ; 00069 00071 00075 00080 void set(const Selectable& selectable, bool deep = true) 00081 ; 00082 00088 const Selectable& operator = (const Selectable& selectable) 00089 ; 00090 00095 void get(Selectable& selectable, bool deep = true) const 00096 ; 00097 00101 void swap(Selectable& selectable) 00102 ; 00104 00108 00112 virtual void select() 00113 ; 00114 00118 virtual void deselect() 00119 ; 00120 00123 virtual void setSelected(bool selected) 00124 { selected_ = selected; } 00125 00127 00130 00134 bool isSelected() const 00135 ; 00136 00139 bool operator == (const Selectable& selectable) const 00140 ; 00141 00144 bool operator != (const Selectable& selectable) const 00145 ; 00146 00148 00152 00159 void write(PersistenceManager& pm) const 00160 ; 00161 00168 bool read(PersistenceManager& pm) 00169 ; 00170 00172 00175 00177 virtual void dump(::std::ostream& s = std::cout, Size depth = 0) const 00178 ; 00179 00181 00182 protected: 00183 00184 bool selected_; 00185 }; 00186 00187 # ifndef BALL_NO_INLINE_FUNCTIONS 00188 # include <BALL/CONCEPT/selectable.iC> 00189 # endif 00190 00191 } // namespace BALL 00192 00193 #endif // BALL_CONCEPT_SELECTABLE_H