X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=fold.h;h=e8c78b7e57e72e5300cb122781a3eb130bda215b;hb=7a97d981de20c2e9e9fa27d06f5b2c69ea09de16;hp=78eaa4e004aafb20da4f18afaa96796374b20b86;hpb=51b3593cbfb33c1d7b4b588f3841c3c405e3a215;p=odcread.git diff --git a/fold.h b/fold.h index 78eaa4e..e8c78b7 100644 --- a/fold.h +++ b/fold.h @@ -1,5 +1,5 @@ -#ifndef _TEXTMODEL_H_ -#define _TEXTMODEL_H_ +#ifndef _FOLD_H_ +#define _FOLD_H_ #include #include @@ -7,37 +7,51 @@ 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 PROXY; + static const TypeProxy 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 PROXY; + static const TypeProxy 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(); + virtual void accept(Visitor &visitor) const; }; } -#endif +#endif // _FOLD_H_