Version: 8.3.0
YACS::HMI::ItemMimeData Class Reference

#include <ItemMimeData.hxx>

Inheritance diagram for YACS::HMI::ItemMimeData:
Collaboration diagram for YACS::HMI::ItemMimeData:

Public Member Functions

 ItemMimeData ()
 
virtual ~ItemMimeData ()
 
virtual void setSubject (Subject *sub)
 
virtual void setCatalog (YACS::ENGINE::Catalog *cata)
 
virtual void setCataName (std::string cataName)
 
virtual void setCompo (std::string compo)
 
virtual void setType (std::string aType)
 
virtual void setCase (int aCase)
 
virtual SubjectgetSubject (int i=0) const
 
virtual YACS::ENGINE::CataloggetCatalog (int i=0) const
 
virtual std::string getCataName (int i=0) const
 
virtual std::string getCompo (int i=0) const
 
virtual std::string getType (int i=0) const
 
virtual int getCase () const
 
virtual bool getControl () const
 
virtual void setControl (bool control)
 
virtual int getDataSize () const
 

Protected Attributes

std::vector< Subject * > _sub
 
std::vector
< YACS::ENGINE::Catalog * > 
_catalog
 
std::vector< std::string > _cataName
 
std::vector< std::string > _compoName
 
std::vector< std::string > _typeName
 
int _swCase
 
bool _control
 

Detailed Description

ItemMimeData is used for Drag and Drop of Scene Items.

Definition at line 41 of file ItemMimeData.hxx.

Constructor & Destructor Documentation

ItemMimeData::ItemMimeData ( )

Definition at line 33 of file ItemMimeData.cxx.

References _catalog, _cataName, _compoName, _control, _sub, _swCase, and _typeName.

33  : QMimeData()
34 {
35  _sub.clear();
36  _catalog.clear();
37  _cataName.clear();
38  _compoName.clear();
39  _typeName.clear();
40  _swCase=0;
41  _control=false;
42 }
ItemMimeData::~ItemMimeData ( )
virtual

Definition at line 44 of file ItemMimeData.cxx.

45 {
46 }

Member Function Documentation

int ItemMimeData::getCase ( ) const
virtual

Definition at line 108 of file ItemMimeData.cxx.

References _swCase.

109 {
110  return _swCase;
111 }
YACS::ENGINE::Catalog * ItemMimeData::getCatalog ( int  i = 0) const
virtual

Definition at line 84 of file ItemMimeData.cxx.

References _catalog, CORBAEngineTest::i, and YASSERT.

Referenced by YACS::HMI::GuiEditor::AddTypeFromCatalog(), and YACS::HMI::GuiEditor::CreateNodeFromCatalog().

85 {
86  YASSERT(i < _catalog.size());
87  return _catalog[i];
88 }
std::string ItemMimeData::getCataName ( int  i = 0) const
virtual

Definition at line 90 of file ItemMimeData.cxx.

References _cataName, CORBAEngineTest::i, and YASSERT.

91 {
92  YASSERT(i < _cataName.size());
93  return _cataName[i];
94 }
std::string ItemMimeData::getCompo ( int  i = 0) const
virtual

Definition at line 96 of file ItemMimeData.cxx.

References _compoName, CORBAEngineTest::i, and YASSERT.

Referenced by YACS::HMI::GuiEditor::CreateNodeFromCatalog().

97 {
98  YASSERT(i < _compoName.size());
99  return _compoName[i];
100 }
int ItemMimeData::getDataSize ( ) const
virtual

Definition at line 121 of file ItemMimeData.cxx.

References _cataName, _sub, and CORBAEngineTest::i.

Referenced by YACS::HMI::GuiEditor::AddTypeFromCatalog(), and YACS::HMI::GuiEditor::CreateNodeFromCatalog().

122 {
123  int lg=0;
124  QStringList myFormats = formats();
125  for (int i=0; i<myFormats.size(); i++)
126  {
127  if (myFormats[i].contains("yacs/cata"))
128  {
129  lg = _cataName.size();
130  break;
131  }
132  else
133  {
134  lg = _sub.size();
135  break;
136  }
137  }
138  return lg;
139 }
std::string ItemMimeData::getType ( int  i = 0) const
virtual

Definition at line 102 of file ItemMimeData.cxx.

References _typeName, CORBAEngineTest::i, and YASSERT.

Referenced by YACS::HMI::GuiEditor::AddTypeFromCatalog(), and YACS::HMI::GuiEditor::CreateNodeFromCatalog().

103 {
104  YASSERT(i < _typeName.size());
105  return _typeName[i];
106 }
void ItemMimeData::setCase ( int  aCase)
virtual

Definition at line 73 of file ItemMimeData.cxx.

References _swCase.

74 {
75  _swCase = aCase;
76 }
void ItemMimeData::setCatalog ( YACS::ENGINE::Catalog cata)
virtual

Definition at line 53 of file ItemMimeData.cxx.

References _catalog.

Referenced by YACS::HMI::CatalogWidget::startDrag().

54 {
55  _catalog.push_back(cata);
56 }
void ItemMimeData::setCataName ( std::string  cataName)
virtual

Definition at line 58 of file ItemMimeData.cxx.

References _cataName.

Referenced by YACS::HMI::CatalogWidget::startDrag().

59 {
60  _cataName.push_back(cataName);
61 }
void ItemMimeData::setCompo ( std::string  compo)
virtual

Definition at line 63 of file ItemMimeData.cxx.

References _compoName.

Referenced by YACS::HMI::CatalogWidget::startDrag().

64 {
65  _compoName.push_back(compo);
66 }
void ItemMimeData::setControl ( bool  control)
virtual
void ItemMimeData::setType ( std::string  aType)
virtual

Definition at line 68 of file ItemMimeData.cxx.

References _typeName.

Referenced by YACS::HMI::CatalogWidget::startDrag().

69 {
70  _typeName.push_back(aType);
71 }

Member Data Documentation

std::vector<YACS::ENGINE::Catalog*> YACS::HMI::ItemMimeData::_catalog
protected

Definition at line 63 of file ItemMimeData.hxx.

Referenced by getCatalog(), ItemMimeData(), and setCatalog().

std::vector<std::string> YACS::HMI::ItemMimeData::_cataName
protected

Definition at line 64 of file ItemMimeData.hxx.

Referenced by getCataName(), getDataSize(), ItemMimeData(), and setCataName().

std::vector<std::string> YACS::HMI::ItemMimeData::_compoName
protected

Definition at line 65 of file ItemMimeData.hxx.

Referenced by getCompo(), ItemMimeData(), and setCompo().

bool YACS::HMI::ItemMimeData::_control
protected

Definition at line 68 of file ItemMimeData.hxx.

Referenced by getControl(), ItemMimeData(), and setControl().

std::vector<Subject*> YACS::HMI::ItemMimeData::_sub
protected

Definition at line 62 of file ItemMimeData.hxx.

Referenced by getDataSize(), getSubject(), ItemMimeData(), and setSubject().

int YACS::HMI::ItemMimeData::_swCase
protected

Definition at line 67 of file ItemMimeData.hxx.

Referenced by getCase(), ItemMimeData(), and setCase().

std::vector<std::string> YACS::HMI::ItemMimeData::_typeName
protected

Definition at line 66 of file ItemMimeData.hxx.

Referenced by getType(), ItemMimeData(), and setType().


The documentation for this class was generated from the following files: