// $Id: SctTypes.hpp,v 1.20 2006/03/21 01:08:46 philw Exp $
// SCT 2.0, Public Types
//
//---

#ifndef SctTypesINCLUDED
#define SctTypesINCLUDED

// *********************************
// *** Some Configuration Values ***
// *********************************

// Filename Filter String used by Qt QFileDialog methods:
// Warning - this string is interpreted programmatically.
// (i.e. the format is significant).
//
static const char (*SctFileFilterStr) (
 "SCT Files (*.sct *.sct.gz *.SCT *.SCT.gz);;All Files (*)");
 
// ***********************************
// *** Diagnostics to Standard Out ***
// ***********************************

// Diagnostic macro definitions should be one of:
//
//   if (0)
//   if (1)

// Note: 
//   For mouse-click "resolution" events, use SctDiag2
//   For mouse-move  "resolution" events, use SctDiag3

#define SctDiag0 if (0)  // recoverable errors
#define SctDiag1 if (0)  // summary information (brief)
#define SctDiag2 if (0)  // trace information (verbose)
#define SctDiag3 if (0)  // trace information (more verbose)

// ********************
// *** Public Types ***
// ********************

// defined below
class SlotIndexClass;
class TstepIndexClass;

namespace Sct
{
#if 0
   typedef int SlotInx;   // SCT Slot Index:     (-1)=Und, 0...
   typedef int TstepInx;  // SCT Timestep Index: (-1)=Und, 0...
#else
   typedef SlotIndexClass  SlotInx;
   typedef TstepIndexClass TstepInx;
#endif
}

typedef enum {
  SCT_ORIENT_TIME_HORZ = 0,
  SCT_ORIENT_TIME_VERT
} SctOrientation;

typedef enum {
  SCT_VIEWTYPE_UND = 0,
  SCT_VIEWTYPE_AGG_TIME_HORZ,
  SCT_VIEWTYPE_AGG_TIME_VERT,
  SCT_VIEWTYPE_NOAGG_TIME_HORZ,
  SCT_VIEWTYPE_NOAGG_TIME_VERT
} SctViewType;

typedef enum {
  SCT_ROW_TYPE_UND = 0,
  SCT_ROW_TYPE_NON_AGG,
  SCT_ROW_TYPE_SUMMARY,
  SCT_ROW_TYPE_DETAIL,
  SCT_ROW_TYPE_DETAIL_LAST,
  SCT_ROW_TYPE_DIVIDER_SLOT,
  SCT_ROW_TYPE_DIVIDER_TSTEP
} SctRowType;

typedef enum {
  SCT_COL_TYPE_UND = 0,
  SCT_COL_TYPE_DATA_AGG,
  SCT_COL_TYPE_DATA_NOAGG,
  SCT_COL_TYPE_DIVIDER_SLOT,
  SCT_COL_TYPE_DIVIDER_TSTEP,

  SCT_COL_TYPE_RH_LINE_NUM,
  SCT_COL_TYPE_RH_SLOT_TYPE,
  SCT_COL_TYPE_RH_TREE_CTRL,
  SCT_COL_TYPE_RH_SLOT_LABEL,
  SCT_COL_TYPE_RH_UNITS,
  SCT_COL_TYPE_RH_SUM_TYPE,
  SCT_COL_TYPE_RH_TIME,
  SCT_COL_TYPE_RH_WEEKDAY,
  SCT_COL_TYPE_RH_NOTE
} SctColType;

typedef enum {
  SCT_TSTEP_DIV_TYPE_UND = 0,
  SCT_TSTEP_DIV_TYPE_SIM,      // Pre-Sim / Sim / Post-Sim Divider
  SCT_TSTEP_DIV_TYPE_DAY,      // Weekend / Weekday Divider
  SCT_TSTEP_DIV_TYPE_WEEKEND,  // Weekend / Weekday Divider
  SCT_TSTEP_DIV_TYPE_MONTH,    // Month Divider
  SCT_TSTEP_DIV_TYPE_YEAR      // Annual Divider
} SctTstepDivType;

typedef enum {
  SCT_DETAIL_MODE_UND = 0,
  SCT_DETAIL_MODE_NO_SUMMARIES,
  SCT_DETAIL_MODE_ALL_OPEN,
  SCT_DETAIL_MODE_ALL_CLOSED,
  SCT_DETAIL_MODE_USER
} SctDetailMode;

typedef enum {
  SCT_TSTEP_TARGET_STATE_NONE = 0,
  SCT_TSTEP_TARGET_STATE_BEGIN,
  SCT_TSTEP_TARGET_STATE_MID,
  SCT_TSTEP_TARGET_STATE_END
} SctTstepTargetState;

typedef enum {
  SCT_COLFIT_METHOD_UND = 0,
  SCT_COLFIT_METHOD_NOTSUP,    // Not supported (e.g. in particular SctView)
  SCT_COLFIT_METHOD_MANUAL,    // adjusted by user
  SCT_COLFIT_METHOD_UNIFORM,   // set to width of one selected column
  SCT_COLFIT_METHOD_HEAD,      // fit to header width
  SCT_COLFIT_METHOD_DATA,      // fit to maximum data width
  SCT_COLFIT_METHOD_ALL        // fit to header, maximum data width
} SctColFitMethod;

typedef enum {
  SCT_SUMMARY_FLAGS_OFF,
  SCT_SUMMARY_FLAGS_WHEN_DETAILS_HIDDEN,
  SCT_SUMMARY_FLAGS_WHEN_7_OR_FEWER_TSTEPS,
  SCT_SUMMARY_FLAGS_ON
} SctSummaryFlagsShown;

typedef enum {
  SCT_RESCROLL_NOP = 0,    // No operation
  SCT_RESCROLL_PRESERVE,   // Preserve geometric position (from top, left)
  SCT_RESCROLL_SLOT_BEGIN, // Scroll to beginning of Slot list
  SCT_RESCROLL_SLOT_END,   // Scroll to end of Slot list
  SCT_RESCROLL_SLOT_INX    // Scroll to a particluar Slot (NOT IMPLEMENTED)
} SctRescrollType;

// Note: SctSumFuncSpec moved to SctSumFuncSpec.hpp

// ************************
// *** Slot Index Class ***
// ************************

// Note [October 2003]: This is experimental. Not currently used.

class SlotIndexClass
{
private:
   int _sinx;
   SlotIndexClass (const TstepIndexClass&) {} // disallow

public:
   SlotIndexClass () { _sinx = (-1); }
   SlotIndexClass (int sinx) { _sinx = sinx; }
   SlotIndexClass (const SlotIndexClass& s) { _sinx = s._sinx; }

   SlotIndexClass& operator= (int rhs) { _sinx = rhs; return *this; }
   operator int() const { return _sinx; }
};

// ****************************
// *** Timestep Index Class ***
// ****************************

// Note [October 2003]: This is experimental. Not currently used.

class TstepIndexClass
{
private:
   int _tinx;
   TstepIndexClass (const SlotIndexClass&) {} // disallow

public:
   TstepIndexClass () { _tinx = (-1); }
   TstepIndexClass (int tinx) { _tinx = tinx; }
   TstepIndexClass (const TstepIndexClass& t) { _tinx = t._tinx; }

   TstepIndexClass& operator= (int rhs) { _tinx = rhs; return *this; }
   operator int() const { return _tinx; }
};

#endif
//--- (end SctTypes.hpp) ---