index 589b76b28783fa740cb718e700231fbb09a9d0d8..e8c78b7e57e72e5300cb122781a3eb130bda215b 100644 (file)
--- a/fold.h
+++ b/fold.h
namespace odc {
+ /**
+ * Supertype for views (in MVC framework).
+ * Included because a Fold is a View and not a Model, for some reason.
+ */
class View : public Store {
private:
- static const std::string TYPENAME;
- static const TypeProxy<View> PROXY;
+ static const TypeProxy<View, Store> PROXY;
public:
- View(INTEGER id);
- static const std::string &getType();
- static const std::string *getSuper();
+ static const std::string TYPENAME;
virtual const std::string &getTypeName() const;
+
+ View(INTEGER id);
+ /**
+ * Just calls super and reads the version and checks that its in the allowed range.
+ */
virtual void internalize(Reader &reader);
};
+ /**
+ * Folds are collapsible components in a text document.
+ */
class Fold : public View {
private:
- static const std::string TYPENAME;
- static const TypeProxy<Fold> PROXY;
+ static const TypeProxy<Fold, View> PROXY;
Store *d_hidden;
SHORTCHAR *d_label;
bool d_collapsed;
public:
- Fold(INTEGER id);
- static const std::string &getType();
- static const std::string *getSuper();
+ static const std::string TYPENAME;
virtual const std::string &getTypeName() const;
+
+ Fold(INTEGER id);
+ /**
+ * Calls super and reads the version and checks that its in the allowed range.
+ * Then reads the state of the Fold, including the hidden part.
+ */
virtual void internalize(Reader &reader);
virtual std::string toString();