6#include <QtCore/QString>
8#include <QtCore/QVariant>
40 explicit ChangeSet(
int id1,
const QString& description =
"");
41 ChangeSet(
int id1,
int id2,
const QString& description =
"");
42 ChangeSet(
int id1,
int id2,
int id3,
const QString& description =
"");
43 ChangeSet(
int id1,
int id2,
int id3,
int id4,
const QString& description =
"");
44 ChangeSet(
int id1,
int id2,
int id3,
int id4,
int id5,
const QString& description =
"");
45 ChangeSet(
int id1,
int id2,
int id3,
int id4,
int id5,
int id6,
const QString& description =
"");
46 ChangeSet(
int id1,
int id2,
int id3,
int id4,
int id5,
int id6,
int id7,
const QString& description =
"");
47 ChangeSet(
int id1,
int id2,
int id3,
int id4,
int id5,
int id6,
int id7,
int id8,
const QString& description =
"");
48 ChangeSet(
int id1,
int id2,
int id3,
int id4,
int id5,
int id6,
int id7,
int id8,
int id9,
const QString& description =
"");
49 ChangeSet(
int id1,
int id2,
int id3,
int id4,
int id5,
int id6,
int id7,
int id8,
int id9,
int id10,
const QString& description =
"");
137 QString m_description;
289 virtual void EndChanges(
const ChangeSet& changeSet);
342 static const ChangeSet s_emptyChanges;
343 static const ChangeSet s_anyChanges;
344 static const ChangeSet s_allChanges;
345 static const ChangeSet s_delegatedChanges;
409 return s_emptyChanges;
427 return s_delegatedChanges;
Set of change flags (its IDs).
ChangeSet(int id1, int id2, int id3, int id4, const QString &description="")
QSet< int > GetIds() const
Get set of all stored IDs.
ChangeSet operator+(const ChangeSet &changeSet) const
Get the union of two change sets.
ChangeSet(int id1, int id2, int id3, int id4, int id5, int id6, int id7, int id8, const QString &description="")
void SetChangeInfoMap(const ChangeInfoMap &infoMap)
Set map of all stored info.
bool IsEmpty() const
Check if there is any change in the set.
ChangeSet(const QString &description)
ChangeSet & operator+=(int changeId)
Add some change flag.
ChangeSet(int id1, int id2, const QString &description="")
void MaskOut(const ChangeSet &changeSet)
Remove the IDs from the second set.
ChangeSet(int id1, const QString &description="")
QVariant GetChangeInfo(const QByteArray &key) const
Get change info by a key.
ChangeSet(int id1, int id2, int id3, int id4, int id5, int id6, const QString &description="")
bool ContainsExplicit(int changeId, bool singleOnly=false) const
Check if there is specific change flag in the set explicit set by user.
ChangeSet(int id1, int id2, int id3, int id4, int id5, int id6, int id7, int id8, int id9, const QString &description="")
void Reset()
Remove all IDs.
ChangeSet & operator+=(const ChangeSet &changeSet)
Add some change set.
bool Contains(int changeId) const
Check if there is specific change flag in the set.
ChangeSet(int id1, int id2, int id3, int id4, int id5, int id6, int id7, int id8, int id9, int id10, const QString &description="")
const ChangeInfoMap & GetChangeInfoMap() const
Get information about the changes.
bool ContainsAny(const ChangeSet &changeSet) const
Check if any of IDs is changed.
ChangeSet(int id1, int id2, int id3, int id4, int id5, const QString &description="")
ChangeSet(int id1, int id2, int id3, int id4, int id5, int id6, int id7, const QString &description="")
void SetChangeInfo(const QByteArray &key, const QVariant &value)
Set change info for a defined key.
ChangeSet(int id1, int id2, int id3, const QString &description="")
ChangeSet & operator+=(const QSet< int > &ids)
Add some change flags.
const QString & GetDescription() const
Get textual description of this change set.
Common interface for data model objects, which can be changed.
static const ChangeSet & GetAllChanges()
Get anonymous change set.
virtual void BeginChanges(const ChangeSet &changeSet)
Starts the change transaction.
virtual bool ResetData(CompatibilityMode mode=CM_WITHOUT_REFS)
Reset data to its default state.
virtual bool IsEqual(const IChangeable &object) const
Compare this object with another object.
static const ChangeSet & GetNoChanges()
Get empty set of changes.
virtual void EndChangeGroup(const ChangeSet &changeSet)
Ends group of changes.
virtual void BeginChangeGroup(const ChangeSet &changeSet)
Starts group of changes.
virtual void EndChanges(const ChangeSet &changeSet)
Ends the change transaction.
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.
@ CM_WITH_REFS
External references are part of object integrity.
@ CM_STRICT
If external references are different this object are not compatible and cannot be compared or copied.
@ CM_CONVERT
Data of object are interpreted in context of external references.
QMultiMap< QByteArray, QVariant > ChangeInfoMap
static const ChangeSet & GetDelegatedChanges()
Get delegated change set.
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
Copy this object from another one.
virtual int GetSupportedOperations() const
Get set of flags for supported operations.
virtual void OnBeginChanges()
Callback function for begin change event.
ChangeFlags
Data model change notification flags.
@ CF_ALL_DATA
All object data are changed.
@ CF_ACF_INTERNAL
Internal ACF flag.
@ CF_NO_UNDO
Used to avoid adding of changes to undo list.
@ CF_ANY
Indicate anonymous change.
@ CF_DESTROYING
Change flag indicate that model is during destruction.
@ CF_DELEGATED
Change flag indicate that this change was delegated (is indirect) for example from aggregated object.
virtual istd::TUniqueInterfacePtr< istd::IChangeable > CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const
Make a copy of this object.
SupportedOperations
Flags for supported operations.
@ SO_COPY
Copying from other object.
@ SO_RESET
Resetting of object state.
@ SO_NONE
No operations are supported.
@ SO_CLONE
Creating of copy of this object.
@ SO_COMPARE
Comparison with another object.
@ SO_OBSERVE
Observing of this object via observer-observable pattern.
virtual void OnEndChanges(const ChangeSet &changeSet)
Callback function for end change event.
static const ChangeSet & GetAnyChange()
Get anonymous change set.
Base interface for all used interfaces and implementations.
Shared ownership smart pointer for interface types.
Unique ownership smart pointer for interface types.
istd::TSharedInterfacePtr< istd::IChangeable > IChangeableSharedPtr
bool AreObjectsEqual(const IChangeable *a, const IChangeable *b)
istd::TUniqueInterfacePtr< istd::IChangeable > IChangeableUniquePtr