]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetLabel.h
Update Win installer for new dictionary links. Untested.
[lyx.git] / src / insets / InsetLabel.h
index 375430b7bfd38e4187a250da1c130b6c071768ad..c2768af417420626f6e617dc731f2c15cd77440a 100644 (file)
 
 namespace lyx {
 
-class Counter;
-
-class InsetLabel : public InsetCommand 
+class InsetLabel : public InsetCommand
 {
 public:
        ///
        InsetLabel(Buffer * buf, InsetCommandParams const &);
 
-       /// verify label and update references.
-       /**
-         * Overloaded from Inset::initView.
-         **/
-       void initView();
-
        ///
-       bool isLabeled() const { return true; }
-
+       docstring const & activeCounter() const { return active_counter_; }
        ///
-       docstring screenLabel() const;
+       docstring const & counterValue() const { return counter_value_; }
        ///
-       bool hasSettings() const { return true; }
+       docstring const & prettyCounter() const { return pretty_counter_; }
        ///
-       InsetCode lyxCode() const { return LABEL_CODE; }
+       docstring const & formattedCounter() const { return formatted_counter_; }
        ///
-       int plaintext(odocstream &, OutputParams const &) const;
+       void setCounterValue(docstring cv) { counter_value_ = cv; }
        ///
-       int docbook(odocstream &, OutputParams const &) const;
+       void setPrettyCounter(docstring pc) { pretty_counter_ = pc; }
        ///
-       docstring xhtml(XHTMLStream &, OutputParams const &) const;
+       void setFormattedCounter(docstring fc) { formatted_counter_ = fc; }
        ///
-       static ParamInfo const & findInfo(std::string const &);
+       int rowFlags() const override { return CanBreakBefore | CanBreakAfter; }
+       /// Updates only the label string, doesn't handle undo nor references.
+       void updateLabel(docstring const & new_label, bool const active = true);
+       /// Updates the label and the references to it.
+       /// Will also handle undo/redo if \p cursor is passed.
+       void updateLabelAndRefs(docstring const & new_label, Cursor * cursor = 0);
+
+       /// \name Public functions inherited from Inset class
+       //@{
+       /// verify label and update references.
+       void initView() override;
        ///
-       static std::string defaultCommand() { return "label"; }
+       bool isLabeled() const override { return true; }
        ///
-       static bool isCompatibleCommand(std::string const & s) 
-               { return s == "label"; }
+       bool hasSettings() const override { return true; }
        ///
-       void updateBuffer(ParIterator const & it, UpdateType);
+       InsetCode lyxCode() const override { return LABEL_CODE; }
        ///
-       void addToToc(DocIterator const &);
+       void latex(otexstream & os, OutputParams const & runparams_in) const override;
        ///
-       void updateCommand(docstring const & new_label, bool updaterefs = true);
+       int plaintext(odocstringstream & ods, OutputParams const & op,
+                     size_t max_length = INT_MAX) const override;
        ///
-       bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & status) const;
+       void docbook(XMLStream &, OutputParams const &) const override;
        ///
-       docstring const & activeCounter() const { return active_counter_; }
+       docstring xhtml(XMLStream &, OutputParams const &) const override;
        ///
-       docstring const & counterValue() const { return counter_value_; }
+       void updateBuffer(ParIterator const & it, UpdateType, bool const deleted = false) override;
        ///
-       docstring const & prettyCounter() const { return pretty_counter_; }
-protected:
+       void addToToc(DocIterator const & di, bool output_active,
+                                 UpdateType utype, TocBackend & backend) const override;
+       /// Is the content of this inset part of the immediate (visible) text sequence?
+       bool isPartOfTextSequence() const override { return false; }
        ///
-       void doDispatch(Cursor & cur, FuncRequest & cmd);
+       bool inheritFont() const override { return false; }
+       //@}
+
+       /// \name Static public methods obligated for InsetCommand derived classes
+       //@{
+       ///
+       static ParamInfo const & findInfo(std::string const &);
+       ///
+       static std::string defaultCommand() { return "label"; }
+       ///
+       static bool isCompatibleCommand(std::string const & s)
+               { return s == "label"; }
+       //@}
+
+       //FIXME: private
+       /// \name Private functions inherited from InsetCommand class
+       //@{
+       ///
+       docstring screenLabel() const override;
+       //@}
+
 private:
+       /// \name Private functions inherited from Inset class
+       //@{
+       ///
+       Inset * clone() const override { return new InsetLabel(*this); }
        ///
-       Inset * clone() const { return new InsetLabel(*this); }
+       bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & status) const override;
+       ///
+       void doDispatch(Cursor & cur, FuncRequest & cmd) override;
+       //@}
+
+       ///
+       void uniqueLabel(docstring & label) const;
+       ///
+       void updateReferences(docstring const & old_label,
+               docstring const & new_label, bool const changes);
        ///
        docstring screen_label_;
        ///
@@ -81,6 +117,8 @@ private:
        docstring counter_value_;
        ///
        docstring pretty_counter_;
+       ///
+       docstring formatted_counter_;
 };