GPC  v1.0.0-2516
Gorman Print Control
SessionRecord Class Referencefinal
Collaboration diagram for SessionRecord:

Public Types

enum  EField {
  kUnknown = 0,
  kUUID,
  kCreationTimestamp,
  kCreationText,
  kRecentlyUsedTimestamp,
  kRecentlyUsedText,
  kPrinterName,
  kIjsFilename,
  kNumberOfUses,
  kNumberOfImages,
  kUsername,
  kDescription,
  kDirectory,
  kMax
}
 Various fields we need to track, most of which are also shown in the summary window. More...
 

Public Member Functions

 ~SessionRecord (void)
 Destructor. More...
 
 SessionRecord (void)
 Simple empty constructor sets everything to default values. More...
 
 SessionRecord (Json &json)
 Create a session from a JSON object. More...
 
std::string uuid (void) const
 Something that happens often, so provide an easy way to get to the uuid. More...
 
File get_dir (void) const
 Get the directory in which this session is stored. More...
 
File get_ijs_file (void) const
 Get the .ijs file for this print job session. More...
 
SessionRecordinitialize (void)
 Initialize a number of fields and values which are derived from other sources. More...
 

Static Public Member Functions

static void schedule_sessions_to_be_saved (void)
 Sets the flag indicating that configuration should be saved, and starts (or restarts) the timer in GPCApp to ensure the session records are eventually saved to disk. More...
 

Public Attributes

std::time_t creationEpoch
 Epoch when the print job session was created. More...
 
std::time_t recentlyUsedEpoch
 Epoch when the print job session was last loaded onto the IncJet device. More...
 
std::string field [EField::kMax]
 Array of text strings that define this print job. More...
 
size_t printer_number
 Determines if this print job applies to printer #1 or printer #2. More...
 
MStr image_descriptions
 Each image can have a text string description. More...
 

Static Public Attributes

static bool configuration_needs_to_be_saved = false
 Flag set to indicate changes have been made to configuration. More...
 

Member Enumeration Documentation

◆ EField

Various fields we need to track, most of which are also shown in the summary window.

Constructor & Destructor Documentation

◆ ~SessionRecord()

SessionRecord::~SessionRecord ( void  )

Destructor.

◆ SessionRecord() [1/2]

◆ SessionRecord() [2/2]

Member Function Documentation

◆ uuid()

std::string SessionRecord::uuid ( void  ) const
inline

Something that happens often, so provide an easy way to get to the uuid.

References field.

Referenced by initialize(), and schedule_sessions_to_be_saved().

Here is the caller graph for this function:

◆ get_dir()

File SessionRecord::get_dir ( void  ) const
inline

Get the directory in which this session is stored.

References field.

Referenced by SummaryComponent::buttonClicked(), and get_ijs_file().

Here is the caller graph for this function:

◆ get_ijs_file()

File SessionRecord::get_ijs_file ( void  ) const
inline

Get the .ijs file for this print job session.

References field, get_dir(), and initialize().

Referenced by SessionComponentLoader::run().

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

◆ initialize()

SessionRecord & SessionRecord::initialize ( void  )

Initialize a number of fields and values which are derived from other sources.

For example, the fields kCreationTimestamp and kCreationText are both derived from crationEpoch. This may be called multiple times without ill effects.

References creationEpoch, GPCApplication::directory, field, Cfg::get_str(), printer_number, recentlyUsedEpoch, and uuid().

Referenced by SummaryComponent::buttonClicked(), get_ijs_file(), SessionComponentTransfer::run(), and SessionRecord().

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

◆ schedule_sessions_to_be_saved()

void SessionRecord::schedule_sessions_to_be_saved ( void  )
static

Member Data Documentation

◆ creationEpoch

std::time_t SessionRecord::creationEpoch

Epoch when the print job session was created.

Referenced by initialize(), schedule_sessions_to_be_saved(), SessionRecord(), and SummaryComponent::sortOrderChanged().

◆ recentlyUsedEpoch

std::time_t SessionRecord::recentlyUsedEpoch

Epoch when the print job session was last loaded onto the IncJet device.

Referenced by initialize(), SessionComponentTransfer::run(), schedule_sessions_to_be_saved(), SessionRecord(), and SummaryComponent::sortOrderChanged().

◆ field

std::string SessionRecord::field[EField::kMax]

◆ printer_number

size_t SessionRecord::printer_number

Determines if this print job applies to printer #1 or printer #2.

Referenced by SummaryComponent::buttonClicked(), initialize(), SessionComponentTransfer::run(), schedule_sessions_to_be_saved(), and SessionRecord().

◆ image_descriptions

MStr SessionRecord::image_descriptions

Each image can have a text string description.

The key is the short image name, and the value is the description to show the user.

Referenced by schedule_sessions_to_be_saved(), and SessionRecord().

◆ configuration_needs_to_be_saved

bool SessionRecord::configuration_needs_to_be_saved = false
static

Flag set to indicate changes have been made to configuration.

Don't set this directly; instead, call the function scehdule_sessions_to_be_saved() which will start a timer.

Referenced by schedule_sessions_to_be_saved(), and GPCApplication::timerCallback().