All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Signals | Public Member Functions | Static Public Attributes | Protected Member Functions
GeopsyCore::MasterSignalGroup Class Reference

Brief description of class still missing. More...

#include <MasterSignalGroup.h>

Inheritance diagram for GeopsyCore::MasterSignalGroup:
GeopsyCore::AbstractSignalGroup QGpCoreTools::TreeContainer QGpCoreTools::TreeItem QGpCoreTools::XMLClass

List of all members.

Signals

void dataChanged (AbstractSignalGroup *g) const
void parentAboutToBeChanged (AbstractSignalGroup *g, AbstractSignalGroup *newParent) const
void parentChanged (AbstractSignalGroup *g, AbstractSignalGroup *oldParent) const

Public Member Functions

void clear ()
 MasterSignalGroup (SignalDB *database)
virtual bool readOnly () const
virtual bool xml_inherits (const QString &tagName) const
virtual const QString & xml_tagName () const

Static Public Attributes

static const QString xmlMasterSignalGroupTag = "MasterGroup"

Protected Member Functions

virtual void reportDataChanged (AbstractSignalGroup *g) const
virtual void reportParentAboutToBeChanged (AbstractSignalGroup *g, AbstractSignalGroup *newParent) const
virtual void reportParentChanged (AbstractSignalGroup *g, AbstractSignalGroup *oldParent) const
XMLMember xml_member (XML_MEMBER_ARGS)
void xml_writeProperties (XML_WRITEPROPERTIES_ARGS) const

Detailed Description

Brief description of class still missing.

It is the group at the top of the group tree. It is a read only group which children are not read-only by default. It inherits QObject to forward signals about is contents to other objects of the application.


Constructor & Destructor Documentation

Master signal group has no parent.

References GeopsyCore::AbstractSignalGroup::setComments(), GeopsyCore::AbstractSignalGroup::setName(), GeopsyCore::SignalGroupFolder::setReadOnly(), GeopsyCore::SignalGroupFolder::setReadOnlyChildren(), GeopsyCore::SignalGroupFolder::setStored(), QGpCoreTools::tr(), and TRACE.

    : QObject(), AbstractSignalGroup()
  {
    TRACE;
    SignalGroupFolder * defaultFolder;
    defaultFolder=new SignalGroupFolder(this);
    defaultFolder->setName(tr("Default groups"));
    defaultFolder->setComments(tr("Some default groups to acces signals"));
    defaultFolder->setReadOnly(true);
    defaultFolder->setReadOnlyChildren(true);
    defaultFolder->setStored(false);
    new AllSignalsGroup(database, defaultFolder);
    new TemporarySignalsGroup(database, defaultFolder);
    new AllFilesGroup(database, defaultFolder);
    new TemporaryFilesGroup(database, defaultFolder);
    new PermanentFilesGroup(database, defaultFolder);
    SignalGroupFolder * byFolder;
    byFolder=new SignalGroupFolder(defaultFolder);
    byFolder->setName(tr("By names"));
    byFolder->setComments(tr("Not yet available"));
    byFolder->setReadOnly(true);
    byFolder->setReadOnlyChildren(true);
    byFolder=new SignalGroupFolder(defaultFolder);
    byFolder->setName(tr("By components"));
    byFolder->setComments(tr("Not yet available"));
    byFolder->setReadOnly(true);
    byFolder->setReadOnlyChildren(true);
    byFolder=new SignalGroupFolder(defaultFolder);
    byFolder->setName(tr("By receivers"));
    byFolder->setComments(tr("Not yet available"));
    byFolder->setReadOnly(true);
    byFolder->setReadOnlyChildren(true);
    byFolder=new SignalGroupFolder(defaultFolder);
    byFolder->setName(tr("By sources"));
    byFolder->setComments(tr("Not yet available"));
    byFolder->setReadOnly(true);
    byFolder->setReadOnlyChildren(true);
  }

Member Function Documentation

Referenced by reportDataChanged().

Referenced by clear(), and reportParentChanged().

virtual bool GeopsyCore::MasterSignalGroup::readOnly ( ) const [inline, virtual]

Reimplemented from GeopsyCore::AbstractSignalGroup.

{return true;}

Sends a Qt signal when a (great-)children is reported as modified.

Reimplemented from GeopsyCore::AbstractSignalGroup.

References dataChanged().

  {
    emit dataChanged(g);
  }

Sends a Qt signal when a (great-)children is reported as modified.

Reimplemented from GeopsyCore::AbstractSignalGroup.

References parentAboutToBeChanged().

  {
    emit parentAboutToBeChanged(g, newParent);
  }
void GeopsyCore::MasterSignalGroup::reportParentChanged ( AbstractSignalGroup g,
AbstractSignalGroup oldParent 
) const [protected, virtual]

Sends a Qt signal when a (great-)children is reported as modified.

Reimplemented from GeopsyCore::AbstractSignalGroup.

References parentChanged().

  {
    emit parentChanged(g, oldParent);
  }
bool GeopsyCore::MasterSignalGroup::xml_inherits ( const QString &  tagName) const [virtual]

May be useful for classes that do not inherit QObject. Must be re-implemented in sub-classes

Reimplemented from QGpCoreTools::XMLClass.

References xmlMasterSignalGroupTag.

  {
    if(tagName==xmlMasterSignalGroupTag) {
      return true;
    } else {
      return AbstractSignalGroup::xml_inherits(tagName);
    }
  }

Re-implement this function to offer XML restore (children and properties) support to your class.

From tag and map (with contains the attibute value) return a unique identifier under the format of a XMLMember. XMLMember is initialized with 3 types of contructors:

  • An integer: id number of a property
  • A XMLClass * : a child of this object identified by tag
  • Default constructor: error, unknow child or property

Map of attributes can be inspected in this way (can be achived also in xml_setProperty()):

    static const QString tmp("childrenName");
    XMLRestoreAttributeIterator it=map.find(tmp);
    if(it!=map.end()) {
      // found attribute "childrenName"
    }

If the map of attributes is not used:

    Q_UNUSED(attributes);
    if(tag=="x1") return XMLMember(0);
    else if(tag=="y1") return XMLMember(1);
    else if(tag=="x2") return XMLMember(2);
    else if(tag=="y2") return XMLMember(3);
    else return XMLMember(XMLMember::Unknown);

Arithmetic operations + and - apply to XMLMember to avoid confusion of property id numbers between inherited objects. Offset 3 corresponds to the number of properties defined in this object.

    if(tag=="anInteger") return XMLMember(0);
    else if(tag=="aString") return XMLMember(1);
    else if(tag=="aDouble") return XMLMember(2);
    return AbstractLine::xml_member(tag, attributes, context)+3;

For the arguments of this function use Macro XML_MEMBER_ARGS.

Reimplemented from GeopsyCore::AbstractSignalGroup.

References TRACE.

  {
    TRACE;
    if(tag.size()>0) {
      switch (tag[0].unicode()) {
      case 'c':
        if(tag=="comments") return XMLMember(XMLMember::Skip);  // Kept for compatibility
        break;
      case 'n':
        if(tag=="name") return XMLMember(XMLMember::Skip);      // Kept for compatibility
        break;
      case 'f':
        if(tag=="folder") return XMLMember(XMLMember::Skip);    // Kept for compatibility
        break;
      default:
        break;
      }
    }
    return AbstractSignalGroup::xml_member(tag, attributes, context);
  }
virtual const QString& GeopsyCore::MasterSignalGroup::xml_tagName ( ) const [inline, virtual]

Reimplemented from QGpCoreTools::TreeItem.

Avoids 'name' and 'comments', always set to null or simply ignored.

Reimplemented from GeopsyCore::AbstractSignalGroup.

References TRACE.

  {
    TRACE;
    Q_UNUSED(s);
    Q_UNUSED(context);
  }

Member Data Documentation

const QString GeopsyCore::MasterSignalGroup::xmlMasterSignalGroupTag = "MasterGroup" [static]

Referenced by xml_inherits().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines