Crossfire Server, Trunk
MessageFile Class Reference

#include <MessageFile.h>

+ Inheritance diagram for MessageFile:
+ Collaboration diagram for MessageFile:

Public Member Functions

void copy (const MessageFile *other)
 
virtual void displayFillPanel (QWidget *panel) override
 
virtual QString displayName () const override
 
MessageFileduplicate () const
 
bool isModified () const
 
const QString & location () const
 
QList< CREMapInformation * > & maps ()
 
 MessageFile (AssetWrapper *parent, const QString &path)
 
bool parseFile ()
 
const QString & path () const
 
QList< MessageRule * > & rules ()
 
void save ()
 
void setLocation (const QString &location)
 
void setModified (bool modified=true)
 
void setPath (const QString &path)
 
virtual PossibleUse uses (const AssetWrapper *asset, std::string &) const override
 
virtual ~MessageFile ()
 
- Public Member Functions inherited from AssetWrapper
 AssetWrapper (AssetWrapper *parent, const QString &panelName="empty")
 
virtual bool canDrag () const
 
virtual bool canDrop (const QMimeData *, int) const
 
virtual AssetWrapperchild (int)
 
virtual int childIndex (AssetWrapper *)
 
virtual int childrenCount () const
 
virtual QIcon displayIcon () const
 
virtual QString displayPanelName () const
 
AssetWrapperdisplayParent () const
 
virtual void drag (QMimeData *) const
 
virtual void drop (const QMimeData *, int)
 
virtual void fillMenu (QMenu *)
 
void markModified (ChangeType change, int extra=0)
 
void setDisplayParent (AssetWrapper *parent)
 
virtual ~AssetWrapper () override
 

Private Attributes

bool myIsModified
 
QString myLocation
 
QList< CREMapInformation * > myMaps
 
QString myPath
 
QList< MessageRule * > myRules
 

Additional Inherited Members

- Public Types inherited from AssetWrapper
enum  ChangeType {
  AssetUpdated, BeforeChildAdd, AfterChildAdd, BeforeChildRemove,
  AfterChildRemove, BeforeLayoutChange, AfterLayoutChange
}
 
enum  PossibleUse { Uses, ChildrenMayUse, DoesntUse }
 
- Public Slots inherited from AssetWrapper
virtual void removeChild (AssetWrapper *)
 
- Signals inherited from AssetWrapper
void dataModified (AssetWrapper *asset, AssetWrapper::ChangeType type, int extra)
 
void modified ()
 
- Static Public Attributes inherited from AssetWrapper
static const char * tipProperty = "_cre_internal"
 
- Protected Member Functions inherited from AssetWrapper
virtual void wasModified (AssetWrapper *asset, ChangeType type, int extra)
 
- Protected Attributes inherited from AssetWrapper
QString myPanelName
 
AssetWrappermyParent
 

Detailed Description

One NPC dialog file, mostly a collection of MessageRule. Once a MessageFile is created, parseFile() must be called.

Definition at line 56 of file MessageFile.h.

Constructor & Destructor Documentation

◆ MessageFile()

MessageFile::MessageFile ( AssetWrapper parent,
const QString &  path 
)

Standard constructor.

Parameters
parentparent of this item.
pathNPC dialog path.

Definition at line 117 of file MessageFile.cpp.

References myIsModified, myPath, and path().

Referenced by duplicate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~MessageFile()

MessageFile::~MessageFile ( )
virtual

Definition at line 122 of file MessageFile.cpp.

References myRules.

Member Function Documentation

◆ copy()

void MessageFile::copy ( const MessageFile other)

Definition at line 137 of file MessageFile.cpp.

References myLocation, myMaps, myPath, myRules, and npc_dialog::rule.

Referenced by duplicate(), and CREMessagePanel::onReset().

+ Here is the caller graph for this function:

◆ displayFillPanel()

virtual void MessageFile::displayFillPanel ( QWidget *  panel)
inlineoverridevirtual

Reimplemented from AssetWrapper.

Definition at line 69 of file MessageFile.h.

References CRETPanel< T >::setItem().

+ Here is the call graph for this function:

◆ displayName()

virtual QString MessageFile::displayName ( ) const
inlineoverridevirtual

Implements AssetWrapper.

Definition at line 68 of file MessageFile.h.

References myPath.

◆ duplicate()

MessageFile * MessageFile::duplicate ( ) const

Definition at line 127 of file MessageFile.cpp.

References copy(), MessageFile(), myLocation, myMaps, myPath, myRules, and npc_dialog::rule.

Referenced by CREMessagePanel::setItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isModified()

bool MessageFile::isModified ( ) const

Definition at line 379 of file MessageFile.cpp.

References myIsModified.

◆ location()

const QString & MessageFile::location ( ) const

Definition at line 148 of file MessageFile.cpp.

References myLocation.

Referenced by setLocation().

+ Here is the caller graph for this function:

◆ maps()

QList< CREMapInformation * > & MessageFile::maps ( )

Definition at line 261 of file MessageFile.cpp.

References myMaps.

Referenced by CREMessagePanel::setItem().

+ Here is the caller graph for this function:

◆ parseFile()

bool MessageFile::parseFile ( )

Parse the message file.

Returns
false if an error happened, true else.

Definition at line 193 of file MessageFile.cpp.

References convert(), navar-midane_time::data, Settings::datadir, mad_mage_user::file, lists, Settings::mapdir, myLocation, myPath, myRules, ring_occidental_mages::r, npc_dialog::rule, rules(), settings, and autojail::value.

+ Here is the call graph for this function:

◆ path()

const QString & MessageFile::path ( ) const

Definition at line 153 of file MessageFile.cpp.

References myPath.

Referenced by MessageFile(), and setPath().

+ Here is the caller graph for this function:

◆ rules()

◆ save()

void MessageFile::save ( )

◆ setLocation()

void MessageFile::setLocation ( const QString &  location)

Definition at line 167 of file MessageFile.cpp.

References location(), myLocation, and setModified().

Referenced by CREMessagePanel::commitData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setModified()

void MessageFile::setModified ( bool  modified = true)

◆ setPath()

void MessageFile::setPath ( const QString &  path)

Definition at line 158 of file MessageFile.cpp.

References myPath, path(), and setModified().

Referenced by CREMessagePanel::commitData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uses()

AssetWrapper::PossibleUse MessageFile::uses ( const AssetWrapper asset,
std::string &   
) const
overridevirtual

Reimplemented from AssetWrapper.

Definition at line 389 of file MessageFile.cpp.

References AssetWrapper::DoesntUse, guildoracle::list, myRules, npc_dialog::rule, and AssetWrapper::Uses.

Field Documentation

◆ myIsModified

bool MessageFile::myIsModified
private

Definition at line 99 of file MessageFile.h.

Referenced by isModified(), MessageFile(), save(), and setModified().

◆ myLocation

QString MessageFile::myLocation
private

Definition at line 101 of file MessageFile.h.

Referenced by copy(), duplicate(), location(), parseFile(), save(), and setLocation().

◆ myMaps

QList<CREMapInformation*> MessageFile::myMaps
private

Definition at line 103 of file MessageFile.h.

Referenced by copy(), duplicate(), and maps().

◆ myPath

QString MessageFile::myPath
private

Definition at line 100 of file MessageFile.h.

Referenced by copy(), displayName(), duplicate(), MessageFile(), parseFile(), path(), save(), and setPath().

◆ myRules

QList<MessageRule*> MessageFile::myRules
private

Definition at line 102 of file MessageFile.h.

Referenced by copy(), duplicate(), parseFile(), rules(), save(), uses(), and ~MessageFile().


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