]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/Menubar_pimpl.h
sourcedoc-friendly files.
[lyx.git] / src / frontends / xforms / Menubar_pimpl.h
index 7fbc5880efc2e7886c82d2a9ee26efea081db5e5..cac54fda2378385f0f3a35d19202477034ee35b4 100644 (file)
@@ -1,35 +1,32 @@
 // -*- C++ -*-
-/* This file is part of
- * ======================================================
- * 
- *           LyX, The Document Processor
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2000 The LyX Team.
+/**
+ * \file Menubar_pimpl.h
+ * Copyright 1995 Matthias Ettrich
+ * Copyright 1995-2002 the LyX Team
+ * Copyright 1996-2001 Lars Gullik Bjønnes
+ * Read the file COPYING
  *
- *           This file is Copyright 1996-2000
- *           Lars Gullik Bjønnes
- *
- * ====================================================== */
+ * \author Lars Gullik Bjønnes, larsbj@lyx.org
+ */
 
 #ifndef MENUBAR_PIMPL_H
 #define MENUBAR_PIMPL_H
 
+#include <vector>
+#include <map>
+#include <boost/smart_ptr.hpp>
+#include FORMS_H_LOCATION
+
 #ifdef __GNUG__
 #pragma interface
 #endif
 
-#include <vector>
-#include <map>
 #include "LString.h"
 #include "frontends/Menubar.h"
 #include "commandtags.h"
-#include FORMS_H_LOCATION
-class LyXView;
-class MenuBackend;
-class MenuItem;
-class Menu;
+#include "MenuBackend.h"
 
-#include "debug.h"
+class LyXView;
 
 /** The LyX GUI independent menubar class
   The GUI interface is implemented in the corresponding Menubar_pimpl class. 
@@ -39,8 +36,6 @@ public:
        ///
        Pimpl(LyXView *, MenuBackend const &);
        ///
-       ~Pimpl();
-       ///
        void set(string const &);
        /// Opens a top-level submenu given its name
        void openByName(string const &);
@@ -48,18 +43,6 @@ public:
        ///
        static void MenuCallback(FL_OBJECT *, long);
 
-       /** Add to "menu" the list of last opened files
-           (add "extra_label" to the last entry)
-       */
-       void add_lastfiles(int menu, string const & extra_label);
-       /** Add to "menu" the list of opened documents
-           (add "extra_label" to the last entry)
-       */
-       void add_documents(int menu, string const & extra_label);
-       /// Add to "menu" the list of exportable/viewable formats
-       /// (add "extra_label" to the last entry)
-       void add_formats(int menu, string const & extra_label,
-                        kb_action action, bool viewable);
        ///
        void add_toc(int menu, string const & extra_label,
                     std::vector<int> & smn, Window win);
@@ -85,18 +68,19 @@ private:
        struct ItemInfo {
                ///
                ItemInfo(Menubar::Pimpl * p, MenuItem const * i, 
-                          FL_OBJECT * o) 
-                       : pimpl_(p), item_(i), obj_(o) {}
+                        FL_OBJECT * o)
+               
+                       : pimpl_(p), obj_(o) { item_.reset(i); }
                ///
                Menubar::Pimpl * pimpl_;
                ///
-               MenuItem const * item_;
+               boost::shared_ptr<MenuItem const> item_;
                ///
                FL_OBJECT * obj_;
        };
 
        ///
-       typedef std::vector<ItemInfo *> ButtonList;
+       typedef std::vector<boost::shared_ptr<ItemInfo> > ButtonList;
        ///
        ButtonList buttonlist_;