Choreonoid  1.8
ItemFileDialog.h
Go to the documentation of this file.
1 #ifndef CNOID_BASE_ITEM_FILE_DIALOG_H
2 #define CNOID_BASE_ITEM_FILE_DIALOG_H
3 
4 #include "ItemFileIO.h"
5 #include "ItemList.h"
6 #include "FileDialog.h"
7 #include "exportdecl.h"
8 
9 namespace cnoid {
10 
11 class CNOID_EXPORT ItemFileDialog : public FileDialog
12 {
13 public:
15  ItemFileDialog(QWidget* parent);
16  ~ItemFileDialog();
17 
18  template <class ItemType>
20  setRegisteredFileIOsFor_(typeid(ItemType));
21  }
22  void setFileIOs(const std::vector<ItemFileIO*>& fileIOs);
23  void setFileIO(ItemFileIO* fileIO);
24  void clearFileIOs();
25 
26  ItemList<Item> loadItems(
27  Item* parentItem = nullptr,
28  bool doAddition = true,
29  Item* nextItem = nullptr);
30 
31  void setExportMode(bool on = true);
32  bool saveItem(Item* item);
33 
34  static QString makeNameFilter(
35  const std::string& caption, const std::vector<std::string>& extensions, bool isAnyEnabled = false);
36 
37 private:
38  void setRegisteredFileIOsFor_(const std::type_info& type);
39 
40  class Impl;
41  Impl* impl;
42 };
43 
44 }
45 
46 #endif
cnoid::ItemFileIO
Definition: ItemFileIO.h:19
cnoid::FileDialog
Definition: FileDialog.h:10
cnoid::ItemFileDialog
Definition: ItemFileDialog.h:11
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::Item
Definition: Item.h:29
cnoid::ItemList
Definition: Item.h:20
FileDialog.h
ItemFileIO.h
ItemList.h
cnoid::ItemFileDialog::setRegisteredFileIOsFor
void setRegisteredFileIOsFor()
Definition: ItemFileDialog.h:19