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 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)
 
AssetWrapperself ()
 
void setDisplayParent (AssetWrapper *parent)
 
virtual ~AssetWrapper () override
 

Properties

QString location
 
QString path
 
- Properties inherited from AssetWrapper
QString displayName
 
AssetWrapper self
 

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 Member Functions inherited from AssetWrapper
static bool compareByDisplayName (const AssetWrapper *left, const AssetWrapper *right)
 
- 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 68 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 127 of file MessageFile.cpp.

References myIsModified, myPath, and path.

Referenced by duplicate().

+ Here is the caller graph for this function:

◆ ~MessageFile()

MessageFile::~MessageFile ( )
virtual

Definition at line 132 of file MessageFile.cpp.

References myRules.

Member Function Documentation

◆ copy()

void MessageFile::copy ( const MessageFile other)

Definition at line 147 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:

◆ displayName()

virtual QString MessageFile::displayName ( ) const
inlineoverridevirtual

Implements AssetWrapper.

Definition at line 83 of file MessageFile.h.

References myPath.

◆ duplicate()

MessageFile * MessageFile::duplicate ( ) const

Definition at line 137 of file MessageFile.cpp.

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

Referenced by CREMessagePanel::updateItem().

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

◆ isModified()

bool MessageFile::isModified ( ) const

Definition at line 389 of file MessageFile.cpp.

References myIsModified.

◆ location()

const QString& MessageFile::location ( ) const

◆ maps()

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

Definition at line 271 of file MessageFile.cpp.

References myMaps.

Referenced by CREMessagePanel::updateItem().

+ 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 203 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

◆ rules()

◆ save()

void MessageFile::save ( )

◆ setLocation()

void MessageFile::setLocation ( const QString &  location)

Definition at line 177 of file MessageFile.cpp.

References location, myLocation, and setModified().

+ Here is the call graph for this function:

◆ setModified()

void MessageFile::setModified ( bool  modified = true)

◆ setPath()

void MessageFile::setPath ( const QString &  path)

Definition at line 168 of file MessageFile.cpp.

References myPath, path, and setModified().

+ Here is the call graph for this function:

◆ uses()

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

Reimplemented from AssetWrapper.

Definition at line 399 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 110 of file MessageFile.h.

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

◆ myLocation

QString MessageFile::myLocation
private

Definition at line 112 of file MessageFile.h.

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

◆ myMaps

QList<CREMapInformation*> MessageFile::myMaps
private

Definition at line 114 of file MessageFile.h.

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

◆ myPath

QString MessageFile::myPath
private

Definition at line 111 of file MessageFile.h.

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

◆ myRules

QList<MessageRule*> MessageFile::myRules
private

Definition at line 113 of file MessageFile.h.

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

Property Documentation

◆ location

const QString & MessageFile::location
readwrite

Definition at line 72 of file MessageFile.h.

Referenced by setLocation().

◆ path

const QString & MessageFile::path
readwrite

Definition at line 71 of file MessageFile.h.

Referenced by MessageFile(), setPath(), and CREMessagePanel::updateItem().


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