tahoma2d/toonz/sources/include/tcontenthistory.h

63 lines
1.7 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef _CONTENT_HISTORY_H
#define _CONTENT_HISTORY_H
#include "tcommon.h"
#include "tfilepath.h"
2016-03-27 13:30:32 +13:00
#include <QString>
#include <QDateTime>
2016-03-19 06:57:51 +13:00
#include <map>
#include <set>
#undef DVAPI
#undef DVVAR
#ifdef TNZCORE_EXPORTS
#define DVAPI DV_EXPORT_API
#define DVVAR DV_EXPORT_VAR
#else
#define DVAPI DV_IMPORT_API
#define DVVAR DV_IMPORT_VAR
#endif
2016-06-15 18:43:10 +12:00
//! this class keeps tracks of modification times on contents, as well as user
//! and machine info;
//! typically used for levels and scene files (or whatever you like...)
2016-03-19 06:57:51 +13:00
// it is used for visualitation purposed only in the infoview, in example
2016-06-15 18:43:10 +12:00
class DVAPI TContentHistory {
bool m_isLevel;
std::map<TFrameId, QDateTime> m_records;
QString m_frozenHistory;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
const QString currentToString() const;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
//! set isLevel=true if you want to keep track of single-frames modifications
TContentHistory(bool isLevel);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
~TContentHistory();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
TContentHistory *clone() const;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
//! history can come only from a deserialization
//! WARNING! any preexistent history will be erased by calling this method
void deserialize(const QString &history);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
//! the returned string is only for visualitation and serialization
const QString serialize() const;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
//! after calling this method, following history info added will not "merge"
//! with the history until now
void fixCurrentHistory();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
//! do not call this 2 methods if isLevel==false! (assertion fails)
void frameModifiedNow(const TFrameId &id) { frameRangeModifiedNow(id, id); }
void frameRangeModifiedNow(const TFrameId &fromId, const TFrameId &toId);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
//! do not call this method if isLevel==true! (assertion fails)
void modifiedNow();
2016-03-19 06:57:51 +13:00
};
#endif