Kitlist  1.1.0
Public Member Functions | Protected Attributes | List of all members
GuiState Class Reference

Class encapsulating state of an object in the data model. More...

#include <kitmodel.hpp>

Inheritance diagram for GuiState:
ModelCategory ModelItem

Public Member Functions

 GuiState ()
 
bool is_dirty ()
 
void set_dirty (bool dirty=true)
 
bool is_deleted ()
 
void set_deleted (bool deleted)
 
void set_new_flag (bool flag)
 
bool is_new ()
 
virtual void reset ()
 resets the state of each flag to it's default. More...
 

Protected Attributes

bool m_dirty
 
bool m_deleted
 
bool m_new
 

Detailed Description

Class encapsulating state of an object in the data model.

Provides additional flags to identityf whether the object is dirty, has been deleted or is new.

Definition at line 38 of file kitmodel.hpp.

Constructor & Destructor Documentation

◆ GuiState()

GuiState::GuiState ( )
inline

Definition at line 44 of file kitmodel.hpp.

Member Function Documentation

◆ is_deleted()

bool GuiState::is_deleted ( )
inline

◆ is_dirty()

bool GuiState::is_dirty ( )
inline

Definition at line 45 of file kitmodel.hpp.

References m_dirty.

◆ is_new()

bool GuiState::is_new ( )
inline

Definition at line 50 of file kitmodel.hpp.

References m_new, and reset().

◆ reset()

void GuiState::reset ( )
virtual

resets the state of each flag to it's default.

The dirty, deleted and new flags are set to false.

Reimplemented in ModelCategory.

Definition at line 36 of file kitmodel.cpp.

References m_deleted, m_dirty, and m_new.

Referenced by ModelCategory::get_added_children(), is_new(), ModelCategory::reset(), KitModel::reset(), and KitModel::show_unchecked_only().

◆ set_deleted()

void GuiState::set_deleted ( bool  deleted)
inline

Definition at line 48 of file kitmodel.hpp.

Referenced by Service::delete_category(), and Service::delete_item().

◆ set_dirty()

void GuiState::set_dirty ( bool  dirty = true)
inline

◆ set_new_flag()

void GuiState::set_new_flag ( bool  flag)
inline

Definition at line 49 of file kitmodel.hpp.

Referenced by Service::create_category(), and Service::create_item().

Member Data Documentation

◆ m_deleted

bool GuiState::m_deleted
protected

Definition at line 41 of file kitmodel.hpp.

Referenced by is_deleted(), and reset().

◆ m_dirty

bool GuiState::m_dirty
protected

Definition at line 40 of file kitmodel.hpp.

Referenced by is_dirty(), KitModel::is_dirty(), and reset().

◆ m_new

bool GuiState::m_new
protected

Definition at line 42 of file kitmodel.hpp.

Referenced by is_new(), and reset().


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

Copyright 2008-2021 Frank Dean