DEADSOFTWARE

Document method in Visitor
[odcread.git] / fold.h
1 #ifndef _FOLD_H_
2 #define _FOLD_H_
4 #include <oberon.h>
5 #include <typeregister.h>
6 #include <store.h>
8 namespace odc {
10 /**
11 * Supertype for views (in MVC framework).
12 * Included because a Fold is a View and not a Model, for some reason.
13 */
14 class View : public Store {
15 private:
16 static const TypeProxy<View, Store> PROXY;
18 public:
19 static const std::string TYPENAME;
20 virtual const std::string &getTypeName() const;
22 View(INTEGER id);
23 /**
24 * Just calls super and reads the version and checks that its in the allowed range.
25 */
26 virtual void internalize(Reader &reader);
27 };
29 /**
30 * Folds are collapsible components in a text document.
31 */
32 class Fold : public View {
33 private:
34 static const TypeProxy<Fold, View> PROXY;
36 Store *d_hidden;
37 SHORTCHAR *d_label;
38 bool d_collapsed;
40 public:
41 static const std::string TYPENAME;
42 virtual const std::string &getTypeName() const;
44 Fold(INTEGER id);
45 /**
46 * Calls super and reads the version and checks that its in the allowed range.
47 * Then reads the state of the Fold, including the hidden part.
48 */
49 virtual void internalize(Reader &reader);
51 virtual std::string toString();
52 virtual void accept(Visitor &visitor) const;
53 };
55 }
57 #endif // _FOLD_H_