*
* \author none
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#ifndef INSETBASE_H
#define INSETBASE_H
+#include <string>
#include <vector>
+#include <memory>
+class Buffer;
class BufferView;
class FuncRequest;
class MetricsInfo;
DISPATCHED_POP
};
+/** \c DispatchResult is a wrapper for dispatch_result.
+ * It can be forward-declared and passed as a function argument without
+ * having to expose insetbase.h.
+ */
+class DispatchResult {
+ dispatch_result val_;
+public:
+ DispatchResult(dispatch_result val) : val_(val) {}
+ operator dispatch_result() const{ return val_; }
+};
+
+
/// Common base class to all insets
class InsetBase {
/// type for column numbers
typedef size_t col_type;
+ /// virtual base class destructor
+ virtual ~InsetBase() {}
+ /// replicate ourselves
+ virtual std::auto_ptr<InsetBase> clone() const = 0;
+
// the real dispatcher
virtual dispatch_result dispatch
(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
/// draw inset and update (xo, yo)-cache
virtual void draw(PainterInfo & pi, int x, int y) const = 0;
- ///
- virtual ~InsetBase() {}
-
- /// Methods to cache and retrieve a cached BufferView.
- virtual void cache(BufferView *) const {}
- ///
- virtual BufferView * view() const { return 0; }
/// request "external features"
virtual void validate(LaTeXFeatures &) const {}
+ /// Appends \c list with all labels found within this inset.
+ virtual void getLabelList(Buffer const &,
+ std::vector<std::string> & /* list */) const {}
};
#endif