00001 #if !defined(__LISTMEMENTOS_HPP)
00002 #define __LISTMEMENTOS_HPP
00003
00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022
00023
00024 #if !defined(__COMMON_HPP)
00025 #include <corelinux/Common.hpp>
00026 #endif
00027
00028 #if !defined(__VECTOR_HPP)
00029 #include <corelinux/Vector.hpp>
00030 #endif
00031
00032 #if !defined(__MEMENTO_HPP)
00033 #include <corelinux/Memento.hpp>
00034 #endif
00035
00036 DECLARE_CLASS( ChangedListMemento );
00037
00038 CORELINUX_VECTOR( string , ListEntries );
00039
00044 class ChangedListMemento : public CORELINUX( Memento )
00045 {
00046 public:
00052 ChangedListMemento( ListEntriesRef aList )
00053 :
00054 CORELINUX(Memento)(),
00055 theCurrentList( aList )
00056 {
00057 ;
00058 }
00059
00065 ChangedListMemento( ChangedListMementoCref aMemento )
00066 :
00067 CORELINUX(Memento)(aMemento),
00068 theCurrentList( aMemento.theCurrentList )
00069 {
00070 ;
00071 }
00072
00074
00075 virtual ~ChangedListMemento( void )
00076 {
00077 theCurrentList.clear();
00078 }
00079
00080
00081
00082
00083
00085
00086 ChangedListMementoRef operator=( ChangedListMementoCref aMemento )
00087 {
00088 if( *this == aMemento )
00089 {
00090 ;
00091 }
00092 else
00093 {
00094 CORELINUX(Memento)::operator=( aMemento );
00095 theCurrentList.clear();
00096 theCurrentList = aMemento.theCurrentList;
00097 }
00098 return ( *this );
00099 }
00100
00102
00103 bool operator==( ChangedListMementoCref aMemento ) const
00104 {
00105 return CORELINUX(Memento)::operator==( aMemento );
00106 }
00107
00108
00109
00110
00111
00113
00114 inline ListEntriesRef getList( void )
00115 {
00116 return theCurrentList;
00117 }
00118
00119 protected:
00120
00121
00122 private:
00124
00125 ListEntries theCurrentList;
00126
00127 };
00128
00129 DECLARE_CLASS( SelectionMemento );
00130
00136 class SelectionMemento : public CORELINUX( Memento )
00137 {
00138 public:
00139
00140 SelectionMemento( string aSelection )
00141 :
00142 CORELINUX(Memento)(),
00143 theSelection( aSelection )
00144 {
00145 ;
00146 }
00147
00148 SelectionMemento( SelectionMementoCref aMemento )
00149 :
00150 CORELINUX(Memento)(aMemento),
00151 theSelection( aMemento.theSelection )
00152 {
00153 ;
00154 }
00155
00156 virtual ~SelectionMemento( void )
00157 {
00158 ;
00159 }
00160
00161
00162
00163
00164
00165 SelectionMementoRef operator=( SelectionMementoCref aMemento )
00166 {
00167 if( *this == aMemento )
00168 {
00169 ;
00170 }
00171 else
00172 {
00173 CORELINUX(Memento)::operator=( aMemento );
00174 theSelection = aMemento.theSelection ;
00175 }
00176 return ( *this );
00177 }
00178
00179 bool operator==( SelectionMementoCref aMemento ) const
00180 {
00181 return CORELINUX(Memento)::operator==( aMemento );
00182 }
00183
00184
00185
00186
00187
00188 inline string &getSelected( void )
00189 {
00190 return theSelection;
00191 }
00192
00193 protected:
00194
00195
00196 private:
00197
00198 string theSelection;
00199
00200 };
00201
00202 DECLARE_CLASS( EditSelectionMemento );
00203
00209 class EditSelectionMemento : public CORELINUX( Memento )
00210 {
00211 public:
00212
00213 EditSelectionMemento( string aSelection, string aChange )
00214 :
00215 CORELINUX(Memento)(),
00216 theSelection( aSelection ),
00217 theChange( aChange )
00218 {
00219 ;
00220 }
00221
00222 EditSelectionMemento( EditSelectionMementoCref aMemento )
00223 :
00224 CORELINUX(Memento)(aMemento),
00225 theSelection( aMemento.theSelection ),
00226 theChange( aMemento.theChange )
00227 {
00228 ;
00229 }
00230
00231 virtual ~EditSelectionMemento( void )
00232 {
00233 ;
00234 }
00235
00236
00237
00238
00239
00240 EditSelectionMementoRef operator=( EditSelectionMementoCref aMemento )
00241 {
00242 if( *this == aMemento )
00243 {
00244 ;
00245 }
00246 else
00247 {
00248 CORELINUX(Memento)::operator=( aMemento );
00249 theSelection = aMemento.theSelection ;
00250 theChange = aMemento.theChange;
00251 }
00252 return ( *this );
00253 }
00254
00255 bool operator==( EditSelectionMementoCref aMemento ) const
00256 {
00257 return CORELINUX(Memento)::operator==( aMemento );
00258 }
00259
00260
00261
00262
00263
00264
00265 inline string &getSelected( void )
00266 {
00267 return theSelection;
00268 }
00269
00270 inline string &getChange( void )
00271 {
00272 return theChange;
00273 }
00274
00275 protected:
00276
00277
00278 private:
00279
00280 string theSelection;
00281 string theChange;
00282
00283 };
00284
00285
00286
00287 #endif
00288
00289 00290 00291 00292 00293 00294 00295
00296
00297