mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 13:00:08 +00:00
working...
This commit is contained in:
parent
767958ecef
commit
d7032d5607
50
src/HTMLRenderer/StateTracker.h
Normal file
50
src/HTMLRenderer/StateTracker.h
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* StateTracker.h
|
||||
*
|
||||
* track specific PDF state
|
||||
* manage reusable CSS classes
|
||||
*
|
||||
* Copyright (C) 2013 Lu Wang <coolwanglu@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef STATE_TRACKER_H__
|
||||
#define STATE_TRACKER_H__
|
||||
|
||||
#include <GfxState.h>
|
||||
|
||||
|
||||
namespace pdf2htmlEX {
|
||||
|
||||
class StateTrackerBase
|
||||
{
|
||||
public:
|
||||
virtual ~StateTracker(void);
|
||||
|
||||
// usually called at the beginning of a page
|
||||
virtual void reset(void) = 0;
|
||||
/*
|
||||
* update() is called when PDF updates the state
|
||||
* check_state() is called when we really need the new state
|
||||
*
|
||||
* There could be a number of calls to update() between 2 consecutive calls to check_state()
|
||||
* So usually we just mark as changed in update, and actually retrive from the state in check_state()
|
||||
*/
|
||||
virtual void update(GfxState * state) = 0;
|
||||
/*
|
||||
* return if state has been updated
|
||||
*
|
||||
* if force is true, do check the state if there is no update() called before
|
||||
* useful for updateAll
|
||||
*/
|
||||
virtual bool check_state(GfxState * state, bool force) = 0;
|
||||
|
||||
long long get_id() const { return id; }
|
||||
|
||||
protected:
|
||||
long long id; // For CSS classe
|
||||
};
|
||||
|
||||
|
||||
} // namespace pdf2htmlEX
|
||||
|
||||
#endif //STATE_TRACKER_H__
|
Loading…
Reference in New Issue
Block a user